WSL: Node Pipe cannot connect
With the newest build (14965), I was hopeful that my issues with using node on WSL would have been cleared up. In this case, the error is being throw deep in the ember-cli build process, but it happens elsewhere as well.
I believe the issue to be twofold: one issue in the error lookup from libuv, the other with the pipe connector itself.
The error that is thrown:
util.js:1018
var errname = uv.errname(err);
^
Error: err >= 0
at Object.exports._errnoException (util.js:1018:20)
at exports._exceptionWithHostPort (util.js:1045:20)
at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1090:14)
My case is a full ember-cli-rails project that takes a bit of setup, but this seems to be throwing the same error: https://github.com/nodejs/node/issues/9534
const {spawn} = require('child_process');
const sockets = spawn('go', ['run', 'sockets.go']);
I suspect that the crash is coming from an issue with libuv error lookup as the message err >= 0 is not very helpful. I am not certain what the original exception is because it doesn’t get that far. The pipe code, so far as I can tell is here:
https://github.com/nodejs/node/blob/master/src/pipe_wrap.cc
About this issue
- Original URL
- State: closed
- Created 10 years ago
- Comments: 24 (8 by maintainers)
Just to be clear, both
SCM_RIGHTSandSCM_CREDENTIALSare currently supported, but not at the same time. Also the current implementation ofSCM_RIGHTSdoes not support passing more than one FD at a time. Very limited. I am working to remove all these limitations.getsockopt(..., SOL_SOCKET, SO_ERROR, ...)still returns EINVAL as of 14965. Test case below is clean on Real Linux™.strace:
Good call @fpqc found the call that threw the error (with gettime and futex calls removed):
Could be related to https://github.com/Microsoft/BashOnWindows/issues/1343 which already has a fix inbound. That’s good.
@therealkenc this issue is not limited to 7.1. I think a few more people started hitting it with 7.1, but it existed for me in all versions I tried.
Just an update that Unix sockets now support the
SO_ERRORsocket option. The fix is in the dev branch and should soon make it to the release. Regarding #682, it’s not clear from the post, but I think that issue was for theSO_ERRORsocket option for INET sockets.I am working on the
SMC_RIGHTSandSCM_CREDENTIALSas we speak 😃I got the dates wrong. The ping was on the 8th. Had better shock value when I thought Sunil fixed it in an afternoon. Still, I was surprised when it worked for #610 and I didn’t say anything at the time.
Wow! That was ~
6 hours~4 days from ping to fix (edit: still impressive).Does squeaking really work in this forum? Because it’s starting to look like it does. If so, finishing
SCM_RIGHTSandSCM_CREDENTIALS(#1326 #514 #613) not to mention theclone()pattern GNU is newly fond of (#1005) orfutexe()sin general (#1006) would unblock a ton 'o stuff. What’s the optimal whinge frequency?Thanks @therealkenc for detailed info. As you already found out, the support for
SO_ERRORin WSL is not complete. I have opened a bug internally to track this.