PlaidWeb / PlaidWeb/Pushl

aiohttp.client_exceptions.ClientPayloadError on feeds using chunked encoding

Open
#44 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
32
Forks
0
Avg merge
1m
Merged PRs (30d)
1

Description

Comment feeds from phpBB are delivered using chunked encoding, in a way which makes aiohttp barf. Fetching via curl works:

$ curl -i https://songfight.net/forums/app.php/feed/posts
HTTP/1.1 200 OK
Date: Sun, 21 Jun 2020 07:30:08 GMT
Server: Apache
Cache-Control: private, must-revalidate
Set-Cookie: phpbb3_fhvs1_u=1; expires=Mon, 21-Jun-2021 07:30:08 GMT; path=/; domain=.songfight.net; HttpOnly
Set-Cookie: phpbb3_fhvs1_k=; expires=Mon, 21-Jun-2021 07:30:08 GMT; path=/; domain=.songfight.net; HttpOnly
Set-Cookie: phpbb3_fhvs1_sid=da219fd5cb7c6839f6f2ecaae0ce9dd7; expires=Mon, 21-Jun-2021 07:30:08 GMT; path=/; domain=.songfight.net; HttpOnly
Upgrade: h2
Connection: Upgrade
Last-Modified: Sun, 21 Jun 2020 07:21:51 GMT
Cache-Control: max-age=172800
Expires: Tue, 23 Jun 2020 07:30:08 GMT
Vary: User-Agent
Transfer-Encoding: chunked
Content-Type: application/atom+xml

<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-gb">
...

but in pushl it fails:

$ pipenv run pushl -rvvvk --rel-exclude '' https://songfight.net/forums/app.php/feed/posts
DEBUG:asyncio:Using selector: EpollSelector
DEBUG:pushl:++WAIT: https://songfight.net/forums/app.php/feed/posts: get feed
DEBUG:pushl.feeds:++WAIT: cache get feed https://songfight.net/forums/app.php/feed/posts
DEBUG:pushl.feeds:++DONE: cache get feed https://songfight.net/forums/app.php/feed/posts
DEBUG:pushl.feeds:++WAIT: request get https://songfight.net/forums/app.php/feed/posts None)
DEBUG:utils:https://songfight.net/forums/app.php/feed/posts: got error <class 'aiohttp.client_exceptions.ClientPayloadError'> Response payload is not completed (retry=0)
DEBUG:utils:https://songfight.net/forums/app.php/feed/posts: got error <class 'aiohttp.client_exceptions.ClientPayloadError'> Response payload is not completed (retry=1)
DEBUG:utils:https://songfight.net/forums/app.php/feed/posts: got error <class 'aiohttp.client_exceptions.ClientPayloadError'> Response payload is not completed (retry=2)
DEBUG:utils:https://songfight.net/forums/app.php/feed/posts: got error <class 'aiohttp.client_exceptions.ClientPayloadError'> Response payload is not completed (retry=3)
DEBUG:utils:https://songfight.net/forums/app.php/feed/posts: got error <class 'aiohttp.client_exceptions.ClientPayloadError'> Response payload is not completed (retry=4)
WARNING:utils:https://songfight.net/forums/app.php/feed/posts: Exceeded maximum retries; errors: {'Response payload is not completed'}
DEBUG:pushl.feeds:++DONE: request get https://songfight.net/forums/app.php/feed/posts
ERROR:pushl.feeds:Could not get feed https://songfight.net/forums/app.php/feed/posts: -1
DEBUG:pushl:++DONE: https://songfight.net/forums/app.php/feed/posts: get feed
INFO:pushl.main:Completed all tasks

There is probably some configuration that needs to be sent to aiohttp to make it more tolerant of chunked encoding weirdness.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the documented pushl command against the phpBB feed, then inspect the pushl.feeds request path and utils retry logging around aiohttp. Done means the chunked feed completes successfully without ClientPayloadError and the feed can be retrieved instead of exhausting retries.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.