cargo: Cargo download dependency failed "send: no filter connected"
Problem
Cargo download dependency failed
This issue I filed on rust forum before, But I didn’t get enough useful information.
Edited by a maintainer
The error may look like:
% cargo t -v
**error****:** failed to download from `https://crates.io/api/v1/crates/zstd-sys/2.0.7+zstd.1.5.4/download`
Caused by:
[2] Failed initialization ([CONN-1-0] send: no filter connected)
This is due to a bug in some bad versions of libcurl, whose HTTP/2 multiplexing is not compatible with http proxy settings. The affected versions are:
- 7.87.0
- 7.88.0
- 7.88.1
If you’re on macOS and your system libcurl is included, we suggest
- either using Rust version
1.71,beta-2023-06-09,nightly-2023-06-11or newer - or disabling
http.multiplexingmanually in.cargo/config.tomlorCARGO_HTTP_MULTIPLEXING=false.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 37 (12 by maintainers)
Commits related to this issue
- kraken-std/: improvement: Add `--no-http2` to the mitmproxy when invoked via the Cargo auth proxy task. This is to work around an issue with Cargo HTTP/2 multi-plexing (see https://github.com/rust-lan... — committed to kraken-build/kraken by NiklasRosenstein a year ago
- kraken-std/: improvement: Add `--no-http2` to the mitmproxy when invoked via the Cargo auth proxy task. This is to work around an issue with Cargo HTTP/2 multi-plexing (see https://github.com/rust-lan... — committed to kraken-build/kraken by NiklasRosenstein a year ago
- Work-around for Cargo download dependency failed This is a work-around for charm build failures resulting in: "Cargo download dependency failed "send: no filter connected". This is documented in the... — committed to openstack/charm-octavia-diskimage-retrofit by deleted user 9 months ago
- Update git submodules * Update charm-octavia-diskimage-retrofit from branch 'master' to bbd0e0e253de88bce458ca297495eb7005d2479c - Work-around for Cargo download dependency failed This i... — committed to openstack/openstack by deleted user 9 months ago
It looks like a bug mostly for macOS since it’s shipped with curl v7.88.1 on the latest Ventura 13.4. And curl v7.88.1 has some bugs mentioned in https://github.com/rust-lang/cargo/issues/11746. For me
CARGO_HTTP_MULTIPLEXING=falsesolves the problem.Hi, all!
The beta backport of #12234 just got merged — https://github.com/rust-lang/rust/pull/112421. If everything goes well,
rustc 1.71.0-beta.3or some version should include that fix. I’ll let you know once it comes to live. Thank you!Hello everyone. The fix should be available in
beta-2023-06-09. Pleaserustup install beta-2023-06-09and test it withcargo +beta-2023-06-09 <subcommand>. Thanks 😃It depends. Some
.cratefiles might be downloaded already and stored in~/.cargo/registry/cacheI am collecting information and working on a possible workaround. Please help confirm whether
CARGO_HTTP_MULTIPLEXING=falseworks for you.@mouse07410 That is because you have added the PATH of curl 8.1.2 to your shell. However, for libcurl, I doubt whether cargo will follow any of the environment variable suggests. I guess it uses the OS-default curl directly, whose version is 7.88.1.
I’m on the latest MacOS, and observe the same problem. It manifest itself with a few crates, but not with all of them - which is surprising to me.
I have correctly configured proxy, which works for Git and everything else. My curl is 8.1.2 - latest stable, installed via Macports.
I haven’t tried yet
CARGO_HTTP_MULTIPLEXING=false@XOR-op @weihanglo Thanks,
CARGO_HTTP_MULTIPLEXING=falseworked.I set the mirror source: `[source.crates-io] replace-with = ‘ustc’
[source.ustc] registry = “git://mirrors.ustc.edu.cn/crates.io-index”`
and finally solve the problem with unset proxy in zsh (registry
ustc): `export http_proxy=export https_proxy=`
and
`export HTTP_PROXY=
export HTTPS_PROXY=`
maybe this will help.