streamrip icon indicating copy to clipboard operation
streamrip copied to clipboard

[BUG] Script aborts with "ClientPayloadError: Response payload is not completed" error

Open bmn001 opened this issue 1 year ago • 0 comments

Describe the bug

There is a high probability when downloading any album that the entire process will abort mid-way through with a "ClientPayloadError: Response payload is not completed" error.

It may happen on the first track, or may happen on the 7th track. Or it may not happen at all. It's totally unpredictable.

If I repeat the streamrip command again, the album download will continue where it left off. And again, it may error out with this same error, or it may continue flawlessly.

This is the exact error I get when it crashes back to the command line:

╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /home/pi/.local/bin/rip:8 in <module>                                                            │
│                                                                                                  │
│   5 from streamrip.rip import rip                                                                │
│   6 if __name__ == '__main__':                                                                   │
│   7 │   sys.argv[0] = re.sub(r'(-script\.pyw|\.exe)?$', '', sys.argv[0])                         │
│ ❱ 8 │   sys.exit(rip())                                                                          │
│   9                                                                                              │
│                                                                                                  │
│ /usr/lib/python3/dist-packages/click/core.py:1130 in __call__                                    │
│                                                                                                  │
│                                     ... 18 frames hidden ...                                     │
│                                                                                                  │
│ /home/pi/.local/lib/python3.11/site-packages/aiohttp/streams.py:44 in __anext__                  │
│                                                                                                  │
│    41 │                                                                                          │
│    42 │   async def __anext__(self) -> _T:                                                       │
│    43 │   │   try:                                                                               │
│ ❱  44 │   │   │   rv = await self.read_func()                                                    │
│    45 │   │   except EofStream:                                                                  │
│    46 │   │   │   raise StopAsyncIteration                                                       │
│    47 │   │   if rv == b"":                                                                      │
│                                                                                                  │
│ /home/pi/.local/lib/python3.11/site-packages/aiohttp/streams.py:347 in read                      │
│                                                                                                  │
│   344 │                                                                                          │
│   345 │   async def read(self, n: int = -1) -> bytes:                                            │
│   346 │   │   if self._exception is not None:                                                    │
│ ❱ 347 │   │   │   raise self._exception                                                          │
│   348 │   │                                                                                      │
│   349 │   │   # migration problem; with DataQueue you have to catch                              │
│   350 │   │   # EofStream exception, so common way is to run payload.read() inside               │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
ClientPayloadError: Response payload is not completed

Command Used

rip url https://www.qobuz.com/us-en/album/[any artist]/[any album]

Debug Traceback

It's a long traceback.  Too long for github.

Lots of info redacted.

https://pastebin.com/bDHSSun2

Config File

Error: No such option: --open

Operating System

Raspberry Pi OS, kernel 6.1.21-v8+

streamrip version

2.0.5

Screenshots and recordings

No response

Additional context

This affects streamrip running on a Raspberry Pi 4 with 8gb of ram.

My guess is that the networking hardware on the Pi is just piece of shit (or its network stack is) and it's crapping out somewhere.

Maybe an automatic retry could be triggered if a "ClientPayloadError" is detected?

bmn001 avatar Feb 23 '24 18:02 bmn001