Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APR_TCP_DEFER_ACCEPT error when starting Apache2 #1953

Open
bitcrazed opened this issue Apr 19, 2017 · 19 comments

Comments

Projects
None yet
@bitcrazed
Copy link
Collaborator

commented Apr 19, 2017

Logging this issue here as information for others. Issue is benign and can be ignored.

  • Your Windows build number: (Type ver at a Windows Command Prompt)
    15063

  • What you're doing and what's happening: (Copy&paste specific commands and their output, or include screen shots)
    Starting Apache2 with:

$ sudo service apache2 restart
  • What's wrong / what should be happening instead:
    Following error message is displayed:
* Restarting Apache httpd web server apache2
[Tue Apr 18 18:50:52.618691 2017] [core:warn] [pid 546:tid 140453865195392] (92)Protocol not available: 
AH00076: Failed to enable APR_TCP_DEFER_ACCEPT
@bitcrazed

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 19, 2017

The TCP_DEFER_ACCEPT socket option is not natively supported by Windows.

WSL team are working with Windows networking team on this issue, but fix likely won't make it in RS3.

Doesn't block Apache2 from starting, just a warning. Pile-on below if otherwise.

@sunilmut sunilmut added the feature label Apr 19, 2017

@sunilmut

This comment has been minimized.

Copy link
Member

commented Apr 19, 2017

Thanks @bitcrazed for reporting the issue. Your analysis above seems spot on.

@namiltd

This comment has been minimized.

Copy link

commented Apr 19, 2017

Add the following line to the end of the /etc/apache2/apache2.conf file:

AcceptFilter http none

@Jduret

This comment has been minimized.

Copy link

commented Sep 6, 2017

If you have this warning after enabling SSL (https), just add the following line to the end of the file :

/etc/apache2/apache2.conf

AcceptFilter https none

Keep in mind that this would just hide errors.

@JunaidQadirB

This comment has been minimized.

Copy link

commented Jan 28, 2018

I have added both http and https

AcceptFilter https none
AcceptFilter http none

@benhillis benhillis removed the apache label May 24, 2018

@solracfirst

This comment has been minimized.

Copy link

commented May 28, 2018

Hello,

I have added

AcceptFilter https none
AcceptFilter http none

This worked on start, however, when I give restart it continues with the same error.

@jp-harvey

This comment has been minimized.

Copy link

commented Aug 23, 2018

@bitcrazed is there an issue somewhere open for the fix that can be tracked / voted on or is this it? Applications based on Apache Thrift currently do not work on WSL due to TCP_DEFER_ACCEPT not being available, eg. MapD

Thrift: Thu Aug 23 10:41:00 2018 TServerSocket::listen() setsockopt() TCP_DEFER_ACCEPT Protocol not available

#1953 (comment)

The TCP_DEFER_ACCEPT socket option is not natively supported by Windows.

WSL team are working with Windows networking team on this issue, but fix likely won't make it in RS3.

@bitcrazed

This comment has been minimized.

Copy link
Collaborator Author

commented Aug 23, 2018

This is one of the main issues tracking this problem, so please subscribe to this issue if you're interested in future progress. @tara-raj will triage with the team and get back to you.

@jp-harvey

This comment has been minimized.

Copy link

commented Dec 4, 2018

Hi @tara-raj, has there been any progress on this issue internally?

@therealkenc

This comment has been minimized.

Copy link
Collaborator

commented Dec 4, 2018

This is another one that should have been stubbed to do nothing back in 2016 (like every GNU/FOSS configure script on the planet does). Question rhetorical natch. Pretty sure it can be configured away with AcceptFilter http none but I haven't tried.

@jp-harvey

This comment has been minimized.

Copy link

commented Dec 4, 2018

@therealkenc there does indeed appear to be a way to configure Apache to work around it, however, it's not Apache specific.

@therealkenc

This comment has been minimized.

Copy link
Collaborator

commented Dec 4, 2018

it's not Apache specific

That's rhetorical also.

Identifying other use-cases here is always good. Or at least, it never hurts.

@jp-harvey

This comment has been minimized.

Copy link

commented Dec 5, 2018

That's rhetorical also.

Yes, although the fact that MapD (OmniSci) does not work due to Apache Thrift not working because of this is not rhetorical

@therealkenc

This comment has been minimized.

Copy link
Collaborator

commented Dec 5, 2018

due to Apache Thrift not working

Add #undef TCP_DEFER_ACCEPT here should make it go.

@lion-wang

This comment has been minimized.

Copy link

commented Jan 6, 2019

Is there plan to fix this?

@jp-harvey

This comment has been minimized.

Copy link

commented Jan 7, 2019

@lion-wang based on the lack of response from MS it appears unlikely, but who knows.

While it has been pointed out that it's possible in some cases to change a configuration flag and in other cases to recompile to work around this issue, both of those options (especially the second) come with their own potential issues so supporting this on the MS side would still be preferable (aside from the efficiency of fixing in one place (WSL) instead of every dependent project having to do so).

@therealkenc

This comment has been minimized.

Copy link
Collaborator

commented Jan 7, 2019

instead of every dependent project having to do so

Since these seem to be de rigueur this week

/*  sockopt-stub.c

    sudo apt-install build-essential
    cd ~ && mkdir -p ~/build && cd build
    gcc -fPIC -c -o sockopt-stub.o sockopt-stub.c
    gcc -shared -o sockopt-stub.so sockopt-stub.o -ldl
    export LD_PRELOAD="$PWD/sockopt-stub.so"
    # ... run stuff    
 */
#define _GNU_SOURCE
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <dlfcn.h>

typedef int (*setsockopt_)(int sockfd, int level, int optname,
                      const void *optval, socklen_t optlen);
int setsockopt(int sockfd, int level, int optname,
                      const void *optval, socklen_t optlen)
{
    static setsockopt_ fn = (setsockopt_)(dlsym(RTLD_NEXT, "setsockopt"));
    if (level == IPPROTO_TCP && optname == TCP_DEFER_ACCEPT) {
        return 0;
    }
    return fn(sockfd, level, optname, optval, optlen);
}

Totally untested; I haven't run it even once. But that should get you there without having to recompile.

@jp-harvey

This comment has been minimized.

Copy link

commented Jan 7, 2019

Thanks @therealkenc this is great, we are going to try this as a workaround.

(the point remains though - instead of every dependent project having to do so ~ instead of every user having to modify their system)

@odeciojunior

This comment has been minimized.

Copy link

commented Apr 25, 2019

Same problem here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.