# Download Failed -\> GET read: connection timed out

**URL:** <https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589>\
**Category:** troubleshooting\
**Created:** [August 23, 2023, 4:11pm UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589 "2023-08-23T16:11:13Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![flo82](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/flo82/32/10747_2.png) [@flo82](https://forum.storj.io/u/flo82)\
**Post date:** [August 23, 2023, 4:11pm UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589/1 "2023-08-23T16:11:13Z")

</div>

Sometimes downloads from my node fail:

> {L:ERROR,T:2023-08-23T08:35:10Z,N:piecestore,M:download failed,process:storagenode,Piece ID:K5J2VNZAR6BYDZOXIOY5DW2JIIIMGPQIGAFZCZVX3GTG2655ADIQ,Satellite ID:12L9ZFwhzVpuEKMUNUqkaTLGzwY9G24tbiigLiXpmZWKwmcNDDs,Action:GET,Offset:0,Size:1781760,Remote Address:y.y.y.y:54930,error:manager closed: read tcp x.x.x.x:49419-\>y.y.y.y:54930: read: connection timed out,errorVerbose:manager closed: read tcp x.x.x.x:49419-\>y.y.y.y:54930: read: connection timed out  
> [github.com/jtolio/noiseconn.(Conn).readMsg:211](http://github.com/jtolio/noiseconn.(Conn).readMsg:211)  
> [github.com/jtolio/noiseconn.(Conn).Read:171](http://github.com/jtolio/noiseconn.(Conn).Read:171)  
> [storj.io/drpc/drpcwire.(Reader).ReadPacketUsing:96](http://storj.io/drpc/drpcwire.(Reader).ReadPacketUsing:96)  
> [storj.io/drpc/drpcmanager.(Manager).manageReader:226](http://storj.io/drpc/drpcmanager.(Manager).manageReader:226)}

Any idea why this happens?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [August 24, 2023, 7:14am UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589/2 "2023-08-24T07:14:33Z")

</div>

Either your router dropped the connection, or the customer is cutting a long tail:

> [@Longterm business viability of storj](https://forum.storj.io/t/longterm-business-viability-of-storj/18403/17):
>
> Slow nodes will be canceled due “to long tail cut”, so you would upload to the fastest nodes and download from the fastest nodes (110 nodes will be selected for upload and uploads will be cancelled when the first 80 are finished, and 39 nodes will be selected for download and downloads will be cancelled when the first 29 are finished - you need to have only 29 pieces from 80 to reconstruct a segment). The Storj network has achieved strong read-after-write consistency. Your object will not be av…

---

<div class="post-metadata">

**Author:** ![flo82](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/flo82/32/10747_2.png) [@flo82](https://forum.storj.io/u/flo82)\
**Post date:** [August 24, 2023, 7:54am UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589/3 "2023-08-24T07:54:32Z")

</div>

Thanks for the reply, @Alexey

If the download is cancelled I would not expect a read timeout. Shouldn’t the connection be closed gracefully?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [August 24, 2023, 7:59am UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589/4 "2023-08-24T07:59:04Z")

</div>

No, it’s intentional

> <https://github.com/storj/storj/pull/2757>
>
> What: 
> Create a new context and cancelation function from inside \`decodedRanger….Range()\`, and use these within \`DecodeReaders()\` rather than creating them inside \`DecodeReaders()\`.
> 
> It solves an issue related to read calls blocking close calls when we are finished with a download.
> 
> 20 downloads of a 10mb file (average):
> master: 9.64085s
> green/close-grpc: 7.51985s
> difference: 2.121s
> 
> Why: https://storjlabs.atlassian.net/browse/V3-2245
> 
> Please describe the tests:
> - Test 1:
> - Test 2:
>  
> Please describe the performance impact:
> 
> \## Code Review Checklist (to be filled out by reviewer)
> - \[\] Does the PR describe what changes are being made?
> - \[\] Does the PR describe why the changes are being made?
> - \[\] Does the code follow \[our style guide\](https://github.com/storj/docs/blob/master/code/Style.md)?
> - \[\] Does the code follow \[our testing guide\](https://github.com/storj/docs/blob/master/code/Testing.md)?
> - \[\] Is the PR appropriately sized? (If it could be broken into smaller PRs it should be)
> - \[\] Does the new code have enough tests? (\*every\* PR should have tests or justification otherwise. Bug-fix PRs especially)
> - \[\] Does the new code have enough documentation that answers "how do I use it?" and "what does it do?"? (both source documentation and \[higher level\](https://github.com/storj/docs), diagrams?)
> - \[\] Does any documentation need updating?
> - \[\] Do the database access patterns make sense?

So, the resulting error in the node’s logs may differ, depends on what moment the client canceled the connection.

---

<div class="post-metadata">

**Author:** ![flo82](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/flo82/32/10747_2.png) [@flo82](https://forum.storj.io/u/flo82)\
**Post date:** [August 24, 2023, 8:13am UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589/5 "2023-08-24T08:13:27Z")

</div>

So that I understand what this means: The client does not properly terminate the connection. The server keeps the connection open until it times out.

Isn’t this inperformant from a server point of view when there is a lot of load (with many connections that timeout)? Aren’t connections kept open unnecessarily?

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [August 24, 2023, 8:52am UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589/6 "2023-08-24T08:52:22Z")

</div>

The server in this context is your node. So, it may try to keep it open, however it will be terminated anyway.

> [@flo82](#):
>
> Isn’t this inperformant from a server point of view when there is a lot of load (with many connections that timeout)?

did you ever see an issue with preventing to open a new connection to your node? Any connection rejections in your logs? Or may be did you see a full bandwidth usage?  
Usually the reason for connection terminating by the client, when your node is unable to deliver data fast enough, not because of too many not yet closed connections.  
From the other point - your node cannot be close to everyone customer in the world.

---

<div class="post-metadata">

**Author:** ![flo82](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/flo82/32/10747_2.png) [@flo82](https://forum.storj.io/u/flo82)\
**Post date:** [August 24, 2023, 10:31am UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589/7 "2023-08-24T10:31:01Z")

</div>

> did you ever see an issue with preventing to open a new connection to your node? Any connection rejections in your logs? Or may be did you see a full bandwidth usage?

I only see the read connection errors when there many download-connections. I monitor my node with [storj-monitor](http://storjnet.info/~) and there are connection timeouts to my node at the same time. So I would say yes - there are connection problems.

Peak download traffic is not much - only 40 MBit/sec. The node has a 1000/1000 MBit connection - so the networking connection is not saturated. The node has enough ram and cpu and load/iowait is also fine.

In addition to those mentioned read-connection logs I also see a lot (~ 40 logs/sec “download started” and after 1 second ~40 “download cancelled” logs for the same piece id. Same remote adress but with different port). Here are the corresponding log lines (1 example):

> {“L”:“INFO”,“T”:“2023-08-24T00:37:01Z”,“N”:“piecestore”,“M”:“download started”,“process”:“storagenode”,“Piece ID”:“U3KA6GYKMJVPDUBWUJKABPHRWAIYJXAD3AMSYAT5OJ6KRV7FBM2A”,“Satellite ID”:“12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S”  
> ,“Action”:“GET”,“Offset”:0,“Size”:262144,“Remote Address”:“x.x.x.x:57258”}  
> {“L”:“INFO”,“T”:“2023-08-24T00:37:02Z”,“N”:“piecestore”,“M”:“download canceled”,“process”:“storagenode”,“Piece ID”:“U3KA6GYKMJVPDUBWUJKABPHRWAIYJXAD3AMSYAT5OJ6KRV7FBM2A”,“Satellite ID”:"12EayRS2V1kEsWESU9QMRseFhdxYxKicsiFmxrsLZHeLUtdps3S  
> ",“Action”:“GET”,“Offset”:0,“Size”:262144,“Remote Address”:“x.x.x.x:57258”}

I just want to double check if this designed behaviour or a bug.

---

<div class="post-metadata">

**Author:** ![Alexey](https://storj.bcdn.literatehosting.com/user_avatar/forum.storj.io/alexey/32/41_2.png) [@Alexey](https://forum.storj.io/u/Alexey)\
**Post date:** [August 25, 2023, 1:44am UTC](https://forum.storj.io/t/download-failed-get-read-connection-timed-out/23589/8 "2023-08-25T01:44:31Z")

</div>

> [@Download failed: "use of closed network connection" - Something wrong, or I just lost the race?](https://forum.storj.io/t/download-failed-use-of-closed-network-connection-something-wrong-or-i-just-lost-the-race/12153/4):
>
> Once upon a time, the uplink was sending a message to the storage node before closing the channel. That is an additional roundtrip. For faster downloads, the uplink nowadays just terminates the connection without any hint. The storage node is forced to guess and will produce different messages depending on the situation in which this happens. Most of the time the storage node will assume the reason was the longtail cancelation but in some rare cases, it can also produce other error messages.

There are two possible options:

1. Network issues. You will see a lot of errors such as “deadline timeout exceeded”, “no route to host”, “i/o timeout”, etc.
2. The client closing connections because your node is too slow for them. “download canceled”, “upload canceled”, “context canceled”, etc.

From provided information so far I can assume that these errors are canceled downloads by the customers
