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

embedded-hal-nb v1.0.0-alpha.2 missing from index. #6306

Closed
Dirbaio opened this issue Apr 6, 2023 · 9 comments · Fixed by #5066
Closed

embedded-hal-nb v1.0.0-alpha.2 missing from index. #6306

Dirbaio opened this issue Apr 6, 2023 · 9 comments · Fixed by #5066
Labels
C-bug 🐞 Category: unintended, undesired behavior

Comments

@Dirbaio
Copy link

Dirbaio commented Apr 6, 2023

Problem

embedded-hal-nb v1.0.0-alpha.2 was released yesterday, however trying to use it as a dependency fails, as if it wasn't there.

Steps

[dirbaio@mars ~]$ cargo new repro
cd     Created binary (application) `repro` package
[dirbaio@mars ~]$ cd repro/
[dirbaio@mars repro]$ echo 'embedded-hal-nb = "=1.0.0-alpha.2"' >> Cargo.toml 
[dirbaio@mars repro]$ cargo build
    Updating crates.io index
error: failed to select a version for the requirement `embedded-hal-nb = "=1.0.0-alpha.2"`
candidate versions found which didn't match: 0.0.0
location searched: crates.io index
required by package `repro v0.1.0 (/home/dirbaio/repro)`
perhaps a crate was updated and forgotten to be re-vendored?

Possible Solution(s)

Looking with CARGO_LOG=trace, it seems it's downloading this https://index.crates.io/em/be/embedded-hal-nb, and indeed v1.0.0-alpha.2 is missing.

It seems to be an issue of the new sparse protocol only. Forcing using the old one works: CARGO_REGISTRIES_CRATES_IO_PROTOCOL=git cargo build

Notes

No response

Version

[dirbaio@mars repro]$ cargo version --verbose
cargo 1.70.0-nightly (0e474cfd7 2023-03-31)
release: 1.70.0-nightly
commit-hash: 0e474cfd7b16b018cf46e95da3f6a5b2f1f6a9e7
commit-date: 2023-03-31
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.16.0 vendored)
libcurl: 8.0.1-DEV (sys:0.4.61+curl-8.0.1 vendored ssl:OpenSSL/1.1.1q)
os: Arch Linux Rolling Release [64-bit]
@ehuss
Copy link
Contributor

ehuss commented Apr 6, 2023

Thanks for the report! I have raised this with our infrastructure people.

@Vollbrecht
Copy link

Vollbrecht commented Apr 6, 2023

some of my gh workers have the same problem, but on my local dev environment i don't have an issue. Some output from my local env:

wget -q -O - https://index.crates.io/em/be/embedded-hal-nb
{"name":"embedded-hal-nb","vers":"0.0.0","deps":[],"cksum":"391754bb955d3a8cb0f6d125e3c26e04033dd54409e037e9f277f3f9e45d334c","features":{},"yanked":false}
{"name":"embedded-hal-nb","vers":"1.0.0-alpha.0","deps":[{"name":"embedded-hal","req":"=1.0.0-alpha.8","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"nb","req":"^1","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"stm32f1","req":"^0.15","features":["stm32f103","rt"],"optional":false,"default_features":true,"target":null,"kind":"dev"}],"cksum":"9c3e6f55e08bc5278002a35f60dd11c70bdbc9a0c8a3a4752530bb3b9a17687a","features":{},"yanked":false}
{"name":"embedded-hal-nb","vers":"1.0.0-alpha.1","deps":[{"name":"embedded-hal","req":"=1.0.0-alpha.9","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"nb","req":"^1","features":[],"optional":false,"default_features":true,"target":null,"kind":"normal"},{"name":"stm32f1","req":"^0.15","features":["stm32f103","rt"],"optional":false,"default_features":true,"target":null,"kind":"dev"}],"cksum":"7e0760ec0a3bf76859d5e33f39542af103f157d5b2ecfb00ace56dd461472e3a","features":{},"yanked":false}

note that this does not have the 1.0.0-alpha.2 version in it. But i can do the follwing and get an correct 304 ->
curl -I --header 'If-Modified-Since: Wed, 06 Apr 2023 10:10:24 GMT' https://index.crates.io/em/be/em bedded-hal-nb

and if i want to download it manually with curl -I -L https://crates.io/api/v1/crates/embedded-hal-nb/1.0.0-alpha.2/download --output " file.crates" it works
this is the the header response :

HTTP/2 302
content-length: 0
location: https://static.crates.io/crates/embedded-hal-nb/embedded-hal-nb-1.0.0-alpha.2.crate
server: nginx
date: Thu, 06 Apr 2023 19:45:27 GMT
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
content-security-policy: default-src 'self'; connect-src 'self' *.ingest.sentry.io https://docs.rs https://play.rust-lang.org https://static.crates.io; script-src 'self' 'unsafe-eval' 'sha256-n1+BB7Ckjcal1Pr7QNBh/dKRTtBQsIytFodRiIosXdE='; style-src 'self' 'unsafe-inline' https://code.cdn.mozilla.net; font-src https://code.cdn.mozilla.net; img-src *; object-src 'none'
access-control-allow-origin: *
strict-transport-security: max-age=31536000; includeSubDomains
via: 1.1 vegur, 1.1 68b2682a924ac399aa2724b5b439e75c.cloudfront.net (CloudFront)
vary: Accept,Accept-Encoding,Cookie
x-cache: Miss from cloudfront
x-amz-cf-pop: FRA60-P3
x-amz-cf-id: 7Rm4NYdXf_CsYyOGFkOtbKK-rVQfMGBqQ440A1ooG_FckSgdKQ-lwQ==

HTTP/2 200
x-amz-id-2: 9GhUvs5mmy+E54OoU0TLo+/nqNJ8MSm7sYmdaf8IvrxVHQsWl+jini5A1p3IzxU9JU1ntVe24L/3xhLcJJBUtw==
x-amz-request-id: ZKZ5F71ZSNT7HXFT
x-amz-replication-status: COMPLETED
last-modified: Wed, 05 Apr 2023 07:01:01 GMT
etag: "c5cbb13716f0bdc0c087b62bdcaf23c1"
x-amz-server-side-encryption: AES256
cache-control: public,max-age=31536000,immutable
x-amz-version-id: .TkRCqVJAO7J96siZy1BruUxfMvpXrcE
content-type: application/gzip
server: AmazonS3
x-timer: S1680810328.122891,VS0,VE1
accept-ranges: bytes
date: Thu, 06 Apr 2023 19:45:28 GMT
via: 1.1 varnish
age: 28
x-served-by: cache-fra-eddf8230113-FRA
x-cache: HIT
x-cache-hits: 1

@ChinaHDJ1
Copy link

i was got is that problem too

@Dirbaio
Copy link
Author

Dirbaio commented Apr 8, 2023

I yanked version 0.0.0, it seems it caused that index file to be regenerated, and the issue is gone now.

@weihanglo
Copy link
Member

The issue is discussed here on Zulip.

@ehuss @Turbo87 should we transfer this to rust-lang/crates.io repository?

@Turbo87
Copy link
Member

Turbo87 commented Apr 11, 2023

@weihanglo yes, please! 👍

@weihanglo weihanglo transferred this issue from rust-lang/cargo Apr 11, 2023
@Turbo87 Turbo87 added C-bug 🐞 Category: unintended, undesired behavior A-crates.io-index labels Apr 11, 2023
@Turbo87
Copy link
Member

Turbo87 commented Apr 11, 2023

as a short term fix, we ran a complete sync from the git index to the sparse index. https://index.crates.io/em/be/embedded-hal-nb for me now shows the missing version.

the cause of the issue is described in the Zulip thread that was linked above and still needs a more long-term fix though, so I'll keep this issue open for now.

@Dirbaio
Copy link
Author

Dirbaio commented Apr 11, 2023

@Turbo87 just in case you missed it, I yanked the dummy 0.0.0 version hoping it'd cause the index file to get regenerated and it did, 3 days ago, so it was already "fixed" before the sync. Wanted to point it out in case it had interfered with your troubleshooting. Sorry for interfering, but the missing version was causing some issues.

Thanks guys for all your work btw, crates.io is awesome :)

@Turbo87
Copy link
Member

Turbo87 commented Apr 12, 2023

@Dirbaio oops, I missed that comment 😅

it looks like we had a few more unsynced crates though, so performing this syncing operation was apparently still useful. unfortunately now we have to find a solution to prevent the desync from happening in the first place 🙈

@Turbo87 Turbo87 linked a pull request Apr 21, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

6 participants