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

Error 404 when trying to publish without a token (should be 400) #31

Open
JakkuSakura opened this issue Dec 25, 2021 · 2 comments
Open

Comments

@JakkuSakura
Copy link

I have an empty project through cargo init --lib
Almost everything is following the tutorial

➜  test_rust git:(main) ✗ cargo publish --allow-dirty --verbose --registry ktra
    Updating `ktra` index
     Running `git fetch --force --update-head-ok 'ssh://git@github.com/xxxxxx/ktra-index' '+HEAD:refs/remotes/origin/HEAD'`
warning: manifest has no description, license, license-file, documentation, homepage or repository.
See https://doc.rust-lang.org/cargo/reference/manifest.html#package-metadata for more info.
   Packaging test_rust v0.1.0 (/Users/jack/Dev/new_trading/libraries/test_rust)
   Archiving Cargo.toml
   Archiving Cargo.toml.orig
   Archiving src/lib.rs
   Verifying test_rust v0.1.0 (/Users/jack/Dev/new_trading/libraries/test_rust)
   Compiling test_rust v0.1.0 (/Users/jack/Dev/new_trading/libraries/test_rust/target/package/test_rust-0.1.0)
     Running `rustc --crate-name test_rust --edition=2021 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C split-debuginfo=unpacked -C debuginfo=2 -C metadata=51782412979cedc2 -C extra-filename=-51782412979cedc2 --out-dir /Users/jack/Dev/new_trading/libraries/test_rust/target/package/test_rust-0.1.0/target/debug/deps -C incremental=/Users/jack/Dev/new_trading/libraries/test_rust/target/package/test_rust-0.1.0/target/debug/incremental -L dependency=/Users/jack/Dev/new_trading/libraries/test_rust/target/package/test_rust-0.1.0/target/debug/deps`
    Finished dev [unoptimized + debuginfo] target(s) in 2.74s
   Uploading test_rust v0.1.0 (/Users/jack/Dev/new_trading/libraries/test_rust)
error: failed to publish to registry at http://localhost:8000

Caused by:
  the remote server responded with an error (status 404 Not Found): resource or api is not defined

[registries]
ktra = { index = "ssh://git@github.com/xxxxxxxx/ktra-index" }

I'm not sure why is this happening.

@JakkuSakura
Copy link
Author

Dec 25 17:26:58.943 DEBUG hyper::proto::h1::io: parsed 5 headers
Dec 25 17:26:58.943 DEBUG hyper::proto::h1::conn: incoming body is content-length (965 bytes)
Dec 25 17:26:58.944 DEBUG request{method=PUT path=/api/v1/crates/new version=HTTP/1.1 remote.addr=127.0.0.1:53721}: warp::filters::trace: received request
Dec 25 17:26:58.944  INFO request{method=PUT path=/api/v1/crates/new version=HTTP/1.1 remote.addr=127.0.0.1:53721}: warp::filters::trace: processing request
Dec 25 17:26:58.945  WARN request{method=PUT path=/api/v1/crates/new version=HTTP/1.1 remote.addr=127.0.0.1:53721}: warp::filters::trace: unable to serve request (client error) status=400 error=Rejection([MissingHeader { name: "Authorization" }, MissingHeader { name: "Authorization" }, MissingHeader { name: "Authorization" }, MethodNotAllowed, MethodNotAllowed, MethodNotAllowed, MethodNotAllowed, MethodNotAllowed, MethodNotAllowed, MethodNotAllowed, MethodNotAllowed, MethodNotAllowed])
Dec 25 17:26:58.945 DEBUG hyper::proto::h1::io: flushed 171 bytes

@JakkuSakura
Copy link
Author

It turns out to be that my token is not set properly. But please fix the error message

@gagbo gagbo changed the title Error 404 when publishing package Error 404 when trying to publish without a token (should be 400) Mar 5, 2022
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

No branches or pull requests

1 participant