Service stuck loading indefinetily
# help
i
Hey I've been trying to migrate a bot I've made over to shuttle. It uses poise, and axum. Yesterday it seemed to have worked fine, although I just changed the way migrations are applied from just executing the contents of a schema.sql file to using the sqlx migration macro, although I am not sure this has anything to do with this. Currently it's stuck on a loading state indefinitely with the last logs being:
Copy code
2023-05-28T12:32:08.415508031Z  INFO Entering loading state
2023-05-28T12:32:08.420443815Z TRACE shuttle_deployer::runtime_manager: making new client
2023-05-28T12:32:08.425105327Z DEBUG shuttle_deployer::runtime_manager: Starting alpha runtime at: /opt/shuttle/shuttle-executables/d3ea025d-fe4e-4972-a4b4-f0fe6d261912
2023-05-28T12:32:10.428831483Z  INFO shuttle_proto::runtime: connecting runtime client
2023-05-28T12:32:10.428925119Z DEBUG hyper::client::connect::http: connecting to 127.0.0.1:19498
2023-05-28T12:32:10.431664770Z DEBUG hyper::client::connect::http: connected to 127.0.0.1:19498
2023-05-28T12:32:10.434448027Z DEBUG {service.ready=true} tower::buffer::worker: processing request
2023-05-28T12:32:10.437625123Z  INFO shuttle_deployer::deployment::run: loading project from: /opt/shuttle/shuttle-executables/d3ea025d-fe4e-4972-a4b4-f0fe6d261912
2023-05-28T12:32:10.441717466Z DEBUG shuttle_deployer::deployment::run: loading service
In case it does matter, the way migrations were run were changed from this:
Copy code
rust
  db.execute(include_str!("../schema.sql")).await.unwrap();
to this:
Copy code
rust
static MIGRATOR: sqlx::migrate::Migrator = sqlx::migrate!();
#[shuttle_runtime::main]
async fn init(
    #[shuttle_shared_db::Postgres]
    db: sqlx::PgPool,
    #[shuttle_secrets::Secrets] secrets: shuttle_secrets::SecretStore,
) -> Result<CustomService, shuttle_runtime::Error> {
  ...
          MIGRATOR
            .run(&db)
            .await
            .map_err(|e| CustomError::new(e).context("Failed to apply migrations"))?;
  ...
 }
The deployment id is d3ea025d-fe4e-4972-a4b4-f0fe6d261912 I previously tried to stop the deployment and start a new one in hopes of fixing it, I believe the id for that is: 37d8ddee-bfa5-4d5c-9f5d-99ff227d49fb
Rust version: 1.69.0 OS: EndeavourOS running kernel 6.3.4-zen1-1-zen
attempting it again, it just crashes due to being unable to apply migrations. I have no idea why it got stuck before, although I guess the issue no longer exists.
Nevermind.
also it works fine locally so I am not even sure where to start trying to understand what's wrong.
Although reverting the way migrations were executed seems to make it work fine, so I guess it's just that sqlx migrations don't play nice