RejectedSoftware Forums

Sign up

Why "Failed to listen on 0.0.0.0:8080" ?

I just managed to compile and run vibe.d but I get the following error messages:

Running /tmp/dub/4229398104/vibe-test...
Listening for HTTP requests on :::8080
Failed to listen on 0.0.0.0:8080

It listens on localhost:8080. So I could test it.

What is causing this error message ? Apparently it tries to listen on IPV6, then say it can't listen on an IPV4 address.
What exactly is happening ?

My network card is configured for IPV4 only. I expect that at least 0.0.0.0:8080 would work.

Re: Why "Failed to listen on 0.0.0.0:8080" ?

On Fri, 30 Aug 2013 15:03:15 GMT, chmike wrote:

I just managed to compile and run vibe.d but I get the following error messages:

Running /tmp/dub/4229398104/vibe-test...
Listening for HTTP requests on :::8080
Failed to listen on 0.0.0.0:8080

It listens on localhost:8080. So I could test it.

What is causing this error message ? Apparently it tries to listen on IPV6, then say it can't listen on an IPV4 address.
What exactly is happening ?

My network card is configured for IPV4 only. I expect that at least 0.0.0.0:8080 would work.

That's more or less https://github.com/rejectedsoftware/vibe.d/issues/249. Basically it's the bindAddresses setting in the supplied HTTPServerSettings that needs to be properly adjusted for the system. In this case listening on IPv6 :: will automatically listen on 0.0.0.0, which is why the second attempt fails - everything will work fine nonetheless.

It's a bit difficult to choose the right default here since every choice has its drawbacks:

  1. ["::", "0.0.0.0"] (current): may print the bogus error message
  2. ["0.0.0.0"]: depending on the system, doesn't support IPv6, which doesn't seem like a good way forward
  3. ["::"]: may fail on systems where IPv6 is not enabled
  4. ["::1", "127.0.0.1"]: will not listen on public network devices and thus may be confusing when trying to communicate between different computers

I think the current choice has the least negative impact, although questions about the error message do come up quite frequently.