-
Notifications
You must be signed in to change notification settings - Fork 236
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
"Remote end closed socket abruptly" redirects on Node 8.12.0 #261
Comments
Actually.. here's a trimmed down version (no var needle = require('needle');
needle('get', 'https://docs.openstack.org/developer/horizon/', {}, {
'follow_max': 5,
})
.then(() => {
console.log(`Redirect worked on NodeJS version ${process.version}`);
})
.catch(e => {
console.log(`Redirect failed on NodeJS version ${process.version}`);
console.error(e);
}); And the results: Redirect worked on NodeJS version v4.9.1
Redirect worked on NodeJS version v6.14.3
Redirect worked on NodeJS version v8.11.4
Redirect failed on NodeJS version v8.12.0
Error: Remote end closed socket abruptly.
Redirect worked on NodeJS version v9.11.2
Redirect worked on NodeJS version v10.10.0 |
Hitting the same exact issue. This was causing me major headaches because needle is used in node-pre-gyp and in my case the pre-built binaries were hosted on Github which involves a redirect. This error can cause node-pre-gyp to fail for the redirect and if the download after the redirect also fails two source builds will be kicked off which will stomp on eachother. This essentially prevents the newest versions of libxmljs from being installed with node v8.12.0. |
The following issue makes the newest libxmljs uninstallable on Node 8.12.0, due to its use in node-pre-gyp: tomas/needle#261
Yikes, will check asap! |
Ok I think I found a fix ( Now, if I run the test script I get the correct output:
Without breaking previous versions:
If everyone's OK with the patch I can push a new version to npm. |
Thanks @tomas ! I took a quick look at the branch.. such a small fix 😸 I don't have enough context to validate the impact of the patch, but it looks good (and safe) to me. |
Ok, just pushed 2.2.4 to npm. Thanks everyone for reporting! |
this includes a fix @darscan reported in tomas/needle#261 updating `.travis.yaml` to use up-to-date node 8 in tests again
👋 Aaaand.. it's back:
|
Just got bit by this too, my current solution is to lock my builds to the matching official image: |
Something is fishy with Needle and redirects on Node
8.12.0
!Remote end closed socket abruptly
The issue does not seem to appear with Node
4.x
,6.x
,9.x
or10.x
.I've put together the smallest example I could that demonstrates the problem (please excuse the gross style.. I wanted to check Node 4 behaviour):
I mostly tested with Express
4.16.3
and Needle2.2.3
, but tried a few combinations with the same results as below:So, what is going on with Node
8.12.0
?8.11.4
works just fine.Perhaps something to do with no longer calling
maybeDestroy(this)
?: https://github.com/nodejs/node/pull/18708/filesBut I'd expect that to cause us problems with Node
10.x
too.Please let me know if I can provide any further details, and thanks for the great library 😺
P.S. The example code has both Express and Needle running on the same version of Node for simplicity. I have tested with running the Express server on Node
8.11.4
and hitting it from Needle running on8.12.0
to rule out an issue with the server side of things.The text was updated successfully, but these errors were encountered: