https://linen.dev logo
Can't login: unable to authorize your request. Is ...
# help
m
Hi, I'm trying to redeploy my app after the upgrade to 0.11.0 but it fails with login. I changed computers since last deployment so there can be an issue with that. I did
cargo shuttle login
which opens the browser to
https://www.shuttle.rs/login
. I click
login with github
, and after that I run
cargo shuttle login --api-key <my key here>
. Running
cargo shuttle deployment list
or
cargo shuttle deploy
fails with:
Copy code
Error: 401 Unauthorized
message: we were unable to authorize your request. Is your key still valid?
Note: I can't directly type my key in the prompt of
cargo shuttle login
since it has a bug and keep "rewriting the prompt". Below is what gets printed to the console when running
cargo shuttle login
Copy code
>  cargo shuttle login |& hexdump -Cv | head -n 20 
00000000  49 66 20 79 6f 75 72 20  62 72 6f 77 73 65 72 20  |If your browser |
00000010  64 69 64 20 6e 6f 74 20  61 75 74 6f 6d 61 74 69  |did not automati|
00000020  63 61 6c 6c 79 20 6f 70  65 6e 2c 20 67 6f 20 74  |cally open, go t|
00000030  6f 20 68 74 74 70 73 3a  2f 2f 73 68 75 74 74 6c  |o https://shuttl|
00000040  65 2e 72 73 2f 6c 6f 67  69 6e 0a 0d 3f 20 41 50  |e.rs/login..? AP|
00000050  49 20 6b 65 79 20 e2 80  ba 20 0d 3f 20 41 50 49  |I key ... .? API|
00000060  20 6b 65 79 20 e2 80 ba  20 0d 3f 20 41 50 49 20  | key ... .? API |
00000070  6b 65 79 20 e2 80 ba 20  0d 3f 20 41 50 49 20 6b  |key ... .? API k|
00000080  65 79 20 e2 80 ba 20 0d  3f 20 41 50 49 20 6b 65  |ey ... .? API ke|
00000090  79 20 e2 80 ba 20 0d 3f  20 41 50 49 20 6b 65 79  |y ... .? API key|
000000a0  20 e2 80 ba 20 0d 3f 20  41 50 49 20 6b 65 79 20  | ... .? API key |
000000b0  e2 80 ba 20 0d 3f 20 41  50 49 20 6b 65 79 20 e2  |... .? API key .|
000000c0  80 ba 20 0d 3f 20 41 50  49 20 6b 65 79 20 e2 80  |.. .? API key ..|
000000d0  ba 20 0d 3f 20 41 50 49  20 6b 65 79 20 e2 80 ba  |. .? API key ...|
000000e0  20 0d 3f 20 41 50 49 20  6b 65 79 20 e2 80 ba 20  | .? API key ... |
k
That is odd. Did you upgrade cargo-shuttle to 0.11 as well?
Could you double-check that your API key is correctly set? You should find it in one of these directories, depending on your OS: , under shuttle/config.toml.
m
Yes, I updated cargo shuttle to 0.11.0 and the api key is set in the config file
cargo-shuttle --version
returns
0.11.0
.
Copy code
> cat ~/.config/shuttle/config.toml                                                            
api_key = '<my api key here>'
k
Did you also do a
project rm
and
project new
? And the login with
--api-key <key>
succeeds, right?
m
yes to all of the above
k
What is your project named?
m
lilyplayer
k
Does project rm and new work, but not deployment commands?
m
let me try again
rm and new command worked. deploy command seems to hang now.
k
Okay, we have had some issues with the deployment logs, maybe that's the case now..
m
okay. I guess there is nothing I can do except wait for now, right?
oohh! After quite some time, the deploy command showed some logs. It printed the following and then stopped
Copy code
2023-02-28T11:17:24.152060707Z  INFO Entering queued state
2023-02-28T11:17:24.152103005Z TRACE shuttle_deployer::deployment::queue: getting a build slot
2023-02-28T11:17:24.158272107Z TRACE {uri="http://gateway:8001/stats/load"} shuttle_deployer::deployment::gateway_client: calling gateway
2023-02-28T11:17:24.158828682Z DEBUG hyper::client::connect::http: connecting to 10.99.48.65:8001
2023-02-28T11:17:24.163609105Z DEBUG hyper::client::connect::http: connected to 10.99.48.65:8001
2023-02-28T11:17:24.164047281Z DEBUG hyper::client::pool: pooling idle connection for ("http", gateway:8001)
2023-02-28T11:17:24.164090472Z TRACE {response="Response { status: 200, version: HTTP/1.1, headers: {\"content-type\": \"application/json\", \"content-length\": \"38\", \"date\": \"Tue, 28 Feb 2023 10:17:23 GMT\"}, body: Body(Streaming) }"} shuttle_deployer::deployment::gateway_client: Load response

2023-02-28T11:17:24.164389303Z  INFO Entering building state
Deployment has not entered the running state
k
Can you do a deployment list and see if it is running?
m
Hi, Yes it is now running and working properly. Thanks!
v
> Deployment has not entered the running state Getting same issue. Here is the output from the cargo shuttle deployment list.
k
You should wait a little bit and see if it reaches running, we have an issue currently where the deployment logs stop before it finishes.
v
cool, I'll wait.
k
Hm, it may be because you started several builds (which should be okay, but I have seen this earlier today). Try doing an
project rm
and
project new
, then deploy once, then wait and see if it gets to running.
v
cool
Ty, now it's up and running :). Great product ❤️
By the way, I was experiencing this issue earlier when I was using tokio-tracing.
thread 'tokio-runtime-worker' panicked at 'Unable to install global subscriber: SetGlobalDefaultError("a global default trace dispatcher has already been set")', /Users/deep/.cargo/registry/src/github.com-1ecc6299db9ec823/tracing-subscriber-0.3.16/src/fmt/mod.rs:517:14
snippet
Copy code
rust
use tracing::Level;
tracing_subscriber::fmt().with_target(true).compact().init();
tracing::info!("server starting... ");
let app = Router::new()
.route("/", get(health_check))
.layer(
    TraceLayer::new_for_http()
     .make_span_with(trace::DefaultMakeSpan::new()
     .level(Level::INFO))
     .on_response(trace::DefaultOnResponse::new()
     .level(Level::INFO)),
)
k
Currently we start the subscriber behind the scenes: , we're thinking of giving the user more control over it, but we haven't started implementing it yet
v
awesome 🙂