Repository navigation
Description
Summary
When a HTTP proxy environment variable, e. g. HTTP_PROXY is set, then uv will use that proxy. However that happens silently, even in the verbose output.
Due to the pecularities of uv's Rust network stack it won't be able to resolve single label names. So if HTTP_PROXY=http://proxy is set this leads to the following error:
$ uv lock --upgrade-package lxml
cause: Failed to fetch:
https://devpi.local/lst/stable/+simple/requests-oauthlib/
cause: error sending request for url
(https://devpi.local/lst/stable/+simple/requests-oauthlib/)
cause: client error (Connect)
cause: tunnel error: failed to create underlying connection
cause: dns error
cause: error resolving DNS
cause: failed to lookup address information: Name does not resolve
The resources given in the error message work entirely fine. So the DNS error looks pretty weird. After serious headscratching it turns out that it's actually true that there was a DNS error and the issue is that the name of the proxy can't be resolved since it has only one label. When setting HTTP_PROXY=http://proxy.local it will work fine.
This only happens with musl builds of uv, as installed through the distroless docker image. On Glibc based systems it doesn't happen when uv is installed through pip, as this results in a version without the problematic code. It uses Glibc instead, which is able to resolve single label names.
Please make a clearer error message in this case. If the problem is actually the connection to the proxy then explicitly state that and mention the proxy's URL instead, or in addition to, the URL that was attempted to load through it.
Platform
Debian GNU/Linux 13 (trixie), Linux 5.14.0-741.22.1.el9_9.x86_64 x86_64 GNU/Linux
Version
uv 0.13.9 (x86_64-unknown-linux-musl)
Python version
Python 3.14.9
Activity
arifrhm commentedon Nov 19, 2026
Hi @KrilleGH! I've submitted a fix for this in PR #23292.
The PR addresses both aspects mentioned in the issue:
hyper_utiltunnel & SOCKS errors) and clearly reportsFailed to connect to proxy <proxy_url>: <underlying error>instead of misleadingly blaming the target URL's DNS resolution.HTTP_PROXY,HTTPS_PROXY,ALL_PROXY,NO_PROXY) indebug!verbose output.KrilleGH commentedon Nov 19, 2026
Hi @arifrhm,
while I don't have much clue about Rust or
uvinternals, your PR looks good to me. Thank you! 🚀konsti-openai commentedon Nov 19, 2026
I put up a reqwest fix: seanmonstar/reqwest#3144
KrilleGH commentedon Nov 19, 2026
Besides the upstream fix I'd also like to see some verbose messages about the proxy being in effect from
uvitself before anything happens.