Page 1 of 1

Php-fpm crashes every day at 2:00 PM, 502 bad gateway

Posted: Fri Feb 23, 2018 1:35 am
by 2des
Hello,

i have an annoying problem: the Php-fpm crashes every day at 2:00 PM.
website and vesta panel: 502 bad gateway, after: service vesta restart and service php-fpm restart everything comes back to normal, until 2:00 PM.

Only vesta default cron jobs are added. I have looked all the logs, many times, found nothing suspicious.

Today i have resowed awstat (yum remove awstats), newer used.

Please give me an advice where to start.

Thank you.

Re: Php-fpm crashes every day at 2:00 PM, 502 bad gateway

Posted: Fri Feb 23, 2018 9:49 am
by mehargags
check you logs for the specific time... logs are your best friend...

Paste the log entries here for us to review... from FPM and Nginx

Also check if you have any specific crons running near that time, may be it is leading to the crash. This command will list cron jobs from all users, run it as root:

Code: Select all

for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done

Re: Php-fpm crashes every day at 2:00 PM, 502 bad gateway

Posted: Fri Feb 23, 2018 3:12 pm
by 2des
Thank you for your quick reply.

[root@nginx]# for user in $(cut -f1 -d: /etc/passwd); do crontab -u $user -l; done
no crontab for root
no crontab for bin
no crontab for daemon
no crontab for adm
no crontab for lp
no crontab for sync
no crontab for shutdown
no crontab for halt
no crontab for mail
no crontab for uucp
no crontab for operator
no crontab for games
no crontab for gopher
no crontab for ftp
no crontab for nobody
no crontab for vcsa
no crontab for saslauth
no crontab for mailnull
no crontab for smmsp
no crontab for named
no crontab for apache
no crontab for sshd
no crontab for tcpdump
no crontab for rpc
no crontab for nscd
no crontab for dbus
no crontab for ntp
no crontab for mysql
no crontab for webalizer
no crontab for nginx
no crontab for backup
MAILTO=[email protected]

CONTENT_TYPE="text/plain; charset=utf-8"
15 02 * * * sudo /usr/local/vesta/bin/v-update-sys-queue disk
10 00 * * * sudo /usr/local/vesta/bin/v-update-sys-queue traffic
30 03 * * * sudo /usr/local/vesta/bin/v-update-sys-queue webstats
*/5 * * * * sudo /usr/local/vesta/bin/v-update-sys-queue backup
10 05 * * * sudo /usr/local/vesta/bin/v-backup-users
20 00 * * * sudo /usr/local/vesta/bin/v-update-user-stats
*/5 * * * * sudo /usr/local/vesta/bin/v-update-sys-rrd
41 2 * * * sudo /usr/local/vesta/bin/v-update-letsencrypt-ssl

no crontab for redis

The logs files

/var/log/nginx/error.log empty.
/domain/xxxxx.error.log -

2018/02/23 02:10:18 [error] 10025#10025: *40885 connect() failed (111: Connection refused) while connecting to upstream, client: XXX.XXX
server: XXX.com, request: "GET /

and

/var/log/php-fpm/error.log

[23-Feb-2018 02:13:43] NOTICE: fpm is running, pid 11724
[23-Feb-2018 02:13:43] NOTICE: ready to handle connections

Here i have restartdet the php-fpm and vesta service.

Thank you.
BEst regards.

Re: Php-fpm crashes every day at 2:00 PM, 502 bad gateway

Posted: Sat Feb 24, 2018 8:01 am
by mehargags
how many sites you have on this server?

If you know the exact time, login to your server 5 mins before through SSH and

clean log to start fresh

Code: Select all

> /var/log/php-fpm/error.log
> /domain/xxxxx.error.log 
Then tail both of them in two separate sessions

Code: Select all

tail -f /var/log/php-fpm/error.log
tail -f  /domain/xxxxx.error.log 
Watch and observe when they error out.

Re: Php-fpm crashes every day at 2:00 PM, 502 bad gateway

Posted: Sat Feb 24, 2018 9:12 am
by 2des
Hello,

first of all thank you for helping me, i really appreciate it.

The problem is related to Version 0.9.8-19, i have installed on a fresh one on a new droplet. Te problem exist, 502 bad gateway at 2:00 PM.

[root@XXX bin]# service php-fpm restart
Stopping php-fpm: [FAILED]
Starting php-fpm: [ OK ]
[root@XXX bin]# service vesta restart
Stopping vesta-nginx: [ OK ]
Stopping vesta-php: [FAILED]
Starting vesta-nginx:
Starting vesta-php: [ OK ]

Log files are empty.

Today i fill suspend all vesta crom job, i will come back tomorrow morning :-))

The problem start when upgraded Vesta from Version 0.9.8-17 to Version 0.9.8-18, to day later i have upgraded to Version 0.9.8-19. Backup ware disable from the beginning.

I there a way to come back to Version 0.9.8-17 on a production server?

Thank you again for your time and support.
Best regards.

Re: Php-fpm crashes every day at 2:00 PM, 502 bad gateway

Posted: Sun Feb 25, 2018 3:52 pm
by 2des
Hello,

i have updated the bin folder from
https://github.com/serghey-rodin/vesta

So far so good.

Re: Php-fpm crashes every day at 2:00 PM, 502 bad gateway

Posted: Sun Feb 25, 2018 4:32 pm
by mehargags
looks like a very strange bug... but I'm glad you managed to fix it.

Re: Php-fpm crashes every day at 2:00 PM, 502 bad gateway

Posted: Tue Feb 27, 2018 8:09 am
by 2des
Hello,

the problem stile exist. I have stopped the v-update-sys-rrd Chron job, now the server isen`t crashing.

Iths Ok to disable the v-update-sys-rrd?

Thank you.