Error 502 Bei Webmail und PMA

  • Hallihallo,
    habe seit dem Update von 1.2.9 auf 1.2.17 das Problem, dass der Webmailer, sowie PMA Error 502 - Bad Gateway zeigen.


    Vorher gabs das Problem nicht, und das Problem besteht auf 3 Servern.
    Ich habe mir bereits andere Threads angeschaut, jedoch helfen Dinge wie das Erhöhen von den PHP_FCGI_CHILDREN in der /etc/imscp/nginx.data und [...]old.data nichts.


    Auch finde ich keine Logs die etwas aussagen. Ein Neustart des imscp_panel behebt das Problem für eine Weile, dann ist wieder alles wie vorher. (eine Weile = wenige Minuten bis Stunden)


    Die bisher nicht geupdateten 1.2.9er laufen super.


    Was für infos benötigt ihr noch?


    Grüße
    nomix

  • Systeminfos bitte.. Hast du automatisch zu Ubuntu 16.04 geupgraded, entsprechend deine Packages...?

  • Ohja stimmt verbimmelt.


    Debian 8 - Kernel 3.16


    Hier die vollständige Paketliste:


    Noch weitere Infos? Die Ngnix logs sind leer.

  • Update entsprechend mal auf den 1.2.x branch.

  • @nomix


    You can update using https://github.com/i-MSCP/imscp/archive/1.2.x.zip
    The process is identical. But please first, read the changelog and the errata file.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Without further info, we cannot help you. Give us access to your server. Then we can investigate.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @nomix


    I investigated your server. Here come the reasons:


    First, I've checked the status of the imscp_panel service which is responsible to spawn the PHP processes for the i-MSCP frontEnd:


    Code
    1. ● imscp_panel.service - i-MSCP frontEnd PHP processesLoaded: loaded (/etc/systemd/system/imscp_panel.service; enabled)Active: inactive (dead) since jeu. 2016-05-19 03:16:09 CEST; 4h 8min agoProcess: 21981 ExecStart=/var/www/fcgi/master/php-fcgi-starter (code=exited, status=0/SUCCESS)Process: 21978 ExecStartPre=/bin/rm -f /var/run/imscp_panel.sock (code=exited, status=0/SUCCESS)Main PID: 21983 (code=exited, status=0/SUCCESS)mai 19 01:39:27 herodes php-fcgi-starter[21981]: spawn-fcgi: child spawned successfully: PID: 21983


    As you can see here, the service is dead since jeu. 2016-05-19 03:16:09 CEST; 4h 8min ago. Thus, with this information in the hands, I've looked at your previous syslog /var/log/syslog.1 file (which has been rotated this morning) and, I've found the following logs:

    Code
    1. ...May 19 03:16:01 herodes CRON[28431]: (root) CMD (/root/secusys/system >/dev/null 2>&1)May 19 03:16:03 herodes apache2[28441]: Stopping web server: apache2.May 19 03:16:04 herodes apache2[28466]: Starting web server: apache2.May 19 03:16:05 herodes proftpd[20989]: 8x.1xx.247.xx - ProFTPD killed (signal 15)May 19 03:16:05 herodes proftpd[20989]: 8x.1xx.247.xx - ProFTPD 1.3.5 standalone mode SHUTDOWNMay 19 03:16:05 herodes proftpd[28557]: Stopping ftp server: proftpd.May 19 03:16:05 herodes proftpd[28574]: 8x.1xx.247.xx - ProFTPD 1.3.5 (stable) (built Tue May 19 2015 11:09:58 UTC) standalone mode STARTUPMay 19 03:16:05 herodes proftpd[28567]: Starting ftp server: proftpd.May 19 03:16:07 herodes mysql[28585]: Stopping MySQL database server: mysqld.May 19 03:16:09 herodes mysql[28680]: Starting MySQL database server: mysqld ..May 19 03:16:09 herodes mysql[28680]: Checking for tables which need an upgrade, are corrupt or wereMay 19 03:16:09 herodes mysql[28680]: not closed cleanly..May 19 03:16:09 herodes /etc/mysql/debian-start[29162]: Upgrading MySQL tables if necessary.May 19 03:16:09 herodes /etc/mysql/debian-start[29166]: /usr/bin/mysql_upgrade: the '--basedir' option is always ignoredMay 19 03:16:09 herodes /etc/mysql/debian-start[29166]: Looking for 'mysql' as: /usr/bin/mysqlMay 19 03:16:09 herodes /etc/mysql/debian-start[29166]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheckMay 19 03:16:09 herodes /etc/mysql/debian-start[29166]: This installation of MySQL is already upgraded to 5.5.49, use --force if you still need to run mysql_upgradeMay 19 03:16:09 herodes /etc/mysql/debian-start[29180]: Checking for insecure root accounts.May 19 03:16:09 herodes /etc/mysql/debian-start[29185]: Triggering myisam-recover for all MyISAM tables...


    So here, we can see that you run the /root/secusys/system script through a cron job. This is confirmed by;


    Code
    1. root@herodes:/var/log# crontab -l# Edit this file to introduce tasks to be run by cron.## Each task to run has to be defined through a single line# indicating with different fields when the task will be run# and what command to run for the task## To define the time you can provide concrete values for# minute (m), hour (h), day of month (dom), month (mon),# and day of week (dow) or use '*' in these fields (for 'any').## Notice that tasks will be started based on the cron's system# daemon's notion of time and timezones.## Output of the crontab jobs (including errors) is sent through# email to the user the crontab file belongs to (unless redirected).## For example, you can run a backup of all your user accounts# at 5 a.m every week with:# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/## For more information see the manual pages of crontab(5) and cron(8)## m h dom mon dow command@reboot /etc/init.d/xinetd restart &> /dev/null16 3 * * * /root/secusys/system >/dev/null 2>&10 */1 * * * /root/secusys/backup.sh >/dev/null 2>&1


    The problem is in the /root/secusys/system script itself which has the following content:



    As you can see here, you're killing all php5-cgi processes. That is really bad. Doing this also kills the PHP processes that are spawned by the imscp_panel service. This explain why you get those 502 errors.



    I would really recommend you to review that script which is anyway really bad. You must never kill PHP processes in that way. That script should finish into the toilets ;)


    In order, I would recommend to simply remove that script which is totally useless:

    • It is not needed to restart service (apache2, proftpd, mysql).
    • It is not needed to perform mysql optimization as you do
    • It is not needed to kill PHP processes as you do (even worse, this can lead to serious side-effects)

    I would also recommend you to switch to PHP FPM (you currently use fcgid).

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206