Error when adding a domain

Trying to create domain but fail in the process.

When creating the domain it fail to restart nginx show me this error “Error: nginx restart failed”.

Because the error say me nothing and no error show in the nginx logs i try to add manualy.

v-add-web-domain  'user' 'domain.com' '1.1.1.1' 'yes'
grep: warning: ? at start of expression
grep: warning: ? at start of expression
Error: nginx restart failed

Debian 12.1
v1.8.7

You could try to debug the script, try this:

bash -x v-add-web-domain 'user' 'domain.com' '1.1.1.1' 'yes'

There are seems two errors

warning: ? at start of expression

This error come from here.

grep -E 'listen.*\s\bssl\b(?:\s)*.*;' /home/user/conf/web/domain.com/apache2.conf
grep: warning: ? at start of expression

grep -E 'listen.*\s\bssl\b(?:\s)*.*;' /home/user/conf/web/domain.com/nginx.conf
grep: warning: ? at start of expression

The other one come with the command v-restart-proxy yes

Unfortunately I can’t find anything here. Only see send error to email but not see what cause it.

send_email_report
grep CONTACT /usr/local/hestia/data/users/admin/user.conf
email='CONTACT='\''[email protected]'\'''
'CONTACT='\''[email protected]'\'''
cut -f 2 -d \'
[email protected]
mktemp
tmpfile=/tmp/tmp.3dMFSrpPY8
hostname
subj='host.domain.com: nginx restart failed'
nginx -t
'[' '' == DO_RESTART ']'
cat /tmp/tmp.3dMFSrpPY8
/usr/local/hestia/web/inc/mail-wrapper.php -s 'host.domain.com: nginx restart failed' [email protected]

Issue is here:

It is a warning but as far as I know, the expression works. The grep command is using extended regex -E but for some reason it is trying to use a non-capturing group (?:\s) that is not available in extended regex -E but it is in perl regex -P. Anyway, I don’t think that is the problem.

What is the output of nginx -t

The site is actually created?

I see why fail restart nginx.

service $PROXY_SYSTEM configtest

Why is using service command is considering legacy and the command is deprecated also configtest is deprecated too.

If you want use to test config file should be use nginx -t instead of service nginx configtest

I don’t think it is because is using service nginx configtest to test the config.

$ service nginx configtest
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Are you sure nginx -t or service nginx configtest doesn’t give any error?

I think I don’t explained well.

  1. Restart never exist is just error message.
  2. When i say services command the command is obsolete
  3. Error come because service nginx configtest throw me an error
service nginx configtest
nginx: unrecognized service
  1. Because previous error, v-restart-proxy yes show me an error i report here.

Service command still works but not with configtest

Uff, that is really weird. Did you remove manually nginx service?

Please, show the ouput of these commands:

service --status-all | grep nginx
ls -l /etc/init.d/nginx*
service --status-all | grep nginx
 [ + ]  nginx
 [ - ]  nginx-debug
ls -l /etc/init.d/nginx*
-rwxr-xr-x 1 root root 4287 Aug 15 18:48 /etc/init.d/nginx
-rwxr-xr-x 1 root root 4312 Aug 15 18:48 /etc/init.d/nginx-debug

Really strange.

Running it directly shows any error?
/etc/init.d/nginx configtest

Other service commands work?

service nginx status
service nginx reload
service ssh status

Also, show the output of this command:
bash -x service nginx configtest