• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved All websites give 502 after adding a subscription (config template error)

Maarten

New Pleskian
Just created a new subscription on my Plesk Onxy (17.0.17 #27) server with domeinname xyz.nl and username "xyz". After that I received the following notification and now all the websites on the server give a 502 error.
Code:
New configuration files for the Apache web server were not created due to the errors in configuration templates: AH00112: Warning: DocumentRoot [/var/www/vhosts/anotherwebsite.nl/httpdocs] does not exist AH00543: httpd: bad user name XYZ. Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter

Also received the following email:
Code:
Unable to generate the web server configuration file on the host <webcademyplatform.nl> because of the following errors:
Template_Exception: AH00112: Warning: DocumentRoot [/var/www/vhosts/anotherwebsite.nl/httpdocs] does not exist
AH00543: httpd: bad user name xyz
file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
Please resolve the errors in web server configuration templates and generate the file again.

The strange thing is that the website in the error message (anotherwebsite.nl) is not the same as the website xyz.nl that I tried to add. I tried to rebuild all the config files, but that did not work. Any other ideas?
 
Good that the message at least clearly states what the problem is.

As a first step to solve this, I suggest to look into the configuration files of the domain that is causing the problem here:
/var/www/vhosts/system/<domainname>/conf/httpd.conf
and find out the user name it is trying to set for the Apache configuration.

Then find out if that user still exists on your server and in the affected subscription and if it consists of ASCII characters only. If that is not the case, add the user or change the name to a valid Linux user name.
 
Thanks SO MUCH for your fast respons!
Just deleted the website and the user that I created as least. However the problem still accours.

What should you do?
 
Every thing I try to do give this error:
Code:
Error: Can not reconfigure web server configurations: Unable to execute httpdmng: [2017-06-10 15:36:49] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
[2017-06-10 15:36:55] ERR [util_exec] proc_close() failed ['/usr/local/psa/admin/bin/apache-config' '-t'] with exit code [1]
Error occured while sending feedback. HTTP code returned: 502
[2017-06-10 15:37:02] ERR [panel] Apache config (14971018070.04176300) generation failed: Template_Exception: AH00112: Warning: DocumentRoot [/var/www/vhosts/deplek.nu/httpdocs] does not exist
AH00543: httpd: bad user name hoyacademy

file: /usr/local/psa/admin/plib/Template/Writer/Webserver/Abstract.php
line: 75
code: 0
AH00112: Warning: DocumentRoot [/var/www/vhosts/deplek.nu/httpdocs] does not exist
AH00543: httpd: bad user name hoyacademy
 
When you have removed the usr and domain, no config files should have remained. Could you please run

# grep -R hoyacademy /var/www/vhosts/system/*

and report the output here? Further, in the state where Plesk does not show the domain or user, please run

# plesk repair db -y
 
Thanks for your fast responses. You are really my hero right now.

Output to long to post: output.txt

Lots of hits as you can see. Do I need to run the command?
# plesk repair db -y
 
The problem is caused by remaining configuration files even after you had deleted the subscription (and/or domain):
Code:
/var/www/vhosts/system/deplek.nu/conf/httpd.conf.bak:                                        SuexecUserGroup "hoyacademy" "psacln"
/var/www/vhosts/system/deplek.nu/conf/httpd.conf:                                 SuexecUserGroup "hoyacademy" "psacln"
/var/www/vhosts/system/deplek.nu/conf/last_httpd.conf:                                       SuexecUserGroup "hoyacademy" "psacln"
These are probably not only still in the /system path, but likely also linked from the /etc/httpd/conf/plesk.conf.d/ subdirectories. I had previously seen cases where a domain or subscription is deleted, but the files are not deleted and point to non-existent directories or use non-existent user accounts.

Here is my suggestion:

Please first run
# plesk repair db -y
The command will resolve inconsistencies in the database. This is needed before you later re-create (reconfigure) all webserver configuration files from the database entries.

For the next steps you must be absolutely sure that you have removed the domain "deplek.nu" from Plesk. There must not be any references in Plesk to that domain before you execute the next step. Do not proceed when you still have deplek.nu in your Plesk panel somewhere (domains, subscriptions, a subdomain maybe).

Then remove the orphans:
# rm -R /var/www/vhosts/system/deplek.nu
# rm -R /var/www/vhosts/deplek.nu

Then remove orphan symbolic links to httpd configuration files:
# rm /etc/httpd/conf/plesk.conf.d/forwarding/deplek*
# rm /etc/httpd/conf/plesk.conf.d/vhosts/deplek*
# rm /etc/httpd/conf/plesk.conf.d/webmails/deplek*
# rm /etc/httpd/conf/plesk.conf.d/wildcards/deplek*

Then the same for Nginx configuration links:
# rm /etc/nginx/plesk.conf.d/forwarding/deplek*
# rm /etc/nginx/plesk.conf.d/vhosts/deplek*
# rm /etc/nginx/plesk.conf.d/webmails/deplek*
# rm /etc/nginx/plesk.conf.d/wildcards/deplek*

Then let Plesk reconfigure all configuration files:
# /usr/local/psa/admin/sbin/httpdmng --reconfigure-all

Webservers should start afterwards, because now the wrong configuration files are all gone and no references to the non-existent user is left.
 
Last edited:
Thanks for your fast responses! And pointing out the way to look. With some other external help we are now getting most of the websites back online.

The plesk overview page still gives the following error:
Code:
New configuration files for the Apache web server were not created due to the errors in configuration templates: Template processing failed: file = /usr/local/psa/admin/conf/templates/default/domainVhost.php, error = Template_Exception: No data. file: /usr/local/psa/admin/plib/Template/Processor.php line: 28 code: 0 Previous error: Template_Variable_Exception: No data. file: /usr/local/psa/admin/plib/Template/Variable/AbstractCachedData.php line: 67 code: 0. Detailed error descriptions were sent to you by email. Please resolve the issues and click here to generate broken configuration files once again or here to generate all configuration files. See the details in Configuration Troubleshooter
 
Is there a file called /usr/local/psa/admin/plib/Template/Variable/AbstractCachedData.php

just check with the command

ll /usr/local/psa/admin/plib/Template/Variable/AbstractCachedData.php
 
Last edited by a moderator:
Could you please go into the Plesk Troubleshooter extension and reconfigure the erroneous files there? It is a setting that you can select from the drop down box of the extension. This might resolve the message and clear some more errors.
 
Hi iServersupport,

your link to your PAID services is not only forbidden here in the Plesk Community Forum ( advertising third party services ), it is as well an indication, that you didn't really understand the meaning and purpose of a "Plesk Community Forum", where we help each other to solve issues/errors/problems with Plesk and discuss Plesk - related topics. Pls. avoid such posts in the future ( post has been reported as well, @IgorG ).
 
@Peter
There where 2 files with path n/a with the domain deplek.nu. I deleted the files in the troubleshooter and now the error dissappeared. Thanks so much for your help!
 
Back
Top