Troubleshooting: 'I Can Publish, But Not Download'

One situation you can find yourself in is that you can publish crates, but not depend on them.

Publishing goes great, the .crate file gets uploaded to the server, and everything seems like it's finally in place.

But then you add the crate you published as a dependency in a second crate:

# Cargo.toml

my-first-publish = { version = "*", registry = "shipyard-rs" }

...and it all falls apart:

$ cargo check
  Updating `shipyard-rs` index
error: failed to download from ``

Caused by:
failed to get 200 response from ``, got 403

The problem is likely created by not configuring cargo to send an auth token via the "user-agent" header (see Temporary Fix).

Once you configure cargo to send a auth token via the "user-agent" header:

# ~/.cargo/config.toml
# or
# ~/path/to/crate/.cargo/config.toml

user-agent = "shipyard sdk4fXksTjf2247example=" should work:

$ cargo check
Downloaded my-first-publish v0.1.0 (registry `shipyard-rs`)
Downloaded 1 crate (811 B) in 0.53s
  Checking my-first-publish v0.1.0 (registry `shipyard-rs`)
  Checking dep-test v0.1.0 (/home/jstrong/src/dep-test)
  Finished dev [unoptimized + debuginfo] target(s) in 0.65s

In the future, the config.json file in the crate index will specify auth-required as true, cargo will send the auth token for you without any fuss, and this problem will cease to exist (see Pending Improvements).