Apache error: Bad file descriptor: apr_socket_accept

Discussion in 'Server Operation' started by Hans, Sep 4, 2008.

  1. Hans

    Hans Moderator

    Within my Apache2 error.log file, i see several error messages like:

    [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
    [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
    [warn] long lost child came home! (pid 12345)
    [notice] Graceful restart requested, doing restart
    [error] (9)Bad file descriptor: apr_socket_accept: (client socket)
    (9)Bad file descriptor: apr_socket_accept: (client socket)

    The Bad file descriptor error message seems to appear everytime Apache restarts.
    Does anyone what this error message means?

    I had this problem in the past too and understand that it seams to be a bug in Apache2, but now i am not sure...

    Debian Etch/Apache 2.2.3.

    Can anyone tell me more about such an error end if possible how to ovoid it.

    Thanks in advance!
     
    Last edited: Sep 4, 2008
  2. falko

    falko Super Moderator

    Have you tried to upgrade Debian's Apache package?
     
  3. Hans

    Hans Moderator

    (I know it is not the latest Apache2 version available) but the latest Apache2 version wich comes with Etch is 2.2.3.

    And as you can see, all the packages are installed already:

    # apt-get install apache2 apache2-doc apache2-mpm-prefork apache2-utils libexpat1 ssl-cert
    Reading package lists... Done
    Building dependency tree... Done
    apache2 is already the newest version.
    apache2-doc is already the newest version.
    apache2-mpm-prefork is already the newest version.
    apache2-utils is already the newest version.
    libexpat1 is already the newest version.
    ssl-cert is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.

    My system is up to date as i do an apt-get update/upgrade every single day.

    httpd -V also gives me:Apache 2.2.3
     
    Last edited: Sep 6, 2008
  4. falko

    falko Super Moderator

  5. Hans

    Hans Moderator

    Thanks Falko,
    That are the articles i found too. For this reason i think indeed it's a bug in Apache 2.2.3.

    When i do a normal start/stop or restart i don't have any error in /var/log/apache2/error.log.
     
  6. falko

    falko Super Moderator

  7. Hans

    Hans Moderator

    I guess i have to wait until Debian Lenny comes out. I've read Lenny will come with Apache2 version 2.2.9.
     
  8. ejmarten

    ejmarten New Member

    Try different MPM module

    Have you tried installing apache with a different MPM module? If your website/webapp uses a connector to a multithreaded backend (ajp13?), you might want to try using the worker MPM.

    #apt-get install apache2 apache2-doc apache2-mpm-worker apache2-utils libexpat1 ssl-cert

    The error message itself might be a bug:
    https://issues.apache.org/bugzilla/show_bug.cgi?id=42829

    The work around is to do a hard restart instead of a graceful restart when using mod_prefork.

    If you have apache managing multiple ajp13 backend connections, I would try running mod_worker, not as a workaround to this bug, but for better performance and reliability.
     
  9. Buddhiran

    Buddhiran New Member

    Bad file descriptor: apr_socket_accept

    Please check your virtual host has correct parameters. If you have wrong parameters there you will get the same exception.:cool:
     

Share This Page