• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • 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.

502 Bad Gateway everyday

SalvadorS

Regular Pleskian
Two days ago I configured a new server under Debian 8.2 with Plesk 12.5.30 #18.

Then I migrated from another plesk a single domain and all worked fine, the domain worked perfectly.

Next day when I tried to access to this domain I saw the error "502 Bad Gateway"

So I followed this KA article http://kb.odin.com/en/123735 and website worked again.

Next day same problem... When the logs ends to rotate the website shows "502 Bad Gateway"

Any ideas to fix this everyday problem?

Thanks a lot
 
Logs investigation is required. Most probably that you need to apply some specific settings to webserver configuration. There are many other KB articles regarding "502 Bad Gateway" with different reasons of this problem. Have you checked them?
 
Dear IgorG,

Thanks for your reply. Always helpful!

I checked apache2 errors and found this:

[Tue Jan 19 10:32:26.008033 2016] [core:warn] [pid 21832:tid 139956050270080] AH00098: pid file /var/run/apache2/apache2.pid overwritten -- Unclean shutdown of previous Apache run?

So combined with the rotation logs I edited this file:

/etc/logrotate.d/apache2

Changing the line:

/etc/init.d/apache2 reload > /dev/null; \

To

/etc/init.d/apache2 restart > /dev/null; \

And tomorrow I will tell you if it it works...

Regards
 
I'm having the exact same problem. Error 502 on all vhosts when I wake up in the morning on a clean install, no custom configuration. This is a bug IgorG. Past 2 days in a row exactly when logrotate starts.

error.log:[Sat Jan 23 07:41:15.001318 2016] [core:warn] [pid 4687:tid 140375237846912] AH00098: pid file /var/run/apache2/apache2.pid overwritten -- Unclean shutdown of previous Apache run?

error.log.1:[Fri Jan 22 19:03:15.025751 2016] [core:warn] [pid 4204:tid 140260338968448] AH00098: pid file /var/run/apache2/apache2.pid overwritten -- Unclean shutdown of previous Apache run?

I edited my logrotate for apache and I'll see if I'm still running tomorrow.
 
Changing the line: (on my debian 8 machine)

/etc/init.d/apache2 reload > /dev/null; \

To

/etc/init.d/apache2 restart > /dev/null; \

Fixed one of my servers. The other one did the same thing again, but this one was running on Ubuntu 14.04LTS. I will change it on the Ubuntu server now and see if it happens again. This also was a clean install to test this.
 
Just to update the post, new box, under Debian 8.2 and same problem. I have to changed it manually again. So it seems Debian does not like reload too much and wants restart ... :)
 
I had this same problem on CloudLinux 7.1. Changing reload to restart fixed the problem for me.
 
Two more servers mounted since I opened this ticket, both with the same problem. I think Odin have to change this file.
 
Same problem on a fresh Debian8 install. Seems changing reload > restart fixed the problem, now 48h+ up and running
 
Thanks UFHH01, reverted changes to "reload" and increased the apache2 restart interval time to 60. Now testing..
 
After 6+ days no more errors, with restart and restart interval time set to 60.
Thanks UFHH01
 
Back
Top