Add URL to Logs when Retrying
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 45/100
Research direction
Start in zyte_api/aio/client.py, especially the retry-related code at lines 62–130, and inspect how the DEBUG retry message is assembled. Update the log so it includes the request URL, then verify that retry messages contain the URL while retaining the existing error details.
Written by the indexing model from the issue text.
Description
Currently, this section of the code https://github.com/zytedata/python-zyte-api/blob/main/zyte_api/aio/client.py#L62-L130 produces this DEBUG log when retrying errors:
[zyte_api.aio.retry] Retrying zyte_api.aio.client.AsyncClient.request_raw.<locals>.request in 7.430951650096189 seconds as it raised RequestError: RequestError: 520, message=, headers=<CIMultiDictProxy('Date': 'Tue, 19 Dec 2023 09:07:00 GMT', 'Content-Type': 'application/problem+json', 'Content-Length': '301', 'Connection': 'keep-alive', 'Retry-After': '60', 'Request-Id': '8dc64f033de37f442807c9d378c5044b', 'Vary': 'Accept-Encoding', 'Strict-Transport-Security': 'max-age=31536000; includeSubDomains; preload', 'Access-Control-Allow-Credentials': 'true', 'Access-Control-Expose-Headers': '*, X-Project-Key', 'Access-Control-Allow-Methods': 'GET, PUT, POST, DELETE, PATCH, OPTIONS', 'Access-Control-Allow-Headers': 'DNT, Keep-Alive, User-Agent, X-Requested-With, If-Modified-Since, Cache-Control, Content-Type, Range, Authorization, X-Project-Key', 'Access-Control-Max-Age': '1728000')>, body=b'{"type":"/download/temporary-error","title":"Temporary Downloading Error","status":520,"detail":"There is a downloading problem which might be temporary. Retry in N seconds from \'Retry-After\' header or open a support ticket from https://support.zyte.com/support/tickets/new if it fails consistently."}', request_id=8dc64f033de37f442807c9d378c5044b.
Notice that the URL of the request in isn't logged here, but the header is.
- Dominant language
- Python
- Stars
- 30
- Forks
- 9
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zytedata/python-zyte-api
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
zytedata/python-zyte-api#91 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
zytedata/python-zyte-api#106 · 1 comment ·
All issues in zytedata/python-zyte-api
Similar issues
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100