• 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.

Issue 502 Bad Gateway - again :(

Karol Kaleka

New Pleskian
After upgrade plesk to version 12.5, I started getting this error. I read all articles about this issue but still I can't resolve it.
OK,
I can login to plesk and show list of my domains, few of them works but almost half of them is not available. When I browse one of them then I receive "502 Bad Gateway". Any idea?

------------------
Error_log
2016/10/02 22:16:15 [error] 9267#0: *1580 recv() failed (104: Connection reset by peer) while reading response header from upstream, client: 152.41.123.105, server: , request: "GET /smb/web/view HTTP/1.1", upstream: "fastcgi://unix:/var/run/sw-engine.sock:",
-----------------
root# cat /etc/sw-cp-server/config | grep fastcgi_buf
fastcgi_buffers 128 2048k;
fastcgi_buffer_size 2048k;
-----------------

The same error I receive when I open wordpress-toolkit
 
Please do not mix hosted websites problem and Plesk interface problems. There are absolutely different root causes.
If we talk about Plesk itself login problem, let's begin from following steps:

# plesk installer --select-release-current --reinstall-patch --upgrade-installed-components
# plesk repair installation
 
I have problem with Plesk interface. On the left bar I have "domains". For example, if I want to add new dns record for particular domains, few of them doesn't work. I select "domains" and from the list I select "domain name" and I receive:
Bad gateway
The issue is with plesk interface, the website works correctly I can connect with them by browser, but I can't manage it. by plesk interface.
 
Do you know how to solve this:
# plesk repair db

Checking the Plesk database using the native database server tools .. [OK]

Checking the structure of the Plesk database ........................ [OK]

Checking the consistency of the Plesk databasesignal: segmentation fault
 
Hi Karol Kaleka,

could you pls. check your repair and installation logs and could you pls. consider to post them for further investigations, if you would like help from the Plesk community?

=> /var/log/plesk/




Sometimes, it is as well a good idea to change the log - level, to get more informations in psa - log - files:



In addition:
Pls. note, that the "Plesk repair utility" can be as well used with the option string "-v", which allows a MORE VERBOSE output. Example: "plesk repair installation -v"
 
Hi,
I checked repair and configuration logs. Nothing special. It looks ok, except that:
-----------
===> Cumulative upgrade and repair of APS controller database has been completed.
/opt/psa/bootstrapper/pp12.5.30-bootstrapper/bootstrapper.sh: line 4509: 17583 Segmentation fault $PRODUCT_ROOT_D/bin/sw-engine-pleskrun "$@"
Trying to reset database user password for 'apsc@'... done
APSC database has been registered successfully
/opt/psa/bootstrapper/pp12.5.30-bootstrapper/bootstrapper.sh: line 4509: 17601 Segmentation fault $PRODUCT_ROOT_D/bin/sw-engine-pleskrun "$@"
------------------------------------------

I checked my "users" and "domains" added to plesk. I can add new user and new domain. The problem is with "domains" added before update. Look for that:
I have 4 users and 18 domains:

user1 - 3 domains - OK works
maks - 11 domains - problem with all of them
user2 - 3 domains - OK works
user3 - 1 domain - OK works


Question,
where should I look for the problem?
 
Hi Karol Kaleka,

consider to investigate possible broken or/and incompatible packages for your MySQL - version and re-install them, using the official repositories.

Example for Debian/Ubuntu - based systems investigations:

dpkg -l | grep mysql
 
Karol,

Have you checked if apache was running in your services ?
It happens us that nginx was running and apache don't and that gave 502 on certain conditions.

Hope this help.

Philippe
 
# dpkg -l | grep mysql
ii libdbd-mysql-perl 4.025-1 amd64 Perl5 database interface to the MySQL database
ii libmysqlclient-dev 5.5.52-0ubuntu0.14.04.1 amd64 MySQL database development files
ii libmysqlclient18:amd64 5.5.52-0ubuntu0.14.04.1 amd64 MySQL database client library
ii libmysqlclient18:i386 5.5.52-0ubuntu0.14.04.1 i386 MySQL database client library
ii libqt4-sql-mysql:i386 4:4.8.5+git192-g085f851+dfsg-2ubuntu4.1 i386 Qt 4 MySQL database driver
ii mysql-client-5.5 5.5.52-0ubuntu0.14.04.1 amd64 MySQL database client binaries
ii mysql-client-core-5.5 5.5.52-0ubuntu0.14.04.1 amd64 MySQL database core client binaries
ii mysql-common 5.5.52-0ubuntu0.14.04.1 all MySQL database common files, e.g. /etc/mysql/my.cnf
ii mysql-server 5.5.52-0ubuntu0.14.04.1 all MySQL database server (metapackage depending on the latest version)
ii mysql-server-5.5 5.5.52-0ubuntu0.14.04.1 amd64 MySQL database server binaries and system database setup
ii mysql-server-core-5.5 5.5.52-0ubuntu0.14.04.1 amd64 MySQL database server binaries
ii mysqltuner 1.2.0-1 all high-performance MySQL tuning script
ii php5-mysql 5.5.9+dfsg-1ubuntu4.20 amd64 MySQL module for php5
ii plesk-mysql-server 12.5.30-ubuntu14.04.build1205150826.19 amd64 Plesk v12.5.30 MySQL server dependency package
ii plesk-php56-mysql 5.6.26-ubuntu14.04.16092110 amd64 A module for PHP applications that use MySQL databases
ii plesk-php70-mysql 7.0.11-ubuntu14.04.16092110 amd64 A module for PHP applications that use MySQL databases
 
Hi Karol Kaleka,

ii libmysqlclient18:amd64 5.5.52-0ubuntu0.14.04.1 amd64 MySQL database client library
ii libmysqlclient18:i386 5.5.52-0ubuntu0.14.04.1 i386 MySQL database client library

As you can see, you have TWO "libmysqlclient18" - versions installed on your server. With the command ( on Debian/Ubuntu - based systems! ):

apt-cache depends libmysqlclient18:amd64

... you will be informed, that this will conflict on your server. Pls. consider to remove the version "libmysqlclient18:i386" with for example:

dpkg --purge libmysqlclient18:i386
NOTE: Pls. consider to READ possible error messages, when using the command line. Often enough, it points you directly to the issue/problem and even gives you alternatives command line options. If you experience issues, after you removed the "libmysqlclient18:i386", pls. consider to RE-INSTALL the current existing "libmysqlclient18:amd64" version with aptitude for example:

aptitude reinstall libmysqlclient18

If you experience any problems with the current suggestions, consider to post them here for further suggestions.
 
Hello,
I removed "libmysqlclient18:i386" and I reinstalled libmysqlclient18. I repaired plesk installation again. The domains still doesn't work. I tried to use plesk repair db.

---- last line----
[2016-10-06 10:25:11] DEBUG [dbquery] [859] END: 0.00011086463928223 sec
[2016-10-06 10:25:11] DEBUG [dbquery] [860] SQL: SELECT `c`.`id` AS `clientId`, count(c.id) AS `count`, `d`.* FROM `clients` AS `c`
INNER JOIN `domains` AS `d` ON d.cl_id = c.id WHERE (d.name IS NOT NULL) AND (c.pool_id = 0) GROUP BY `c`.`id`
[2016-10-06 10:25:11] DEBUG [dbquery] [860] END: 6.1988830566406E-5 sec
[2016-10-06 10:25:11] DEBUG [dbquery] [861] SQL: SELECT l.pool_id, count(l.pool_id) FROM clients l LEFT JOIN ip_pool r
ON (l.pool_id = r.id )
WHERE r.id IS NULL GROUP BY l.pool_id
[2016-10-06 10:25:11] DEBUG [dbquery] [861] END: 7.7962875366211E-5 sec
[2016-10-06 10:25:11] DEBUG [dbquery] [862] SQL: SELECT registryApplicationId, count(registryApplicationId) FROM apsContextsApplications WHERE registryApplicationId <> '' AND registryApplicationId IS NOT NULL GROUP BY registryApplicationId
[2016-10-06 10:25:11] DEBUG [dbquery] [862] END: 5.6982040405273E-5 sec
[{WIFSIGNALED(s) && WTERMSIG(s) == SIGSEGV}], 0, {ru_utime={0, 448028}, ru_stime={0, 48003}, ...}) = 31249
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=31249, si_status=SIGSEGV, si_utime=46, si_stime=4} ---
rt_sigreturn() = 31249
futex(0x69f158, FUTEX_WAKE, 1) = 1
write(2, "signal: segmentation fault\n", 27signal: segmentation fault
) = 27
exit_group(-1) = ?
+++ exited with 255 +++

-------------------------------
 
Back
Top