• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Issue Website runs into a 504 Gateway Time-out after server restore

celebrir

New Pleskian
Server operating system version
Ubuntu 24.04.3 LTS
Plesk version and microupdate number
v18.0.72_build1800250901.06

Introduction​

A couple of days ago I had to restore the Plesk configuration from a full-backup to a new VM on Azure, on a fresh install of Plesk.
(The VM has more RAM and lacks local storage, compared to the previous VM)

The Issue​

One of my three websites runs into a 504 Error on the home page and one other page. All other pages and the Wordpress backend work just fine.
I believe what they have in common is a certain design element of the webdesign agency's custom theme.

The Logs​

25-09-07_16-23-59_9qd2c.png

What I've Tried So Far:​

  • Restarting the server
  • Re-Restoring the backup of the malfunctioning subscription (multiple times)
  • Googeling the error and seeing if anything is similar
  • Updating WP and the plugins
  • Checking files which have caused problems in the past
  • Re-enabling BIND DNS & Mail, followed by a new restore attempt
  • Changing the default admin user back to 'admin'

The Question​

What could cause this error and what else can I try?
This has never happened on the old installation.

The only idea I have left is rebuilding the VM yet again and hoping for a different outcome. (Madness?)

More Details​

On Thursday I decided to migrate my Plesk VM to another Azure Region. None of the Microsoft migration services worked as expected so I decided to rebuild the Plesk instance from scratch. (The IP changed and I moved from a Standard_D2lds_v5 to Standard_D2as_v5)
On the new VM, I applied some basic settings and removed unneeded components: DNS BIND, Mail hosting, Webmail Services
followed by the FTPS upload of the full-backup. (It was too large for browser upload)

The error logs of the restore are here:
WARNING: () The webmail service roundcube is unavailable. It will be replaced with none for the following service plans: Admin Simple, Default Domain, Unlimited, Default Simple


WARNING: () The DNS service is not installed. The DNS settings will not be restored for the following objects: Server settings, demo.MYDOMAIN.at, nice-newton.***-***-***-***.plesk.page, MYDOMAIN.at, db.MYDOMAIN.at, MYOTHERDOMAIN.at, static.MYDOMAIN.at, MYOTHEROTHERDOMAIN.at, MYOTHERDOMAIN.MYDOMAIN.at


WARNING: () The time for keeping traffic statistics on some service plans is less than the server-wide value (12). The value will be changed to 12 for these service plans.


WARNING: () The traffic statistics retention time on some domains is less than the server-wide value (12). The value will be changed to 12 for these domains.


WARNING: (Restore server object '') Failed to install the extension heavy-metal-skin: The execution of post-install.php has failed with the following message:
[2025-09-05 04:18:03.060] 105290:68ba647b0dd8b ERR [panel] Execution branding_theme has failed with exit code 4, stdout: , stderr: Can not find client 'admin'
:
0: /opt/psa/admin/plib/pm/ApiCli.php:343
pm_ApiCli::filterResult(string 'branding_theme', integer '4', string '', string 'Can not find client 'admin'
', integer '5')
1: /opt/psa/admin/plib/pm/ApiCli.php:333
pm_ApiCli::execWithPipes(string 'branding_theme', string '/opt/psa/admin/bin/php -f '/opt/psa/admin/plib/api-cli/branding_theme.php' -- '-i' '-vendor' 'admin...', integer '5', array, string '')
2: /opt/psa/admin/plib/pm/ApiCli.php:73
pm_ApiCli::call(string 'branding_theme', array)
3: /opt/psa/admin/plib/modules/heavy-metal-skin/library/SkinsManager.php:173
Modules_HeavyMetalSkin_SkinsManager::installSkins()
4: /opt/psa/admin/plib/modules/heavy-metal-skin/scripts/post-install.php:21
ERROR: pm_Exception_ResultException: Execution branding_theme has failed with exit code 4, stdout: , stderr: Can not find client 'admin'
(ApiCli.php:343)


WARNING: (Restore server object '') Execution of /opt/psa/admin/plib/api-cli/mailserver.php --set-max-connections '' -ignore-nonexistent-options failed with return code 500.
Stderr is
Unable to update the maximum number of connections: 'The value must be an integer number.'


WARNING: (Restore server object '') Execution of /opt/psa/admin/plib/api-cli/mailserver.php --set-max-connections-per-ip '' -ignore-nonexistent-options failed with return code 500.
Stderr is
Unable to update the maximum number of connections per IP address: 'The value must be an integer number.'


WARNING: (Restore reseller plan object 'Default Reseller') Execution of /opt/psa/admin/plib/api-cli/reseller_template.php --update Default\ Reseller -guid d91ed89f-303e-11f0-9a6c-0022485d2510 -ignore-nonexistent-options failed with return code 1.
Stderr is
You cannot manage resellers due to license restrictions.


WARNING: (Restore user account object 'van-admin') Internal server error: <cli><failure>There is no DSMail service for domain with id = 3</failure></cli>

Due to errors in the Azure migration, the old server does not exist anymore. Only a VM backup is still available in a Vault.

Off-Topic​

The error regarding the Theme extension is probably because I changed the default admin user's login name to something else. I assume the extension requires the admin user to be called "admin". Bug?
Anyway, that extension even threw me an error on install and only showed 2 themes ever since.
 
504 means it's not able to reach the gateway which usually means some sort of failed connection. If it's only happening on the home page and one other page, it could be something with the theme or one of the plugins that's triggering on those pages. Try disabling all the plugins and switching to a default theme, if the default theme and all plugins disabled allows the homepage and that one other page to load with no issues then you've basically narrowed it down to one of those aspect and at that point I would first turn on the plugins one at a time and see what happens. If nothing happens after turning each one back on, then disable them all again and switch back to your normal theme and test with just the theme, then slowly start enabling the plugins until it happens (if it happens).

Another thing you can test is if you use a CDN like Cloudflare, try to bypass their proxy temporary and see what happens since that could also cause problems sometimes.
 
504 means it's not able to reach the gateway which usually means some sort of failed connection. If it's only happening on the home page and one other page, it could be something with the theme or one of the plugins that's triggering on those pages. Try disabling all the plugins and switching to a default theme, if the default theme and all plugins disabled allows the homepage and that one other page to load with no issues then you've basically narrowed it down to one of those aspect and at that point I would first turn on the plugins one at a time and see what happens. If nothing happens after turning each one back on, then disable them all again and switch back to your normal theme and test with just the theme, then slowly start enabling the plugins until it happens (if it happens).

Another thing you can test is if you use a CDN like Cloudflare, try to bypass their proxy temporary and see what happens since that could also cause problems sometimes.
Correct, It only occurs on the homepage and one other page, both of which use a specific element from a custom-written or adapted theme+plugin by the agency.

The issue is with the staging environment, and we have a meeting scheduled for tomorrow afternoon to work on the website, making this situation very inconvenient.

While your suggestion might help, it doesn't solve the problem entirely. The configuration restore has caused behavior that didn't occur previously. I've pinpointed the issue to a specific element within the customized WordPress theme. If I switch themes, this element disappears. However, since this element and its theme are integral to our new website, disabling it wouldn't be a viable long-term solution.

(Disclaimer: I used AI to rephrase the above text for better readability because English isn't my native language)
 
Do you remember what version of PHP the site was using previously? Using pure NGINX or proxying to Apache? It's possible that the custom written/adapted theme and plugin could be written using a very specific version of PHP that is not installed/selected or was expecting a response from NGINX but gotten the response from Apache or vis versa.
 
@scsa20 Yes it was the newest 8.3, which is also recommended for the current WordPress release.
The website has just been set up two months ago so there aren't any problems with compatibility.

The previous NGINX/Apache settings were Plesk default. The current settings have not been touched by me. Only imported with the backup manager.

I've already tried turning nginx proxy off and letting Apache handle it alone without a change in outcome.

For some reason the site will 100% cease to load whenever that element is used.
Even on the backend when I try editing the site: As soon as I switch to preview the element, it freezes and then runs into a 504 error.
 
Back
Top