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

Error: addMembership EINVAL when running webpack-dev-server #2245

Closed
gerrytan opened this issue Jun 22, 2017 · 9 comments
Closed

Error: addMembership EINVAL when running webpack-dev-server #2245

gerrytan opened this issue Jun 22, 2017 · 9 comments

Comments

@gerrytan
Copy link
Member

Running webpack-dev-server gives following error:

➜ <REDACTED> ./node_modules/.bin/webpack-dev-server
events.js:160
      throw er; // Unhandled 'error' event
      ^

Error: addMembership EINVAL
    at exports._errnoException (util.js:1018:11)
    at Socket.addMembership (dgram.js:506:11)
    at Socket.<anonymous> (/mnt/c/Users/<REDACTED>/projects/<REDACTED>/node_modules/multicast-dns/index.js:53:16)
    at emitNone (events.js:91:20)
    at Socket.emit (events.js:185:7)
    at startListening (dgram.js:121:10)
    at _handle.lookup (dgram.js:226:7)
    at _combinedTickCallback (internal/process/next_tick.js:83:11)
    at process._tickCallback (internal/process/next_tick.js:104:9)
    at Module.runMain (module.js:606:11)

I've created a sample project to reproduce: https://github.com/gerrytan/webpack-dev-server-error-on-windows-bash, see instruction in the readme

  • Windows build number: 10.0.15063
  • Node version: v6.11.0
  • webpack-dev-server version: 2.5.0
  • webpack version: 3.0.0
@stehufntdev
Copy link
Collaborator

Thanks for reporting the issue! Can you please collect a strace of the failing scenario so we can see where the EINVAL is coming from?

@educcjr
Copy link

educcjr commented Jun 22, 2017

I also ran into this problem

setsockopt(13, SOL_IP, IP_ADD_MEMBERSHIP, {imr_multiaddr=inet_addr("224.0.0.251"), imr_interface=inet_addr("0.0.0.0")}, 8) = -1 EINVAL (Invalid argument)

The strace output is very long, is there some specific information I should leave here?

@educcjr
Copy link

educcjr commented Jun 23, 2017

I did a little research about ID_ADD_MEMBERSHIP and found this:
imr_multiaddr contains the address of the multicast group the application wants to join or leave. It must be a valid multicast address (or setsockopt(2) fails with the error EINVAL)

So I ran netsh interface ip show joins on Windows and found that the IP setscockopt was trying to connect really exists. Ran netstat -anup on Ubuntu too and it didn't show anything.

It only happens when I try to run webpack-dev-server outside Ubuntu environment. A few days ago it was working perfectly.

@sunjoong
Copy link

Does it have any chance of being related to #1678 (comment) and https://msdn.microsoft.com/en-us/commandline/wsl/release_notes#build-16176 ?

@sunilmut
Copy link
Member

@gerrytan - Thanks for reporting the issue and thanks @educcjr for the trace analysis. IP_ADD_MEMBERSHIP was added in Windows Insider build 16170. Just FYI that these changes are not (and won't be) available in the Creators Update build, but will be available in the Fall Creators Update release.

@sunilmut
Copy link
Member

A few days ago it was working perfectly.

Maybe, the dependency on the 'IP_ADD_MEMBERSHIP' socket option was added recently to webpack-dev-server?

@educcjr
Copy link

educcjr commented Jun 23, 2017

@sunilmut it was a webpack-dev-server dependecy. Found here: webpack/webpack-dev-server#955 (comment). Thank you for the explanation.

@gerrytan
Copy link
Member Author

@sunilmut so there's no way I can install build 16170 right now? Nevertheless I've confirmed downgrading to webpack-dev-server 2.4.5 solves the problem. Thanks for pointing out the problem code @educcjr.

@sunilmut
Copy link
Member

@gerrytan

so there's no way I can install build 16170 right now?

Only, if you move to the Insider build program. You can also download standalone ISO's and install them if you feel like. There is no other way that I am aware of.

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

6 participants