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

Created:

2016-11-16 13:14:18 UTC

Modified:

2017-08-20 00:18:16 UTC

6

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

Applicable to:

  • Plesk 12.5 for Linux

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

18 Comments

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

  • 0
    Avatar
    Felix Ostmann

    I have upgrades from 12.5 to Onyx 17.5.3 with libapache2-mod-fcgid-psa version 2.3.9.5-debian8.0.17031614 and now this problem bites me.

    The reload itself don't throw errors, but after a reload only one new process owned by www-data are alive.

    netstat show that the process is not listen on a port.

    strace show that the process is listen on fd 3 (a socket).

    A "service apache2 restart" did not touch the one failed process from the reload. I had to manually kill that one.

     

    The workaround is good but not a solution.

  • 0
    Avatar
    Konstantin Annikov

    Hi,

    I also have Debian 8 with 2.3.9.5 version of libapache2-mod-fcgid-psa. 

    I have tried to reproduce this using the following script: 

    # while true; do service apache2 reload; clear; netstat -tpln | egrep "7081|7080"; ps auxf | grep -v grep |  grep apache2; done

    But apache reloads very smoothly and all processes are owned by www-data (see the screencast for details)

    So, if you still have this issue, please submit a request for our technical support https://www.plesk.com/contact-support/ 
    If it is possible, please describe the issue in details and provide us with steps on how to reproduce it. 

  • 0
    Avatar
    iamkingsleyf

    i still have this crash issue, apache is running but all sites are 504 or 502.

     

    this is really fustrating

  • 0
    Avatar
    Bulat Tsydenov

    @iamkingsleyf, In this case, I would recommend you contact our technical support https://www.plesk.com/contact-support/, that would speed up the resolution. I guess that you left a comment in Apache keeps going down: server reached MaxRequestWorkers setting article regarding the same issue.

  • 0
    Avatar
    iamkingsleyf

    Yes and the same issue is occuring everytime causing problem for my business.

  • 0
    Avatar
    Artyom Baranov

    @iamkingsleyf,

    The issue requires deeper investigation. As Bulat has suggested, please contact Plesk technical support https://www.plesk.com/contact-support/

  • 0
    Avatar
    iamkingsleyf

    I got my license from OVH i am unable to contact support 

  • 0
    Avatar
    Artyom Baranov

    @iamkingsleyf,

    In this case, you may contact OVH regarding the issue or get support from Plesk directly. Please check this article: https://goo.gl/pbHyTW

Please sign in to leave a comment.