Skip to content
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

Cannot install cargo-add #7298

Closed
martinellison opened this issue Aug 25, 2019 · 9 comments
Closed

Cannot install cargo-add #7298

martinellison opened this issue Aug 25, 2019 · 9 comments
Labels
C-bug Category: bug

Comments

@martinellison
Copy link

martinellison commented Aug 25, 2019

Problem

cargo install cargo-add
Updating crates.io index
error: failed to fetch https://github.com/rust-lang/crates.io-index

Caused by:
object not found - no match for id (7e4727a91e45d8ef9063b0f8fce4d8eda11dfa5c); class=Odb (9); code=NotFound (-3)

Steps

  1. Try to install cargo-add

Possible Solution(s)

  • Is this the ARM/tool issue again #62558?
  • is this (just) a bad error message? What should it say?

Notes

Output of cargo version:

cargo 1.37.0 (9edd089 2019-08-02)

uname -a

Linux starnova 4.4.154-59-rockchip-g5e70f14 #4 SMP Fri Dec 14 20:55:41 CST 2018 aarch64 aarch64 aarch64 GNU/Linux

Note: can view https://github.com/rust-lang/crates.io-index using Firefox.

@martinellison martinellison added the C-bug Category: bug label Aug 25, 2019
@ehuss
Copy link
Contributor

ehuss commented Aug 25, 2019

Can you compress ~/.cargo/registry/index and post it online somewhere? I'd like to dig into it and see what's wrong. We've had intermittent reports of this, but I'm not sure how it happens.

Afterwards, you can move (or delete) that directory and try again and see if it works?

@ehuss
Copy link
Contributor

ehuss commented Aug 25, 2019

Oh, another thing to do is to run CARGO_LOG=trace cargo install cargo-add and post the output here?

@martinellison
Copy link
Author

@ehuss: here is the trace:

