Apache crashes on reload and websites show 502 Bad Gateway: seg fault or similar nasty error detected in the parent process

Refers to:

  • Plesk 12.5 for Linux

Created:

2016-11-16 13:14:18 UTC

Modified:

2017-02-21 04:53:34 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Apache crashes on reload and websites show 502 Bad Gateway: seg fault or similar nasty error detected in the parent process

Symptoms

  • After Plesk automatic updates Apache service remains stopped.
    User has to start service manually everytime.

  • Apache crashes with the following error in /var/log/apache2/error.log or /var/log/httpd/error_log :

    [timestamp] [mpm_event:notice] [pid 20056:tid 140176783820672] AH00493: SIGUSR1 received.  Doing graceful restart
    [timestamp] [core:notice] [pid 20056] AH00060: seg fault or similar nasty error detected in the parent process
  • Websites are periodically down, they are showing the following nginx error:

    502 Bad Gateway
  • The following errors can be found in /var/www/vhosts/system/example.com/logs/proxy_error_log :

    [error] 10485#0: *1947668 connect() failed (111: Connection refused) while connecting to upstream, client: 10.0.2.2, server: , request: "GET / HTTP/1.1", upstream: "http://10.0.2.2:7080/", host: "example.com"
  • Unable to perform a graceful Apache restart. The following message can be shown in CLI or in Plesk: Can not restart web server

Cause

Bug #PPPM-4566. Issue was fixed in Plesk 17.0 MU13.

Patch

For CentOS 6, CentOS 7, Debian 8, Ubuntu 14 and Ubuntu 16:

1. Change Apache worker mode from mpm_event to mpm_prefork in Home > Tools & Settings > Apache Web Server Settings 

2. Download patched file for server OS from attachment, unzip and install it:

3. Restart Apache

4. In some cases, server reboot may be required.

Workaround

If the issue still persists, perform the following actions to disable graceful reload:

  • Increase the value ' Apache restart interval ' to at least to 60 seconds at Plesk > Tools & Settings > Apache Web Server Settings

  • For Debian based systems :

    Replace ' apache2 reload ' with ' apache2 restart ' in /etc/logrotate.d/apache2 file.

  • For RHEL based systems

    Replace ' httpd reload ' with ' httpd restart ' in /etc/logrotate.d/httpd file.

If the above steps do not help on Debian/Ubuntu OSes, edit log rotation settings of apache in /etc/logrotate.d/apache2 file. Change " /etc/init.d/apache2 reload " to " /etc/init.d/apache2 restart ":

# cat /etc/logrotate.d/apache2
....
/etc/init.d/apache2 restart > /dev/null;

Attachments:

Have more questions? Submit a request

10 Comments

  • 0
    Avatar
    Ste Martin

    This was marked as fixed, and the resolution was to update to latests version to fix. Now its only the workarounds again?

    Is this fixed or not in latest?

  • 0
    Avatar
    Anton Maslov

    @Ste Martin, 

     

    It was fixed in Plesk Onyx, but later we found additional issue caused by this bug. Right now we do have an open ticket regarding this and working on a solution. The article will be updated with results, you may subscribe to it to get updated.

  • 0
    Avatar
    Anton Maslov

    @Ste Martin, 

    We've prepared a patch for Debian 8 + Plesk Onyx + mpm_prefork module. For Plesk 12.5 and other OSes we plan to fix an issue in one of the upcoming MUs

  • 0
    Avatar
    Thomas Duran-Debaenst

    Bonjour Anton,

    On Ubuntu 14.04.5 LTS and after apply all the above Workaround, I still have the problem every morning. Do you have a solution? Do you know when the problem will be solved ?

    Thanks & best wishes for 2017

    Edited by Thomas Duran-Debaenst
  • 0
    Avatar
    Manolis Vassiliadis

    Hello,

     

    Do you have any news about specific date for Plesk 12.5 CentOS 7.2 MU which resolve this issue?

    Edited by Manolis Vassiliadis
  • 0
    Avatar
    Nikolay Zhmuk

    Hi,

     

    > Do you have any news about specific date for Plesk 12.5 CentOS 7.2 MU which resolve this issue?

    Dear Manilis, there is no exact ETA when it will be fixed for Plesk 12.5.

     

    > On Ubuntu 14.04.5 LTS and after apply all the above Workaround, I still have the problem every morning. Do you have a solution? Do you know when the problem will be solved ?

    Dear Thomas, if the solution steps from the article did not help, please create a ticket on  https://support.plesk.com/hc/ so we could investigate it further.

  • 0
    Avatar
    Aniello Martuscelli

    Same problem on latest ONYX on ubuntu 16.04 

    I should restart manually apache crashed this sunday

  • 0
    Avatar
    Vitaly Zhidkov

    @Aniello, I've attached fix for Ubuntu 16

  • 0
    Avatar
    Ste Martin

    Does the fix for Ubuntu mean we can then go back to using mpm_event after applying the patch?

  • 0
    Avatar
    Robert Asilbekov

    @Ste Martin, mpm_prefork works more stable, than mpm_event.

Please sign in to leave a comment.