The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Recreate user with API same uid/gid

Discussion in 'cPanel Developers' started by tommylin, May 22, 2017.

  1. tommylin

    tommylin Registered

    Joined:
    Feb 12, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Taiwan
    cPanel Access Level:
    Root Administrator
    After delete a account(whmapi1 removeacct username=ab123456),I want to recreate the account.
    I run the same create user script again:
    Code:
    /usr/local/cpanel/bin/whmapi1 createacct username=ab123456 ...............
    .................................uid=123456 gid=123456 ...........................
    
    It will fail on console,I got the error message :
    Code:
    metadata:
    command: createacct
    output:
    raw: ~
    reason: The requested uid (123456) is already in use
    result: 0
    version: 1
    Cpanel::Exception::UserNotFound/(XID m4gbpc) 您沒有名稱為“ab123456”的使用者。
    You do not have a user named “ab123456”.
    at /usr/local/cpanel/Cpanel/Exception/CORE.pm line 77.
    Cpanel::Exception::create("UserNotFound", ARRAY(0x1692410)) called at /usr/local/cpanel/Cpanel/Exception.pm line 30
    Cpanel::Exception::__ANON__(__CPANEL_HIDDEN__, ARRAY(0x1692410)) called at /usr/local/cpanel/Cpanel/PwUtils.pm line 25
    Cpanel::PwUtils::normalize_to_uid("ab123456") called at /usr/local/cpanel/Cpanel/AccessIds/Utils.pm line 27
    Cpanel::AccessIds::Utils::normalize_user_and_groups("ab123456") called at /usr/local/cpanel/Cpanel/AccessIds/SetUids.pm line 19
    ........................
    ======================================
    
    I run the linux command:
    id ab123456
    id: ab123456: No such user


    How to recreate user use the same uid/gid?
     
  2. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,064
    Likes Received:
    1,288
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    To update, it looks like a support ticket was opened to address this issue. The issue was addressed by removing some existing files with that UID from the /var/lve/snapshots/ directory on the system.

    Thank you.
     
Loading...

Share This Page