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

Closed
bitcrazed opened this issue Apr 19, 2017 · 28 comments
Closed

APR_TCP_DEFER_ACCEPT error when starting Apache2 #1953

bitcrazed opened this issue Apr 19, 2017 · 28 comments
Assignees

Comments

@bitcrazed
Copy link
Contributor

bitcrazed 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
Copy link
Contributor Author

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
Copy link
Member

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

@namiltd
Copy link

namiltd commented Apr 19, 2017

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

AcceptFilter http none

@Jduret
Copy link

Jduret 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
Copy link

I have added both http and https

AcceptFilter https none
AcceptFilter http none

@benhillis benhillis removed the apache label May 24, 2018
@solracfirst
Copy link

solracfirst 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
Copy link

jp-harvey 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
Copy link
Contributor Author

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
Copy link

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

@therealkenc
Copy link
Collaborator

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
Copy link

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

@therealkenc
Copy link
Collaborator

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
Copy link

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
Copy link
Collaborator

due to Apache Thrift not working

Add #undef TCP_DEFER_ACCEPT here should make it go.

@lion-wang
Copy link

Is there plan to fix this?

@jp-harvey
Copy link

@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
Copy link
Collaborator

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
Copy link

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
Copy link

Same problem here...

@thevictor13
Copy link

Well it did not seem to have made it to 1903

@jp-harvey
Copy link

@thevictor13 I suppose there's a possibility that "Full System Call Compatibility" will fix this issue (although, what do I know?) in WSL2: https://devblogs.microsoft.com/commandline/announcing-wsl-2/. This may be (part of) the reason this issue has not had any love from MS.

@thevictor13
Copy link

Hmm, makes sense. Thanks for the link! I'll keep an eye on it.

@Superdrac
Copy link

Just updated to WSL2 and no more error.

@BenMorel
Copy link

BenMorel commented Sep 4, 2019

Still have it on WSL 2. Scratch that. I hadn't converted the distro.

For those as dumb as I am:

wsl --set-version Ubuntu 2

@vintprox
Copy link

vintprox commented Sep 24, 2019

Yeah, make as @BenMorel said, if you have Windows 10 Build 18917 or higher. Other requirements.
Otherwise you have an option to ignore warning.

@bluepioupiou
Copy link

set-version

unknown command : --set-version

@rawr51919
Copy link

set-version

unknown command : --set-version

Yeah, make as @BenMorel said, if you have Windows 10 Build 18917 or higher. Other requirements.
Otherwise you have an option to ignore warning.

@diveshc22
Copy link

AcceptFilter https none
AcceptFilter http none

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests