rust-lang / cargo

The Rust package manager
https://doc.rust-lang.org/cargo
Apache License 2.0
12.79k stars 2.42k forks source link

Unable to get packages from source (failed to download `solana-program v1.9.6`) #10390

Open Gogotchuri opened 2 years ago

Gogotchuri commented 2 years ago

Problem

While trying to build a project initialized with anchor I get the following error. I was trying to search and deduce solution, I was not successful. When I run cargo build from project root, I am getting error written below. I am not sure what kind of additional information I should provide, give me instructions if necessary and I'll provide the additional info.

P.S. I am posting this here, since output suggested so.

Error Output

error: failed to download solana-program v1.9.6 Caused by: unable to get packages from source

Caused by: failed to find solana-program v1.9.6 in path source note: this is an unexpected cargo internal error note: we would appreciate a bug report: https://github.com/rust-lang/cargo/issues/ note: cargo 1.58.0 (f01b232bc 2022-01-19)

Steps

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.58.0 (f01b232bc 2022-01-19)
release: 1.58.0
commit-hash: f01b232bc7f4d94f0c4603930a5a96277715eb8c
commit-date: 2022-01-19
host: x86_64-unknown-linux-gnu
libgit2: 1.3.0 (sys:0.13.23 vendored)
libcurl: 7.80.0-DEV (sys:0.4.51+curl-7.80.0 vendored ssl:OpenSSL/1.1.1l)
os: Manjaro 21.2.3 (Qonos) [64-bit]
ehuss commented 2 years ago

I'm guessing the registry cache has gotten corrupted somehow. I might suggest just deleting it. It is located at $CARGO_HOME/registry where $CARGO_HOME is usually $HOME/.cargo.