https://linen.dev logo
deploying app doesn't seem to be working, neither ...
# help
n
When I use
Copy code
cargo shuttle run
I get no errors, but the server doesn't seem to stay up. The line says starting on the port, but the terminal just finishes the task right after it starts. When deploying I get this one and it just ends
w
Hey @numerous-crayon-81771 ! Could you share your main function and
Cargo.toml
please?
n
Copy code
rs
#[shuttle_service::main]
async fn serenity(
    #[shuttle_secrets::Secrets] secret_store: SecretStore,
) -> shuttle_service::ShuttleSerenity {
    // Get the discord token set in `Secrets.toml`
    let token = if let Some(token) = secret_store.get("DISCORD_TOKEN") {
        token
    } else {
        return Err(anyhow!("'DISCORD_TOKEN' was not found").into());
    };

    // Set gateway intents, which decides what events the bot will be notified about
    let intents = GatewayIntents::GUILD_MESSAGES | GatewayIntents::MESSAGE_CONTENT;

    let client = Client::builder(&token, intents)
        .event_handler(Bot)
        .await
        .expect("Err creating client");

    Ok(client)
}
i believe this is the main function ```toml [package] name = "stardust" version = "0.1.0" edition = "2021" publish = false [lib] [dependencies] shuttle-service = { version = "0.7.2", features = ["bot-serenity"] } anyhow = "1.0.66" serenity = { version = "0.11.5", default-features = false, features = ["client", "gateway", "rustls_backend", "model"] } shuttle-secrets = "0.7.2" tracing = "0.1.37" ```this is the cargo
s
Hmm, do you see any errors in the logs? To get the deployment id:
Copy code
cargo shuttle deployment list
To view the logs of a crashed deployment:
Copy code
cargo shuttle logs <id>
Also, which OS was the local run on?
n
I guess the service is down right now so I can't exactly check but this is being run on windows 11
w
This message refers to your service being unavailable, not shuttle. Although we should make this clearer to the user (pining @kind-area-3810 )
n
Oh, I'll try again when i get home
k
Yeah, it looks like there is an issue with your container (created with
cargo shuttle project new
). You can try
cargo shuttle project status
to see its current status, and you can try
cargo shuttle project rm
, check status until it is destroyed, and then
cargo shuttle project new
to remake it.
n
I tried that yesterday but it was still producing the same issue, though I will try again when I get home
well that didn't seem to fix it 😔
realized i destroyed the project and didn't re-create it
s
Were you able to view the logs for the last crash?
n
yes, this is what I got
Copy code
bash
2022-11-29T19:59:04.849487132Z ERROR serenity::gateway::shard: [Shard [0, 1]] Disallowed gateway intents have been provided.
2022-11-29T19:59:04.849494786Z ERROR serenity::client::bridge::gateway::shard_runner: Shard handler received err: Gateway(DisallowedGatewayIntents)
2022-11-29T19:59:04.849504185Z DEBUG serenity::client::bridge::gateway::shard_queuer: [ShardRunner [0, 1]] Stopping
2022-11-29T19:59:04.849588300Z  INFO serenity::client::bridge::gateway::shard_manager: Shutting down all shards
2022-11-29T19:59:04.849592612Z  INFO serenity::client::bridge::gateway::shard_manager: Shutting down shard 0
2022-11-29T19:59:04.849605077Z DEBUG serenity::client::bridge::gateway::shard_queuer: [Shard Queuer] Received to shutdown shard 0 with 1000.
2022-11-29T19:59:04.849609036Z  INFO serenity::client::bridge::gateway::shard_queuer: Shutting down shard 0
2022-11-29T19:59:04.849611898Z  WARN serenity::client::bridge::gateway::shard_queuer: Failed to cleanly shutdown shard 0 when sending message to shard runner: TrySendError { kind: Disconnected }
2022-11-29T19:59:09.850057304Z  WARN serenity::client::bridge::gateway::shard_manager: Failed to cleanly shutdown shard 0, reached timeout: Elapsed(())
2022-11-29T19:59:09.850155446Z DEBUG serenity::client::bridge::gateway::shard_queuer: [Shard Queuer] Received to shutdown.
2022-11-29T19:59:09.850236286Z DEBUG {frame="GoAway { error_code: NO_ERROR, last_stream_id: StreamId(0) }"} h2::codec::framed_write: send
2022-11-29T19:59:09.850256275Z DEBUG {error="GoAway(b\"\", NO_ERROR, Library)"} h2::proto::connection: Connection::poll; connection error
2022-11-29T19:59:09.850325637Z DEBUG rustls::conn: Sending warning alert CloseNotify

2022-11-29T19:59:09.850534277Z  INFO Entering crashed state
2022-11-29T19:59:09.868335433Z ERROR {error="Custom error: failed to bind service"} shuttle_deployer::deployment::run: service encountered an error
the error parts^ (the entire log is in the file)
oh
i fixed the error by ***actually giving my bot the intents***™️
created a new project
seems to be working fine 😳
k
Nice! 🥳