enough-exabyte-92081
05/16/2023, 7:35 PM...
2023-05-16T21:27:44.448632133Z DEBUG hyper::client::connect::http: connecting to 127.0.0.1:18971
2023-05-16T21:27:44.451173177Z DEBUG hyper::client::connect::http: connected to 127.0.0.1:18971
2023-05-16T21:27:44.453423195Z DEBUG {service.ready=true} tower::buffer::worker: processing request
2023-05-16T21:27:44.456117210Z INFO shuttle_deployer::deployment::run: loading project from: /opt/shuttle/shuttle-executables/1861aef5-6744-4fee-bbc2-958b0ec05057
2023-05-16T21:27:44.458121686Z DEBUG shuttle_deployer::deployment::run: loading service
2023-05-16T21:27:44.460324723Z DEBUG {service.ready=true} tower::buffer::worker: processing request
Deployment has not entered the running state
And this is my code:
rust
#[shuttle_runtime::main]
async fn actix_web(
#[shuttle_shared_db::Postgres] pool: sqlx::PgPool,
#[shuttle_secrets::Secrets] secret_store: shuttle_secrets::SecretStore,
#[shuttle_static_folder::StaticFolder(folder = "templates")] static_folder: std::path::PathBuf,
) -> ShuttleActixWeb<impl FnOnce(&mut ServiceConfig) + Send + Clone + 'static> {
pool.execute("CREATE EXTENSION IF NOT EXISTS pgcrypto")
.await
.context("cannot create required extension")?;
sqlx::migrate!()
.run(&pool)
.await
.context("cannot generate migrations")?;
let secret = secret_store
.get("COOKIE_SECRET")
.context("secret was not found")?;
........
I see logs for the extension, but no for the migration. However there are no errors.
Any idea why it's failing?agreeable-painting-48846
05/16/2023, 7:43 PMenough-oil-62271
05/16/2023, 7:49 PMcargo shuttle logs <ID>
? Sometimes the normal deployment log omits the last error(s) if the deployment crashes too earlyenough-exabyte-92081
05/16/2023, 7:52 PMagreeable-painting-48846
05/16/2023, 7:53 PMenough-exabyte-92081
05/16/2023, 7:54 PMcargo shuttle logs --latest
https://cdn.discordapp.com/attachments/1108115647944204398/1108120248147787796/message.txtenough-oil-62271
05/16/2023, 7:58 PMagreeable-painting-48846
05/16/2023, 7:58 PMenough-exabyte-92081
05/16/2023, 8:00 PMenough-oil-62271
05/16/2023, 8:00 PMenough-exabyte-92081
05/16/2023, 8:00 PMenough-exabyte-92081
05/16/2023, 8:00 PMenough-exabyte-92081
05/16/2023, 8:02 PMagreeable-painting-48846
05/16/2023, 8:02 PMenough-exabyte-92081
05/16/2023, 8:04 PMenough-exabyte-92081
05/16/2023, 8:05 PMenough-exabyte-92081
05/16/2023, 8:06 PM$ cargo shuttle deploy --no-test
2023-05-16T19:01:09.564362Z ERROR cargo_shuttle::client: failed to connect to websocket
Error: could not connect to websocket
Caused by:
HTTP error: 502 Bad Gateway
enough-exabyte-92081
05/16/2023, 8:06 PM$ cargo shuttle resource list
Error: 503 Service Unavailable
message: project not ready
agreeable-painting-48846
05/16/2023, 8:08 PMcargo shuttle project restart
then deploying againagreeable-painting-48846
05/16/2023, 8:11 PMenough-exabyte-92081
05/16/2023, 8:13 PM2023-05-16T22:13:11.278867497Z INFO Entering built state
2023-05-16T22:13:11.279072116Z INFO Entering loading state
2023-05-16T22:13:11.283850000Z TRACE shuttle_deployer::runtime_manager: making new client
2023-05-16T22:13:11.288727800Z DEBUG shuttle_deployer::runtime_manager: Starting alpha runtime at: /opt/shuttle/shuttle-executables/913f1697-5860-4f33-93ce-6fb1444a7f4b
2023-05-16T22:13:13.291955002Z INFO shuttle_proto::runtime: connecting runtime client
2023-05-16T22:13:13.292057553Z DEBUG hyper::client::connect::http: connecting to 127.0.0.1:16185
2023-05-16T22:13:13.294768443Z DEBUG hyper::client::connect::http: connected to 127.0.0.1:16185
2023-05-16T22:13:13.297126122Z DEBUG {service.ready=true} tower::buffer::worker: processing request
2023-05-16T22:13:13.300472354Z INFO shuttle_deployer::deployment::run: loading project from: /opt/shuttle/shuttle-executables/913f1697-5860-4f33-93ce-6fb1444a7f4b
2023-05-16T22:13:13.302298615Z DEBUG shuttle_deployer::deployment::run: loading service
2023-05-16T22:13:13.305248279Z DEBUG {service.ready=true} tower::buffer::worker: processing request
Deployment has not entered the running state
agreeable-painting-48846
05/16/2023, 8:14 PMenough-exabyte-92081
05/16/2023, 8:14 PMagreeable-painting-48846
05/16/2023, 8:14 PMenough-exabyte-92081
05/16/2023, 8:23 PMrust
pool.execute("CREATE EXTENSION IF NOT EXISTS pgcrypto")
.await
.context("cannot create required extension")?;
sqlx::migrate!()
.run(&pool)
.await
.context("cannot generate migrations")?;
let secret = secret_store
.get("COOKIE_SECRET")
.context("secret was not found")?;
TEMPLATES
.set({
let mut tera = tera::Tera::new(
(static_folder
.to_str()
.context("cannot get static folder")?
.to_string()
+ "/**/*")
.as_str(),
)
.context("Parsing error while loading template folder")?;
tera.autoescape_on(vec!["j2"]);
tera
})
.map_err(|x| anyhow::anyhow!("tera instance couldn't initialize due to: {:?}", x))?;
enough-exabyte-92081
05/16/2023, 8:24 PM2023-05-16T22:22:51.894760521Z TRACE {folder="\"templates\""} shuttle_static_folder: building static folder
2023-05-16T22:22:51.894777190Z TRACE {input_directory="\"/opt/shuttle/shuttle-builds/realworld-fullstack/templates\""} shuttle_static_folder: got input directory
2023-05-16T22:22:51.894790401Z TRACE {output_directory="\"/opt/shuttle/shuttle-storage/realworld-fullstack\""} shuttle_static_folder: got output directory
2023-05-16T22:22:51.895555882Z INFO sqlx::postgres::notice: extension "pgcrypto" already exists, skipping
2023-05-16T22:22:51.895612181Z INFO sqlx::query: CREATE EXTENSION IF NOT โฆ; rows affected: 0, rows returned: 0, elapsed: 290.666ยตs
CREATE EXTENSION IF NOT EXISTS pgcrypto
2023-05-16T22:22:51.899610964Z INFO sqlx::query: SELECT current_database(); rows affected: 0, rows returned: 1, elapsed: 462.719ยตs
enough-exabyte-92081
05/16/2023, 8:24 PMenough-exabyte-92081
05/16/2023, 8:26 PM2023-05-16T22:22:51.862386488Z INFO shuttle_deployer::deployment::run: loading project from: /opt/shuttle/shuttle-executables/7b86e1c8-ac62-45d9-b398-4838ec632915
2023-05-16T22:22:51.865066320Z DEBUG shuttle_deployer::deployment::run: loading service
2023-05-16T22:22:51.868077630Z DEBUG {service.ready=true} tower::buffer::worker: processing request
Deployment has not entered the running state
enough-exabyte-92081
05/16/2023, 8:26 PMenough-exabyte-92081
05/16/2023, 8:28 PMcargo shuttle run
works flawlesslyagreeable-painting-48846
05/16/2023, 8:29 PMagreeable-painting-48846
05/16/2023, 8:29 PMenough-exabyte-92081
05/16/2023, 8:32 PMSecrets.toml
enough-exabyte-92081
05/16/2023, 8:47 PMready
and all the deployments as loading
๐ฆagreeable-painting-48846
05/16/2023, 8:50 PMenough-exabyte-92081
05/16/2023, 8:57 PMenough-exabyte-92081
05/16/2023, 8:58 PMagreeable-painting-48846
05/16/2023, 9:00 PMagreeable-painting-48846
05/16/2023, 9:00 PMenough-exabyte-92081
05/16/2023, 9:04 PM2023-05-16T23:03:01.036393043Z INFO sqlx::query: SELECT current_database(); rows affected: 0, rows returned: 1, elapsed: 475.652ยตs
Same situation, but this time that statement is not executedagreeable-painting-48846
05/16/2023, 9:09 PMagreeable-painting-48846
05/16/2023, 9:09 PMenough-exabyte-92081
05/16/2023, 9:12 PMagreeable-painting-48846
05/16/2023, 9:39 PMagreeable-painting-48846
05/16/2023, 9:40 PMcargo shuttle resource list
to get your prod db then going into that db and then just dropping all the tables?agreeable-painting-48846
05/16/2023, 9:41 PMenough-exabyte-92081
05/16/2023, 9:42 PMenough-exabyte-92081
05/16/2023, 9:44 PMpsql: error: connection to server at "db.shuttle.rs" (3.8.64.23), port 5432 failed: FATAL: password authentication failed for user "user-realworld-fullstack"
agreeable-painting-48846
05/16/2023, 9:49 PMenough-exabyte-92081
05/16/2023, 9:49 PMagreeable-painting-48846
05/16/2023, 9:49 PMstocky-kangaroo-53672
05/17/2023, 8:54 AMcargo shuttle deployment list
?enough-exabyte-92081
05/17/2023, 10:24 AMโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโค
โ 0c6a9ed8-c544-4c71-966f-3b99ac1f605a โ crashed โ 2023-05-16T19:26:43Z โ
โ 1861aef5-6744-4fee-bbc2-958b0ec05057 โ stopped โ 2023-05-16T19:27:42Z โ
โ b60b2b11-03df-4b94-b35d-6e5ac9c196c7 โ stopped โ 2023-05-16T19:38:16Z โ
โ 4725ea77-3f5e-4f94-aeed-0f3aeff07d60 โ stopped โ 2023-05-16T19:48:49Z โ
โ 913f1697-5860-4f33-93ce-6fb1444a7f4b โ stopped โ 2023-05-16T20:13:11Z โ
โ 7b86e1c8-ac62-45d9-b398-4838ec632915 โ stopped โ 2023-05-16T20:22:49Z โ
โ 9d4cb67e-a7f3-4826-9376-b5ab82ddcbfe โ stopped โ 2023-05-16T20:37:58Z โ
โ c166c2a7-8e91-46eb-8d81-0295c9e9c750 โ stopped โ 2023-05-16T20:39:16Z โ
โ 38888e14-c2c3-451c-916d-d955a50556c3 โ stopped โ 2023-05-16T20:45:43Z โ
โ eee4cb56-6713-4ddc-9be2-60383ab90dcf โ stopped โ 2023-05-16T21:11:23Z โ
โ 509966e9-f9c1-42ca-8da5-fed0214cbe32 โ crashed โ 2023-05-16T21:14:11Z โ
enough-exabyte-92081
05/17/2023, 10:25 AMenough-exabyte-92081
05/17/2023, 10:26 AM2023-05-16T23:14:11.076206555Z ERROR {error="Custom error: cannot generate migrations"} shuttle_runtime::alpha: loading service failed
2023-05-16T23:14:11.077034930Z INFO {success="false"} shuttle_deployer::deployment::run: loading response
2023-05-16T23:14:11.088616431Z ERROR {error="Custom error: cannot generate migrations"} shuttle_deployer::deployment::run: failed to load service
2023-05-16T23:14:11.093997745Z INFO Entering crashed state
2023-05-16T23:14:11.099931008Z ERROR {error="Load error: Custom error: cannot generate migrations"} shuttle_deployer::deployment::run: service startup encountered an error
enough-exabyte-92081
05/17/2023, 10:26 AM2023-05-16T23:14:11.074085858Z WARN sqlx::query: SELECT pg_advisory_lock($1); rows affected: 1, rows returned: 1, elapsed: 670.038s
enough-exabyte-92081
05/17/2023, 10:28 AMenough-oil-62271
05/17/2023, 12:17 PMenough-oil-62271
05/17/2023, 12:18 PM./migrations
folder?enough-exabyte-92081
05/17/2023, 12:18 PMenough-exabyte-92081
05/17/2023, 12:19 PMcargo shuttle run
works without issuesenough-oil-62271
05/17/2023, 12:33 PMenough-exabyte-92081
05/17/2023, 12:35 PMenough-exabyte-92081
05/17/2023, 12:40 PMenough-oil-62271
05/17/2023, 1:09 PMCREATE INDEX
on your migration? creating tables works, I know that much, but perhaps there's something missing to create an index for some reason?enough-exabyte-92081
05/17/2023, 3:51 PM2023-05-16T23:14:11.074715753Z INFO sqlx::query: CREATE TABLE IF NOT โฆ; rows affected: 0, rows returned: 0, elapsed: 458.742ยตs
CREATE TABLE IF NOT EXISTS _sqlx_migrations (
version BIGINT PRIMARY KEY,
description TEXT NOT NULL,
installed_on TIMESTAMPTZ NOT NULL DEFAULT now(),
success BOOLEAN NOT NULL,
checksum BYTEA NOT NULL,
execution_time BIGINT NOT NULL
);
2023-05-16T23:14:11.075703932Z INFO sqlx::query: SELECT version FROM _sqlx_migrations โฆ; rows affected: 0, rows returned: 0, elapsed: 928.954ยตs
SELECT
version
FROM
_sqlx_migrations
WHERE
success = false
ORDER BY
version
LIMIT
1
2023-05-16T23:14:11.076141020Z INFO sqlx::query: SELECT version, checksum FROM โฆ; rows affected: 1, rows returned: 1, elapsed: 398.516ยตs
SELECT
version,
checksum
FROM
_sqlx_migrations
ORDER BY
version
enough-exabyte-92081
05/17/2023, 3:53 PMCREATE TABLE IF NOT EXISTS Users ...
stocky-kangaroo-53672
05/18/2023, 10:58 AMstocky-kangaroo-53672
05/18/2023, 11:00 AMenough-exabyte-92081
05/18/2023, 4:44 PMenough-exabyte-92081
05/18/2023, 4:44 PMstocky-kangaroo-53672
05/19/2023, 12:24 PM.ignore
) to get the correct password. Then connect to it and fix the migrations table?enough-exabyte-92081
05/19/2023, 2:23 PMstocky-kangaroo-53672
05/19/2023, 2:25 PMenough-exabyte-92081
05/19/2023, 2:25 PMenough-exabyte-92081
05/19/2023, 2:26 PMgentle-ice-1561
05/20/2023, 12:25 PM