• 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

Template processing failed

Oshikuru

New Pleskian
We have a problem with our plesk servers.
I executed "/usr/local/psa/admin/sbin/httpdmng --reconfigure-all" and now the plesk interface shows an error message:

Aufgrund folgender Fehler in den Konfigurations-Templates konnten keine neuen Konfigurationsdateien für den Apache Webserver erstellt werden: Template processing failed: file = /opt/psa/admin/conf/templates/custom/server.php, error = Template_Exception: Incomplete metainfo, domainId undefined. file: /opt/psa/admin/plib/Template/Processor.php line: 27 code: 0 Previous error: Template_Exception: Incomplete metainfo, domainId undefined. file: /opt/psa/admin/plib/Template/Processor.php line: 27 code: 0 Previous error: Template_Exception: Incomplete metainfo, domainId undefined. file: /opt/psa/admin/plib/Template/Processor.php line: 27 code: 0 Previous error: Template_Variable_Exception: Incomplete metainfo, domainId undefined. file: /opt/psa/admin/plib/Template/Variable/Domain.php line: 25 code: 0. Die Fehlermeldung mit detaillierter Fehlerbeschreibung wurde Ihnen per E-Mail zugesendet. Bitte lösen Sie das Problem und klicken Sie hier, um die beschädigten Konfigurationsdateien erneut zu erstellen, oder hier, um alle Konfigurationsdateien zu erstellen.

I found out that all domain configs were generated correctly, but the psa database shows an error (select * from Configurations where status = 'error'; ) for file /etc/apache2/plesk.conf.d/server.conf.

Can someone imagine what the problem could be or else how to figure the problem out?

Thanks!
 
Hi Oshikuru,

the error shows, that you have a custom server.php ( /opt/psa/admin/conf/templates/custom/server.php ), which has some misconfiguration(s). To help to investigate the file, please post the content of "/opt/psa/admin/conf/templates/custom/server.php" in your next post.


You could as well solve the issue during the investigation, when you move the custom template to another directory, so that the command "/usr/local/psa/admin/sbin/httpdmng --reconfigure-all" generates the needed configuration files from the standard template directory.


Example to move the misconfigured custom template, so that all configuration files can be generated without failures:
mkdir /opt/psa/admin/conf/templates/temp_to_investigate
mv /opt/psa/admin/conf/templates/custom/server.php /opt/psa/admin/conf/templates/temp_to_investigate/
/usr/local/psa/admin/sbin/httpdmng --reconfigure-all
 
Thank you, but unfortunately that did not solve the problem.

The Difference between the default server.php and our custom server.php is just that we commented out the following line:
Code:
--- /opt/psa/admin/conf/templates/custom/server.php
+++ /opt/psa/admin/conf/templates/default/server.php
@@ -55,7 +55,7 @@
</Directory>
<IfModule mod_headers.c>
-    #Header add X-Powered-By PleskLin
+    Header add X-Powered-By PleskLin
</IfModule>
<?php echo $VAR->includeTemplate('server/tomcat.php') ?>


Any other ideas?
 
Last edited:
Hi Oshikuru,

well, the server.php template includes several other templates as well
Code:
    Line 5: echo $VAR->includeTemplate('server/nameVirtualHost.php', array(
    Line 9: echo $VAR->includeTemplate('server/nameVirtualHost.php', array(
    Line 31: <?php echo $VAR->includeTemplate('server/PCI_compliance.php') ?>
    Line 39: <?php echo $VAR->includeTemplate('service/php.php', array(
    Line 66: <?php echo $VAR->includeTemplate('server/tomcat.php') ?>
    Line 70: <?php echo $VAR->includeTemplate('server/vhosts.php', array(
    Line 74: <?php echo $VAR->includeTemplate('server/vhosts.php', array(
    Line 79: <?php echo $VAR->includeTemplate('server/mailman.php') ?>
    Line 81: <?php echo $VAR->includeTemplate('server/rpaf.php', array('mod' => 'mod_rpaf.c')); ?>
    Line 83: <?php echo $VAR->includeTemplate('server/rpaf.php', array('mod' => 'mod_rpaf-2.0.c')); ?>
    Line 85: <?php echo $VAR->includeTemplate('server/remoteip.php', array('mod' => 'mod_remoteip.c')); ?>
so the misconfiguration can be caused as well by other custom templates. In your case the "domainID" is undefined, which points to the fact, that the template processor can't fetch the domainID, which will be replaced with the fully qualified domain name depending on the stored domainID in the psa - database. Due to the case that I don't "guess" to investigate issues, please add the depending php - files for further investigations.
 
Thank you for that.

I checked the following:
The directory /opt/psa/admin/conf/templates/custom/server is empty, so there can not be an error.
So the only file you have mentioned we have modified is service/php.php. In this file are just two lines that we have changed. Both lines work correctly and when I comment out these lines the error is still present.
Can there be anything else that can cause the error? Perhaps the database or something else? :confused:
 
I found it out! It was my own fault! We made changes in /opt/psa/admin/conf/templates/custom/service/php.php over a year ago. Then we made other changes in this file a few month ago (shortly before I wrote the first time in this thread). Then we executed "/opt/psa/admin/sbin/httpdmng --reconfigure-all". Then suddenly the error was shown in the plesk panel. So I commented out the changes we made this year but the error did not disappear.
So I set up a test system, used the same configuration and the error appeared there too!
After a few tests with the config I found out that ALL the changes we made were causing the error, even the changes we made LAST YEAR :eek:

I thought that they all work because in all vhosts files the changes were made and reconfigure-all was working last year after the first changes were made. But the variable "$VAR->domain" we use in the file is not set, when the reconfigure-all command tries to generate the file "/etc/apache2/plesk.conf.d/server.conf". So the execution of the command was aborted!
I think there has been an update for plesk that causes reconfigure-all to abort at this time.
 
Back
Top