CARGO_LOG=trace cargo install cargo-add
[2019-08-30T05:22:14Z TRACE cargo::util::toml] read_manifest; path=/home/martin/git/fanling10/Cargo.toml; source-id=/home/martin/git/fanling10
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - is root /home/martin/git/fanling10/Cargo.toml
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_members - /home/martin/git/fanling10/taipo-interface/Cargo.toml
[2019-08-30T05:22:14Z TRACE cargo::util::toml] read_manifest; path=/home/martin/git/fanling10/taipo-interface/Cargo.toml; source-id=/home/martin/git/fanling10/taipo-interface
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_members - /home/martin/git/fanling10/test_engine/Cargo.toml
[2019-08-30T05:22:14Z TRACE cargo::util::toml] read_manifest; path=/home/martin/git/fanling10/test_engine/Cargo.toml; source-id=/home/martin/git/fanling10/test_engine
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_members - /home/martin/git/fanling10/pcmain/Cargo.toml
[2019-08-30T05:22:14Z TRACE cargo::util::toml] read_manifest; path=/home/martin/git/fanling10/pcmain/Cargo.toml; source-id=/home/martin/git/fanling10/pcmain
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_members - /home/martin/git/fanling10/rust-test-c/Cargo.toml
[2019-08-30T05:22:14Z TRACE cargo::util::toml] read_manifest; path=/home/martin/git/fanling10/rust-test-c/Cargo.toml; source-id=/home/martin/git/fanling10/rust-test-c
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_members - /home/martin/git/fanling10/life-test/Cargo.toml
[2019-08-30T05:22:14Z TRACE cargo::util::toml] read_manifest; path=/home/martin/git/fanling10/life-test/Cargo.toml; source-id=/home/martin/git/fanling10/life-test
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_members - /home/martin/git/fanling10/Cargo.toml
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - trying /home/martin/git/fanling10/Cargo.toml
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found a root checking exclusion
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found!
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - trying /home/martin/git/fanling10/Cargo.toml
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found a root checking exclusion
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found!
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - trying /home/martin/git/fanling10/Cargo.toml
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found a root checking exclusion
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found!
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - trying /home/martin/git/fanling10/Cargo.toml
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found a root checking exclusion
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found!
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - trying /home/martin/git/fanling10/Cargo.toml
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found a root checking exclusion
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - found!
[2019-08-30T05:22:14Z DEBUG cargo::core::workspace] find_root - is root /home/martin/git/fanling10/Cargo.toml
[2019-08-30T05:22:14Z DEBUG cargo::sources::config] loading: registry https://github.com/rust-lang/crates.io-index
[2019-08-30T05:22:14Z TRACE cargo::core::source::source_id] loading SourceId; registry https://github.com/rust-lang/crates.io-index
[2019-08-30T05:22:14Z DEBUG cargo::sources::registry::remote] updating the index
[2019-08-30T05:22:14Z TRACE cargo::sources::registry::remote] opened a repo without a lock
Updating crates.io index
[2019-08-30T05:22:14Z DEBUG cargo::sources::git::utils] attempting GitHub fast path for https://github.com/rust-lang/crates.io-index
[2019-08-30T05:22:16Z DEBUG cargo::sources::git::utils] fast path failed, falling back to a git fetch
[2019-08-30T05:22:16Z DEBUG cargo::sources::git::utils] skipping gc as there's only 16 pack files
[2019-08-30T05:22:16Z DEBUG cargo::sources::git::utils] doing a fetch for https://github.com/rust-lang/crates.io-index
[2019-08-30T05:22:16Z DEBUG cargo::sources::git::utils] initiating fetch of refs/heads/master:refs/remotes/origin/master from https://github.com/rust-lang/crates.io-index
[2019-08-30T05:22:17Z DEBUG cargo::sources::git::utils] fetch failed: object not found - no match for id (7e4727a91e45d8ef9063b0f8fce4d8eda11dfa5c); class=Odb (9); code=NotFound (-3)
[2019-08-30T05:22:17Z TRACE cargo::util::errors] error: object not found - no match for id (7e4727a91e45d8ef9063b0f8fce4d8eda11dfa5c); class=Odb (9); code=NotFound (-3)
[2019-08-30T05:22:17Z TRACE cargo::util::errors] context: failed to fetch https://github.com/rust-lang/crates.io-index
[2019-08-30T05:22:17Z DEBUG cargo] exit_with_error; err=CliError { error: Some(Error { code: -3, klass: 9, message: "object not found - no match for id (7e4727a91e45d8ef9063b0f8fce4d8eda11dfa5c)" }

failed to fetch https://github.com/rust-lang/crates.io-index), unknown: false, exit_code: 101 }
error: failed to fetch https://github.com/rust-lang/crates.io-index

Caused by:
object not found - no match for id (7e4727a91e45d8ef9063b0f8fce4d8eda11dfa5c); class=Odb (9); code=NotFound (-3)

@martinellison
Copy link
Author

martinellison commented Sep 2, 2019

For some reason, on one of my boxes, cargo install cargo-edit is crashing my box. Not just a segfault, the whole system halts. It gets half way through the compiles and the system just turns itself off. I have no idea why. I have reinstalled the operating system, reinstalled Rust, fscked the disks, and not got any errors. I've tried running the command in the debugger and still got the same result. I'm not saying it is a Rust issue and anyway the worst that should happen (from any sort of Rust error) is a segfault.

Edit: I have done some more testing by installing Rust to a different disk and running cargo install cargo-edit using the new installation. I get the same result, namely a complete system crash (halt). So it is not a storage issue. Somehow a Rust build is crashing my entire system.

@alexcrichton
Copy link
Member

This may or may not be related to #3042, but can you zipping up $HOME/.cargo, blowing it away, and retrying? If it works after the retry, can you send us the zipped up version of $HOME/.cargo so we can poke around?

@martinellison
Copy link
Author

@alexcrichton

My zip file is 166M and I cannot upload it.

@alexcrichton
Copy link
Member

Would something like https://send.firefox.com/ perhaps make it possible to share the file?

@martinellison
Copy link
Author

@alexcrichton I have done some further investigation and the situation appears to be as follows:

  1. I had an intermittent hardware fault in a PC that made it halt (the entire box stopped, like sudo shutdown now) with less than an hour between failures.
  2. The system shutdown while I was running cargo install cargo-edit (not the fault of cargo).
  3. This corrupted my $CARGO_HOME file tree.

I have since replaced my PC (it was a $70 mini-PC, so no big problem) with the same model, and now cargo runs fine.

@alexcrichton
Copy link
Member

Ok! Sounds like we can close it in that case, thanks for following up though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants