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

Confusing error when listening with domain socket on already-existing path #23917

Closed
XMB5 opened this issue Oct 27, 2018 · 1 comment
Closed

Comments

@XMB5
Copy link
Contributor

XMB5 commented Oct 27, 2018

When listening with a domain socket on a path that already exists, node should throw the error listen EADDRINUSE: address already in use. However, when writableAll or readableAll is set to true, the error message is confusing and misleading: TypeError: Cannot read property 'fchmod' of null.

Recreate the desired effect by running node -e "require('net').createServer().listen({path:'/'})", and recreate the confusing error message with node -e "require('net').createServer().listen({path:'/',writableAll:true})".

@oyyd
Copy link
Contributor

oyyd commented Oct 27, 2018

Because it failed to create Pipe on / and the "error" event would have been emitted in the next tick. I would like to submit a PR to fix this.

oyyd added a commit to oyyd/node that referenced this issue Oct 27, 2018
When `net.Server` fails to create a new handle, an error shall be
emitted in the next tick. Therefore, we make `net.Server.listen()`
directly  return to avoid following operations on `null`
`this._handle`.

Fixes: nodejs#23917
@Trott Trott closed this as completed in 3458e65 Nov 6, 2018
targos pushed a commit that referenced this issue Nov 6, 2018
When `net.Server` fails to create a new handle, an error shall be
emitted in the next tick. Therefore, we make `net.Server.listen()`
directly  return to avoid following operations on `null`
`this._handle`.

Fixes: #23917

PR-URL: #23920
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
codebytere pushed a commit that referenced this issue Nov 29, 2018
When `net.Server` fails to create a new handle, an error shall be
emitted in the next tick. Therefore, we make `net.Server.listen()`
directly  return to avoid following operations on `null`
`this._handle`.

Fixes: #23917

PR-URL: #23920
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins pushed a commit that referenced this issue Nov 29, 2018
When `net.Server` fails to create a new handle, an error shall be
emitted in the next tick. Therefore, we make `net.Server.listen()`
directly  return to avoid following operations on `null`
`this._handle`.

Fixes: #23917

PR-URL: #23920
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
MylesBorins pushed a commit that referenced this issue Dec 3, 2018
When `net.Server` fails to create a new handle, an error shall be
emitted in the next tick. Therefore, we make `net.Server.listen()`
directly  return to avoid following operations on `null`
`this._handle`.

Fixes: #23917

PR-URL: #23920
Reviewed-By: Richard Lau <riclau@uk.ibm.com>
Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants