uv: insufficient retrying around transient errors during `uv sync` (os error 104 in this case)
With uv 0.4.20 while running uv sync --locked I saw this:
...
2024-10-12T10:59:36.1923265Z Resolved 309 packages in 1ms
2024-10-12T10:59:42.4248290Z error: Failed to prepare distributions
2024-10-12T10:59:42.4252642Z Caused by: Failed to fetch wheel: validators==0.20.0
2024-10-12T10:59:42.4257462Z Caused by: Failed to resolve requirements from `setup.py` build
2024-10-12T10:59:42.4261587Z Caused by: No solution found when resolving: `setuptools>=40.8.0`
2024-10-12T10:59:42.4265596Z Caused by: request or response body error
2024-10-12T10:59:42.4269481Z Caused by: error reading a body from connection
2024-10-12T10:59:42.4273696Z Caused by: Connection reset by peer (os error 104)
2024-10-12T10:59:42.4366532Z ##[error]Process completed with exit code 2.
...
Environment: github actions
The log does not reveal if any retry was attempted. Such transient errors should certainly be retried for a small-ish number of times, up to a reasonable deadline.
As I have thought and talked a lot about the relevance of retries around transient errors in distributed systems and CI: once we improve the retrying logic it would be great to have explicit logs indicating those error and retries, leading up to success.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 24 (12 by maintainers)
Commits related to this issue
- Add more context on resolve client error I'm not clear where #8144 comes from, so I'm adding some more error context to narrow it down. — committed to astral-sh/uv by konstin 2 years ago
- Add more context on resolve client error (#8285) I'm not clear where #8144 comes from, so I'm adding some more error context to narrow it down. — committed to astral-sh/uv by konstin 2 years ago
- Always attach URL to network errors Due to the enduring problems with #8144 and related issues, I've opted for a more systemic approach and switched all reqwest errors to not use the implicit-try-fal... — committed to astral-sh/uv by konstin 2 years ago
- Always attach URL to network errors Due to the enduring problems with #8144 and related issues, I've opted for a more systemic approach and switched all reqwest errors to not use the implicit-try-fal... — committed to astral-sh/uv by konstin 2 years ago
- Always attach URL to network errors Due to the enduring problems with #8144 and related issues, I've opted for a more systemic approach and switched all reqwest errors to not use the implicit-try-fal... — committed to astral-sh/uv by konstin 2 years ago
- Automatically retry body errors when processing response (#9213) ## Summary The reqwest middleware doesn't retry errors that occur "after" the request completes -- but in some cases, these do inc... — committed to yk-kd/uv by charliermarsh 2 years ago
I agree that there should be messaging about retries, but iirc the problem here specifically is that that code path isn’t in our retry logic at all (streaming or range requests, at least that what it’s look likes from the logs, this needs a proper investigation of course), so what’s missing is hooking this into our retry logic, which will then also print proper feedback about retries.
there’s was a not critically missing in that sentence
Yeah I have a reproduction, we just don’t seem to be retrying those, but it looks like we should be so still trying to understand why.
(I’ll try to debug today.)
I see that PR landed so I ran my build setup with
ENV RUST_LOG=uv=traceand set uv to 0.4.25, and I got the error immediately.FYI, I suspect the network issue on our end is the firewall decides it needs to do a security scan of the package, it kills the network connection, after the security scan is complete the same requests work for, at least a few more days, but at some point it falls out of the firewall cache (most our builds are cached so we don’t normally make this network request). Compared to uv, it appears pip’s timeout/retry mechanism will wait long enough for the security scan to complete.
Find below as much as the end log as I could fit in this post, if you need me to attach the entire log I will need to make a request to access gist (it is blocked by default).
I’m not clear where the error originates so I’m trying to get better traces with #8285.
I’m confused, I don’t see “after 3 retries” in the error message?
I believe we already have this.