-
Notifications
You must be signed in to change notification settings - Fork 30.7k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Node fails to download entire (large) file via http/https when agent: false
is used. Fails on 0.10, 0.12, 4.1.1.
#3055
Comments
…avoid 'agent:false')
I'm not seeing what you're describing. I've ran the non-pipe and pipe versions of your script against the master branch with the same url for ~20 mins (with many, many requests during that time period) and did not see any errors. |
@mscdex Thanks. You are right. It appears that we (at my office) can only repro this when running over our office network. Yuck. FWIW, I cannot repro when doing (at least as close as I can get) similar with
That makes me think it is a node issue, but something to do with a funky interaction with my office network. I'll follow up if I can find something to go on. |
Possible duplicate of nodejs/node-v0.x-archive#8488. |
is this still an issue? |
Closing as there does not appear to be anything further to do. Can reopen if necessary |
When attempting to download a (largish) file via
https.request
and usingagent: false
, the end of the file will frequently be missing.https://gist.github.com/trentm/80409ded30b4e0418e9c has a demo script and sample runs showing it failing on node 0.10.40 and node 4.1.1. In my experience I get a failure between 10% - 80% of the time.
There is a sample run with
agent: false
commented out which shows successful downloads a dozen or more times in a row.My sample script just does manual writing of 'data' chunks from the
res
(response) to a file (fs.createWriteStream
): https://gist.github.com/trentm/80409ded30b4e0418e9c#file-download-sans-agent-js-L83-L86This was me trying to eliminate
.pipe()
usage as a possible cause.https://gist.github.com/trentm/5d3c4d9dbcb7c3b8dbaa is an equivalent script (and sample runs) using
res.pipe(outStream)
. It fails frequently as well.The text was updated successfully, but these errors were encountered: