• Please be aware: Kaspersky Anti-Virus has been deprecated
    With the upgrade to Plesk Obsidian 18.0.64, "Kaspersky Anti-Virus for Servers" will be automatically removed from the servers it is installed on. We recommend that you migrate to Sophos Anti-Virus for Servers.
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

Plesk 11.5 - 502 bad gateway

ManuelG2k

Basic Pleskian
Hello,
I have Plesk Panel 11.5.30 Update #3 on Linux ubuntu Server 12.0.4.2 LTS

When I try to export a database from phpmyadmin, I receive this error:

502 bad Gateway

I find this error on /var/log/sw-cp-server/error_log

2013/07/16 09:31:20 [error] 4298#0: *33397 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 88.149.137.195, server: , request: "POST /domains/databases/phpMyAdmin/export.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/sw-engine.sock:", host: "mydomain.com:8443", referrer: "https://mydomain.com:8443/domains/databases/phpMyAdmin/db_export.php?db=la-raia_it&server=1&token=df81cd4565060e1a281ce8c774b371e6"


Can you help me ?
 
Database size is 21 Mb
No error on syslog
I reboot the server and now works :|

Can you repeat the export? on multiple servers i cannot export databases all times (first time it works mostly, other times not)
Same problem : bad gateway.

De panel.log is giving strage errors:

[17-Jul-2013 10:57:36 Europe/Berlin] PHP Fatal error: Cannot redeclare (null)() (previously declared in /opt/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/export/sql.php:9) in /opt/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/export/sql.php on line 325

On line 9 of the sql.php:
if (! defined('PHPMYADMIN')) {
exit;
}
 
Can you repeat the export? on multiple servers i cannot export databases all times (first time it works mostly, other times not)
Same problem : bad gateway.

De panel.log is giving strage errors:

[17-Jul-2013 10:57:36 Europe/Berlin] PHP Fatal error: Cannot redeclare (null)() (previously declared in /opt/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/export/sql.php:9) in /opt/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/export/sql.php on line 325

On line 9 of the sql.php:
if (! defined('PHPMYADMIN')) {
exit;
}

Same error.

[17-Jul-2013 10:16:26 Europe/Berlin] PHP Fatal error: Cannot redeclare (null)() (previously declared in /opt/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/export/sql.php:9) in /opt/psa/admin/htdocs/domains/databases/phpMyAdmin/libraries/export/sql.php on line 325

after restarting the server everything works
 
I try to restart apache, psa and ngix, but not work.
After reboot entire server, works.

Ok, but i don't want to reboot the whole server for such a bug, a restart of apache/ plesk /nginx should be sufficient.
Can you try to export mysql databases a few times? and to restart plesk / apache / nginx in between.

I keep getting the error even after psa stopall / start
 
Basically, if anything like reboot helps in such situation, restart of sw-engine service should help as well. Please check. Also post your /usr/local/psa/admin/conf/php.ini.
 
Basically, if anything like reboot helps in such situation, restart of sw-engine service should help as well. Please check. Also post your /usr/local/psa/admin/conf/php.ini.

Yes, but i tried the reboot now on the testserver, same problem occurs

Code:
short_open_tag = On
y2k_compliance = Off
output_buffering = Off
max_execution_time = 600
max_input_time = 600
memory_limit = 128M
max_file_uploads = 99999
max_input_vars = 2000

error_reporting = E_ALL & ~E_NOTICE & ~E_STRICT & ~E_DEPRECATED
log_errors = On
display_errors = Off
warn_plus_overloading = Off
expose_php = Off

variables_order = "ECGPS"
register_argc_argv = On
post_max_size = 2147483647
magic_quotes_gpc = Off
magic_quotes_runtime = Off

include_path = "/opt/psa/admin/plib:/opt/psa/admin/externals"
upload_tmp_dir = "/tmp"
upload_max_filesize = 2147483647

apc.stat = 1
apc.shm_size = 100M
apc.max_file_size = 500K
apc.slam_defense = 0
apc.enabled = 1

swkey.repository_dir = "/etc/sw/keys"

psasem.semfile = "/opt/psa/var/psasem.sem"

zend_extension = "/usr/lib/php/modules/sw-engine/ioncube_loader_lin_5.4.so"

Almost every time i'm getting the 520 bad gateway when i export a database (even a empty one) in phpmyadmin
 
Last edited:
In /usr/local/psa/admin/conf/php.ini try setting apc.enabled = 0 and then doing # service sw-engine restart. If this helps, then revert your changes and instead set up apc.filters to exclude phpMyAdmin code.

@topic starter: if you're allowed to, please rename the thread to something more appropriate. I spent quite some time searching for it to post this message.
 
I'm having the same problem.
Restarting doesn't help, disabling apc doesn't work either.
Anyone else have any suggestions?
 
Thanks for your answer.
This doesn't fix it for me, and I'm also pretty sure Plesk doesn't use this config file, cause it uses sw-cp-server
 
Thanks for your answer.
This doesn't fix it for me, and I'm also pretty sure Plesk doesn't use this config file, cause it uses sw-cp-server

You have to restart nginx ofcourse, but strangely it affects thats phpmyadmin is working again.

I think more people should have the same issue if they are going to check it (try dumping a medium size database)
 
Altering /etc/nginx/nginx.conf will have no effect on phpMyAdmin (provided you use one bundled with Plesk) since it works on sw-cp-server/sw-engine. Just as Dree have said.
 
Back
Top