-
Notifications
You must be signed in to change notification settings - Fork 952
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Downloading python from behind corporate proxy fails to download in uv
but works with wget
and rye
#9747
Comments
Just a guess but it seems like the read gets corrupted, |
Are you seeing this consistently? Like every time? |
I'm a little surprised we aren't retrying there... we do have retries setup, but I guess something is being lost because it's technically an extraction error? I'd have to find a way to reproduce it. |
Yes it's happening consistently across multiple machines and OSs |
I'll look into it, though it seems not-great that your proxy is consistently failing :) |
Oh trust me I very much agree :). I'm working internally on diagnosing the root proxy issue so no worries if you want to close this issue. |
Na all good, we should be retrying here! I'm just worried that I'll have trouble emulating the exact error. |
## Summary So the error here is: ```rust ExtractError("cpython-3.11.11%2B20241206-aarch64-apple-darwin-install_only_stripped.tar.gz", Io(Custom { kind: UnexpectedEof, error: TarError { desc: "failed to unpack `/Users/crmarsh/.local/share/uv/python/.cache/.tmpkqFzqE/python/lib/libpython3.11.dylib`", io: Custom { kind: UnexpectedEof, error: TarError { desc: "failed to unpack `python/lib/libpython3.11.dylib` into `/Users/crmarsh/.local/share/uv/python/.cache/.tmpkqFzqE/python/lib/libpython3.11.dylib`", io: Custom { kind: UnexpectedEof, error: "unexpected end of file" } } } } })) ``` This isn't a Reqwest error, so we miss it in `is_extended_transient_error`. We could add `TarError` or `ExtractError` here, but... should we? This PR just extends it to any error that has an IO source. I don't see much of a downside. Closes #9747. ## Test Plan First, ran: `uv run ./scripts/create-python-mirror.py --name cpython --arch aarch64 --os darwin`. Then, dropped this into `./scripts/mirror/server.py`: ```python import os import random from http.server import SimpleHTTPRequestHandler, HTTPServer class GlitchyStaticServer(SimpleHTTPRequestHandler): def do_GET(self): """Handle GET request.""" file_path = self.translate_path(self.path) if not os.path.exists(file_path): self.send_error(404, "File not found") return try: with open(file_path, 'rb') as f: file_content = f.read() # Introduce an "unexpected end of file" glitch randomly if random.random() < 0.75: # 75% chance of glitch glitch_point = random.randint(1, len(file_content) - 1) file_content = file_content[:glitch_point] self.send_response(200) self.send_header("Content-type", self.guess_type(file_path)) self.send_header("Content-Length", len(file_content)) self.end_headers() self.wfile.write(file_content) except Exception as e: self.send_error(500, f"Internal Server Error: {e}") def run(server_class=HTTPServer, handler_class=GlitchyStaticServer, port=8080): """Run the server.""" server_address = ('', port) httpd = server_class(server_address, handler_class) print(f"Serving on port {port} with glitchy behavior") httpd.serve_forever() if __name__ == "__main__": run() ``` Then ran `python server.py` from that directory. From there, ran `UV_PYTHON_INSTALL_MIRROR="http://localhost:8080" cargo run python install 3.11 --reinstall --verbose` to reliably test retries.
uv
rye
wget
The text was updated successfully, but these errors were encountered: