cargo: Unable to update registry `crates-io`

Problem

OS: Debian testing Rustc version: rustc 1.59.0-nightly cargo version: cargo 1.59.0-nightly

I am not able to build any rust project with cargo. It doesn’t matter whether I have cargo/rustc installed by rustup or via apt. Switching from stable to nightly didn’t resovel the issue either. All attemps at building throw the following error:


$ cargo build
    Updating crates.io index
error: failed to get `bytes` as a dependency of package `onenote_parser v0.3.0 (/home/user/onenote.rs)`

Caused by:
  failed to load source for dependency `bytes`

Caused by:
  Unable to update registry `crates-io`

Caused by:
  failed to fetch `https://github.com/rust-lang/crates.io-index`

Caused by:
  an unknown git error occurred; code=NotFound (-3)

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

No response

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 5
  • Comments: 19 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Non of above works for me, remove the cache solved my problem

rm -rf ~/.cargo/registry/cache

ah ok, my bad. log trace is attached. It seems to work with CARGO_NET_GIT_FETCH_WITH_CLI=true log_trace.txt .

I have the same issue on PowerPC Debian with a brand new install. CARGO_NET_GIT_FETCH_WITH_CLI=true seemed to fix things for me as well.