https://linen.dev logo
{error="Run error: Custom error: failed to provisi...
# help
s
Hello, I'm having a bumpy start to my second shuttle project and can't get it to deploy. I used template rocket and just added the static folder, but I couldn't get past the following error when I tried a cargo shuttle run: jon@pop-os:~/CLionProjects/jh-hello-htmx$ cargo shuttle run Building /home/jon/CLionProjects/jh-hello-htmx Error: the version of
shuttle-service
specified as a dependency to this service (^0.9.0) is not supported by this project instance (0.8.0); try updating
shuttle-service
to '0.8.0' or update the project instance using
cargo shuttle project rm
and
cargo shuttle project new
I tried setting shuttle-service to 0.8.0 in my Cargo.toml but pretty sure shuttle-static-folder only arrived in 0.9.0 and iirc I still hit same error. so I compared with my (functioning) other project and noticed the return type is different This - based on the template - async fn rocket(#[shuttle_static_folder::StaticFolder(folder = "templates")] _static_folder: PathBuf) -> shuttle_service::ShuttleRocket { But I had this in the functioning project - async fn rocket(#[shuttle_static_folder::StaticFolder(folder = "templates")] _static_folder: PathBuf) -> Result<Rocket, shuttle_service::Error> { So I changed return to Result<Rocket, shuttle_service::Error> and was able to get cargo shuttle deploy --allow-dirty to 'do stuff' after doing the shuttle project new / shuttle project rm dance a couple of times The build phase of the project seemed to complete, but the deployment crashed. cargo shuttle logs 1f4d0235-de99-4345-bf49-d014cf1d86b4 2023-02-08T08:41:48.572798562Z ERROR {error="Run error: Custom error: failed to provision shuttle_static_folder :: StaticFolder"} shuttle_deployer::deployment::run: service startup encountered an error Just in case it was a one-off I tried again, having specified a folder name this time (I'll paste the full code below)... but the result was the same.
So I'm guessing that.. 1. either a/ the rocket template needs updating to default to the Result<Rocket, shuttle_service::Error> return type or b/ shuttle-service needs some kind of tweak. If a/ is the right thing to do, I'd be happy to try and create a PR for that, but wouldn't know where to start if the right thing to do is b/ 2. Also there is maybe a permissions error or out of disk space on the shuttle host (at least I hope its something this goofy)? Details below in case anyone wants to try to reproduce. Thanks for reading! $ rustc --version rustc 1.67.0 (fc594f156 2023-01-24) OS: pop-os $ uname -a Linux pop-os 5.19.0-76051900-generic #202207312230~1663791054~22.04~28340d4 SMP PREEMPT_DYNAMIC Wed S x86_64 x86_64 x86_64 GNU/Linux Cargo.toml -> [package] name = "jh-hello-htmx" version = "0.1.0" edition = "2021" publish = false [lib] [dependencies] shuttle-service = { version = "0.9.0", features = ["web-rocket"] } rocket = "0.5.0-rc.2" shuttle-static-folder = "0.9.0" lib.rs -> #[macro_use] extern crate rocket; use std::path::PathBuf; use rocket::{Build, Rocket}; #[get("/")] fn index() -> &'static str { "Hello, world!" } #[shuttle_service::main] //async fn rocket(#[shuttle_static_folder::StaticFolder(folder = "templates")] _static_folder: PathBuf) -> shuttle_service::ShuttleRocket { async fn rocket(#[shuttle_static_folder::StaticFolder(folder = "templates")] _static_folder: PathBuf) -> Result<Rocket, shuttle_service::Error> { let rocket = rocket::build().mount("/hello", routes![index]); Ok(rocket) }
k
Hey! By the way, on discord you can write code blocks with triple backticks, and get highlighting by adding the language after the opening three ticks: \```rust \``` (escaped to demonstrate)
Could it be you are running into this issue as well?
s
Thanks for this, yeah it is pretty much the same issue, although in my case its more a 'running before walking' issue. Turns out the templates dir didn't exist locally and of course git doesn't much care for dirs without contents, so I had to put something in there so I could git add the template dir.
36 Views