Not able to rebuild user

When rebuilding a user, I get this issue:

root@portal ~ # v-rebuild-user “username” yes
sed: -e expression #1, char 3: unknown command: ' sed: -e expression #1, char 3: unknown command:

sed: -e expression #1, char 3: unknown command: ' sed: -e expression #1, char 3: unknown command:

sed: -e expression #1, char 3: unknown command: ' sed: -e expression #1, char 3: unknown command:

sed: -e expression #1, char 3: unknown command: ' sed: -e expression #1, char 3: unknown command:

root@portal ~ #

Show the unedited output of this command (replace YourUser with the actual user):

v-list-user YourUser json | sed 's/"RKEY": ".*"/"RKEY": ""/'
root@portal ~ # v-list-user inquire json | sed 's/"RKEY": ".*"/"RKEY": ""/'
{
    "inquire": {
        "NAME": "Inquire",
        "PACKAGE": "Growth",
        "WEB_TEMPLATE": "default",
        "BACKEND_TEMPLATE": "default",
        "PROXY_TEMPLATE": "default",
        "DNS_TEMPLATE": "default",
        "WEB_DOMAINS": "25",
        "WEB_ALIASES": "5",
        "DNS_DOMAINS": "25",
        "DNS_RECORDS": "unlimited",
        "MAIL_DOMAINS": "25",
        "MAIL_ACCOUNTS": "15",
        "DATABASES": "0",
        "CRON_JOBS": "5",
        "DISK_QUOTA": "10000",
        "BANDWIDTH": "10000",
        "HOME": "/home/inquire",
        "NS": "ns1.domain.net,ns2.domain.net",
        "SHELL": "nologin",
        "BACKUPS": "1",
        "CONTACT": "[email protected]",
        "CRON_REPORTS": "yes",
        "RKEY": "",
        "TWOFA": "",
        "QRCODE": "",
        "ROLE": "user",
        "SUSPENDED": "no",
        "SUSPENDED_USERS": "2",
        "SUSPENDED_WEB": "0",
        "SUSPENDED_DNS": "0",
        "SUSPENDED_MAIL": "0",
        "SUSPENDED_DB": "0",
        "SUSPENDED_CRON": "0",
        "IP_AVAIL": "6",
        "IP_OWNED": "1",
        "U_USERS": "11",
        "U_DISK": "3286",
        "U_DISK_DIRS": "",
        "U_DISK_WEB": "",
        "U_DISK_MAIL": "3268",
        "U_DISK_DB": "0",
        "U_BANDWIDTH": "18",
        "U_WEB_DOMAINS": "17",
        "U_WEB_SSL": "16",
        "U_WEB_ALIASES": "17",
        "U_DNS_DOMAINS": "21",

The output is incomplete, so it looks like something is wrong in the user.conf file.

cat -A /usr/local/hestia/data/users/inquire/user.conf | sed "s/RKEY='.*'/RKEY=''/"
root@portal ~ # cat -A /usr/local/hestia/data/users/inquire/user.conf | sed "s/RKEY='.*'/RKEY=''/"
NAME='Inquire'^M$
PACKAGE='Growth'^M$
WEB_TEMPLATE='default'^M$
BACKEND_TEMPLATE='default'^M$
PROXY_TEMPLATE='default'^M$
DNS_TEMPLATE='default'^M$
WEB_DOMAINS='25'^M$
WEB_ALIASES='5'^M$
DNS_DOMAINS='25'^M$
DNS_RECORDS='unlimited'^M$
MAIL_DOMAINS='25'^M$
MAIL_ACCOUNTS='15'^M$
RATE_LIMIT='100'^M$
DATABASES='0'^M$
CRON_JOBS='5'^M$
DISK_QUOTA='10000'^M$
BANDWIDTH='10000'^M$
NS='ns1.domain.net,ns2.domain.net'^M$
SHELL='nologin'^M$
BACKUPS='1'^M$
CONTACT='[email protected]'^M$
CRON_REPORTS='yes'^M$
MD5='$y$j9T$0dZGzMJVsqhJPvKNOWaXJ0$pCSVQa4hD1P5bwdSdxzjWuMB0rTqFk6CcElkF1SGcm0'^M$
RKEY=''^M$
TWOFA=''^M$
QRCODE=''^M$
PHPCLI=''^M$
ROLE='user'^M$
SUSPENDED='no'$
SUSPENDED_USERS='0'$
SUSPENDED_WEB='0'$
SUSPENDED_DNS='0'$
SUSPENDED_MAIL='0'$
SUSPENDED_DB='0'$
SUSPENDED_CRON='0'$
IP_AVAIL='6'$
IP_OWNED='1'$
U_USERS='0'$
U_DISK='3286'$
U_DISK='3286'$
U_DISK_MAIL='3268'$
U_DISK_DB='0'$
U_BANDWIDTH='18'$
U_WEB_DOMAINS='16'$
U_WEB_SSL='16'$
U_WEB_ALIASES='16'$
U_DNS_DOMAINS='21'$
U_DNS_DOMAINS='21'$
U_DNS_RECORDS='289'$
U_MAIL_DKIM='17'$
U_DATABASES='0'$
U_CRON_JOBS='0'$
U_CRON_JOBS='0'$
U_BACKUPS='1'$
U_BACKUPS='1'$
LANGUAGE='en'^M$
THEME=''^M$
NOTIFICATIONS='yes'^M$
PREF_UI_SORT='name'^M$
LOGIN_DISABLED='no'^M$
LOGIN_USE_IPLIST='no'^M$
LOGIN_ALLOW_IPS=''^M$
TIME='14:35:25'^M$
DATE='2024-06-10'^M$
root@portal ~ #

Those ^M means you edited the file using a Windows editor.

apt install dos2unix -y
dos2unix /usr/local/hestia/data/users/inquire/user.conf

Once done try to rebuild the user again.

1 Like

Same issue. It is only happening with this specific user. I am able to rebuild other users.

root@portal ~ # apt install dos2unix -y
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
dos2unix is already the newest version (7.4.3-1).
0 upgraded, 0 newly installed, 0 to remove and 85 not upgraded.
root@portal ~ # dos2unix /usr/local/hestia/data/users/inquire/user.conf
dos2unix: converting file /usr/local/hestia/data/users/inquire/user.conf to Unix format…
root@portal ~ # v-rebuild-user inquire yes
sed: -e expression #1, char 3: unknown command: ' sed: -e expression #1, char 3: unknown command:

sed: -e expression #1, char 3: unknown command: ' sed: -e expression #1, char 3: unknown command:

sed: -e expression #1, char 3: unknown command: ' sed: -e expression #1, char 3: unknown command:

sed: -e expression #1, char 3: unknown command: ' sed: -e expression #1, char 3: unknown command:

root@portal ~ #

It’s not the first time you have this issue.

Also, did you edit manually other conf files?

You should try to debug the command to know where it’s failing:

bash -x v-rebuild-user inquire yes

Tried debugging, but changing the package fixed the issue for me. Thanks for the help.

You’re welcome.

If you keep editing the files manually you’ll get unexpected errors like this.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.