https://linen.dev logo
tokio-runtime-worker panicked
# help
q
Hello everyone, i am trying to build a discord bot on windows 11. when i try to run the application with
cargo shuttle run
it throws the error seen in the picture. I do not know why my application panicked. I used this blog as a tutorial: https://www.shuttle.rs/blog/2022/09/14/serentity-discord-bot
g
Which version of Tokio? I believe shuttle is not yet compatible with the latest Tokio, so I use
tokio = "1"
so that my project can use the same version as shuttle.
q
do you put this into your cargo.toml? cause i do not have anything for tokio in there
This is the basic cargo.toml that cargo shuttle init --serenity created
k
We have some bugs with local runs on windows unfortunately, but this user had the same error and found a work-around:
q
i tried running cargo +1.65 install cargo-shuttle --force but get this error
k
Try
rustup install 1.65
first. Or install with `cargo-binstall`/the binary distribution in our gh release, that is compiled with 1.65
q
now i get this beauty of an error message xD
I used cargo +1.65 install cargo-shuttle --force then cargo +1.65 build and then cargo +1.65 shuttle run
k
It looks like it errors in main, do you have a discord token set in a Secrets.toml file?
Oh, I see from the code that that should return a clear error...
a
typically if this happens, I think it means something's panicked but it doesn't pass anything because it doesn't know what broke
I've had this error happen quite a bit over previous local runs (in the past) and in the past I'd have just attempted a deploy, check the logs and see what it panicked at but it's a bit more difficult to do so on a local run
q
Okay that sounds bad… what would you recommend that i should do now? What you said in your last message? So deploying and trying to find out why it panicked?
a
It's not a silver bullet but it'll leave a stacktrace up until it panics/breaks, which is good for us because it means we can diagnose why it broke by just following the deployment logs (by using
cargo shuttle logs <deployment-id>
)
I'm not really sure why it just leaves "custom error" with no actual error message - this will probably need to get looked into at some point
q
yeah that is pretty weird
i‘ll keep you guys updated on my progress
This is the error in the logs when i deploy the bot
Don't know why it didnt show that when i used cargo shuttle run
fixed it works now
thx for your help
moved the Secrets.toml to the top level directory of my application
a
Hmm, maybe this could be a footnote to add to docs? If it's not clear that the secrets file needs to be added at the
Cargo.toml
level then we could probably make a quick PR to add it in
q
Sounds like a plan
a
I'll action that at some point today and open an issue wrt panicking while running in local deployment not actually returning anything useful
2 Views