You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
download_node_src does not properly handle multipart downloads #324
The method download_node_src fails if the download doesn't complete in a single part. In my case this lead to a seemingly unrelated error AttributeError: 'bytes' object has no attribute 'tell' deep in the tarfile module. The exception handler,
try:
dl_contents = io.BytesIO(urlopen(node_url).read())
except IncompleteRead as e:
logger.warning('Incomplete read while reading'
'from {}'.format(node_url))
dl_contents = e.partial
assigned a bytes object to dl_contents instead of a BytesIO. However, updating the exception still did not work because "partial" really does mean partial, and is not the complete file so there is no way to use this. Also, simply calling read() again also appears not to be the way to handle multipart.
I got this to work by using requests, which appears to handle this properly
Reacted by Bastien Gérard, Clément Robert, Stefan Rijnhart (Opener), atom-andrew, remss, Kay Hoogland, Maciej Olko, Jacob Alheid, Simone Rubino, Hong Shick Pak and 1 more
We are being affected by this issue as well, are maintainers ok to switch from urllib to requests? Alternative may be to do multiple attempts to download the file in case of IncompleteRead errors
I could not reach a point where I was able to reproduce the issue consistently so I can't confirm that the issue is related with multipart download, I would expect that to be easily reproducible. So it's unclear if request would actually fix it. I believe network glitches are causing this as explained here
Activity
bagerard commentedon Mar 12, 2023
We are being affected by this issue as well, are maintainers ok to switch from urllib to
requests? Alternative may be to do multiple attempts to download the file in case of IncompleteRead errorsFor future ref - potentially related issue here
Make Pyright optional until it's stable again
fruch commentedon May 10, 2023
We are getting hit by the same issue. Inside precommit.
Switching to requests sounds reasonable to me.
hynek commentedon May 10, 2023
Is there anything that makes requests preferable over urllib3 (that requests depends on)?
fruch commentedon Aug 31, 2023
seem like #329 wasn't enough to fix ths issue
we are still get hit by it from time to time:
scylladb/scylla-cluster-tests#6559 (comment)
@hynek if request would know to handle downloading a multi part file out of the box better then urllib3, it good enough reason if it would be my code.
bagerard commentedon Sep 13, 2023
I could not reach a point where I was able to reproduce the issue consistently so I can't confirm that the issue is related with multipart download, I would expect that to be easily reproducible. So it's unclear if
requestwould actually fix it. I believe network glitches are causing this as explained herebagerard commentedon Sep 18, 2023
FYI nodejs/build#1993
Issue is closed but it's still receiving comments
jaklan commentedon Oct 26, 2023
We also affected by that when using
nodehooks inpre-commit.fruch commentedon Aug 8, 2024
maybe there a different place the node binary can be retrieved from ? mirrors or something like that ?
fix(nodeenv): retry broken node downloads and stop hanging on stalls (e…