https://linen.dev logo
Failed to parse response to json
# help
k
i got this when trying to deploy, any idea what's up with that?
Copy code
Error: failed to parse response to JSON

Caused by:
    expected value at line 1 column 1
Originally posted by @jolly-gigabyte-1004 in shuttle-general
Hey! Woops, that's not a very helpful error message šŸ˜„ Are you trying to deploy an example? Please try running the deploy again with
RUST_LOG="cargo_shuttle=trace" cargo shuttle deploy
, there should be a trace output showing what response it failed to parse to json.
j
Copy code
āÆ RUST_LOG="cargo_shuttle=trace" cargo shuttle deploy
2022-10-29T14:56:15.699319Z TRACE cargo_shuttle: running local client
2022-10-29T14:56:15.699331Z TRACE cargo_shuttle: loading project arguments: ProjectArgs { working_directory: "/home/jack/git/bolts/api/ai", name: None }
2022-10-29T14:56:15.699342Z TRACE cargo_shuttle::config: using crate name as project name
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 ai v0.1.0 (/home/jack/git/bolts/api/ai)
   Archiving .cargo_vcs_info.json
   Archiving .gitignore
   Archiving Cargo.toml
   Archiving Cargo.toml.orig
   Archiving src/lib.rs
2022-10-29T14:56:27.039149Z TRACE cargo_shuttle::client: parsing response to json response="<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"
2022-10-29T14:56:27.039165Z TRACE cargo_shuttle::client: parsing response to common error
Error: failed to parse response to JSON

Caused by:
    expected value at line 1 column 1
I'm trying to run a barely modified rocket project
k
What is the output of
cargo shuttle project status
?
j
Copy code
RUST_LOG="cargo_shuttle=trace" cargo shuttle project status
2022-10-29T18:05:08.859592Z TRACE cargo_shuttle: running local client
2022-10-29T18:05:08.859607Z TRACE cargo_shuttle: loading project arguments: ProjectArgs { working_directory: "/home/jack/git/bolts/api/ai", name: None }
2022-10-29T18:05:08.859617Z TRACE cargo_shuttle::config: using crate name as project name
2022-10-29T18:05:17.479580Z TRACE cargo_shuttle::client: parsing response to json response="<html>\r\n<head><title>502 Bad Gateway</title></head>\r\n<body>\r\n<center><h1>502 Bad Gateway</h1></center>\r\n</body>\r\n</html>\r\n"
2022-10-29T18:05:17.479603Z TRACE cargo_shuttle::client: parsing response to common error
Error: failed to parse response to JSON

Caused by:
    expected value at line 1 column 1
k
Try
cargo shuttle project rm
and then
cargo shuttle project new
Also what is your version of
cargo-shuttle
? Run
cargo install --list
to check
And just to double-check, did you run
cargo shuttle login
?
j
both of those commands throw the same error, I was already logged in but I tried logging in again with no change.
cargo install --list
output is below:
Copy code
āÆ cargo install --list
cargo-shuttle v0.7.1:
    cargo-shuttle
paru v1.11.0:
    paru
just noticed 0.7.2 is out, gonna try that
alright still getting the same output on cargo-shuttle 0.7.2
k
What is the name of your project?
j
Probably just ai, does it need to be unique?
k
Yeah, but you should get a proper error for that. There does seem to be something wrong with using "ai" as a name currently, though. Would you mind trying to redeploy with a different name? You can either change your package name in Cargo.toml, or create a Shuttle.toml file in the project root with
name = "dizee-app"
.
Then you'd need to do
cargo shuttle project new
,
cargo shuttle project status
to check that it is ready, and then
cargo shuttle deploy
.
j
changed the package name to something a little more unique and managed to get it to deploy with no issues
k
Great! We'll try to make sure you get a better error next time šŸ˜„