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

Some crate files in the index can't be downloaded #1177

Closed
est31 opened this issue Nov 26, 2017 · 9 comments
Closed

Some crate files in the index can't be downloaded #1177

est31 opened this issue Nov 26, 2017 · 9 comments
Labels
C-bug 🐞 Category: unintended, undesired behavior

Comments

@est31
Copy link
Member

est31 commented Nov 26, 2017

Over the past 2 days I have been downloading the crates from crates.io using a tool I have written for that purpose and I've discovered that some crates, while mentioned in the index, can't be downloaded from the backend.

The affected (crate, version) pairs:

cargo-ctags v0.2.3
--
glib-2-0-sys v0.0.1
glib-2-0-sys v0.0.2
glib-2-0-sys v0.0.3
glib-2-0-sys v0.0.4
glib-2-0-sys v0.0.5
glib-2-0-sys v0.0.6
glib-2-0-sys v0.0.7
glib-2-0-sys v0.0.8
glib-2-0-sys v0.1.0
glib-2-0-sys v0.1.1
glib-2-0-sys v0.1.2
glib-2-0-sys v0.2.0
--
gobject-2-0-sys v0.0.2
gobject-2-0-sys v0.0.3
gobject-2-0-sys v0.0.4
gobject-2-0-sys v0.0.5
gobject-2-0-sys v0.0.6
gobject-2-0-sys v0.0.7
gobject-2-0-sys v0.0.8
gobject-2-0-sys v0.0.9
gobject-2-0-sys v0.1.0
gobject-2-0-sys v0.2.0

This is exposed to normal users of crates.io as well. If you do the following in your Cargo.toml:

[dependencies]
glib-2-0-sys = "0.0.1"

You will get this error:

$ cargo build
    Updating registry `https://github.com/rust-lang/crates.io-index`
 Downloading glib-2-0-sys v0.0.1                                                
error: unable to get packages from source                                       

Caused by:
  failed to get 200 response from `https://d19xqa3lc3clo8.cloudfront.net/crates/glib-2-0-sys/glib-2-0-sys-0.0.1.crate`, got 403

Looking at the git logs of the index it seems to me that deletions always mean that the specific versions are also deleted from the index. These versions are still present.

@est31 est31 changed the title Sorry but I can't Some crate files in the index can't be downloaded Nov 26, 2017
@progval
Copy link

progval commented Jun 6, 2018

ping?

@carols10cents carols10cents added the C-bug 🐞 Category: unintended, undesired behavior label Jun 27, 2018
@ashleygwilliams
Copy link
Member

ashleygwilliams commented Jul 16, 2018

here's a more complete list posted by iscgar on IRC

@est31
Copy link
Member Author

est31 commented Jul 16, 2018

@ashleygwilliams that list contains packages with uppercase letters in their name, like RustyXML, Lattice or FPS. And those packages can be downloaded, you just need to use the properly cased name. E.g. for RustyXML version 0.1.0 you can use these URLs:

Most likely iscgar's downloader tried to use all lowercase crate names. I've been there myself :p.

As for why glib-2-0-sys is different:

The casing for RustyXML is observable from the json file in the index. Similarly for Lattice and FPS. On the other hand, glib-2-0-sys has the lowercase variant in it's json file. Maybe there is a casing pattern for glib-2-0-sys that works, I haven't tried any. But even if there were, there is clearly a bug here in the json file for glib-2-0-sys. This would then also be a cause for why glib-2-0-sys is unusable from Cargo.toml. cargo probably uses these json files.

@est31
Copy link
Member Author

est31 commented Jul 16, 2018

Hmmm this commit looks very suspicious: rust-lang/crates.io-index@610b81f

So it seems that it has to be glib-2_0-sys. This URL does work and it also has the same hash as the corresponding entry in the json file, f915436b932305fa0dddf926ce1bb513b5a099e78c5223424027cad256c5a6fe:

https://static.crates.io/crates/glib-2_0-sys/glib-2_0-sys-0.0.1.crate

So apparently the rename was performed by @alexcrichton on the index only, but not on the actual files in S3.

This rename explains glib-2-0-sys as well as gobject-2-0-sys but doesn't explain cargo-ctags. I see no human commit in the index for that crate: https://github.com/rust-lang/crates.io-index/commits/master/ca/rg/cargo-ctags

@iscgar
Copy link

iscgar commented Jul 16, 2018

@est31 right, my bad. The list of 403s is indeed now down to cargo-ctags-0.2.3.

@iscgar
Copy link

iscgar commented Jul 16, 2018

cargo-ctags-0.2.3 seems to be missing from the crates.io database (it's the only version of cargo-ctags that is missing)

@est31
Copy link
Member Author

est31 commented Jul 16, 2018

@iscgar No problem!

@iscgar
Copy link

iscgar commented Jul 17, 2018

The cargo-ctags-0.2.3 situation seems to be the same as https://github.com/rust-lang/crates.io-index/pull/11 (see #1447) so the fix here should probably be the same: just remove the 0.2.3 line from the index.

@sgrif
Copy link
Contributor

sgrif commented Jan 11, 2019

cargo-ctags 0.2.3 was likely caused by a rare scenario that we've seen a few times where the index gets successfully updated, but something happens (server restart, database issue, etc) before the database transaction was committed. I've checked the index against our database and removed all cases of any files/versions in the index that aren't present in our database in rust-lang/crates.io-index@e58b304

If any additional cases arise in the future, please open a new issue.

@sgrif sgrif closed this as completed Jan 11, 2019
@ehuss ehuss mentioned this issue Jan 11, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug 🐞 Category: unintended, undesired behavior
Projects
None yet
Development

No branches or pull requests

6 participants