https://linen.dev logo
Shuttle 0.13.0 ; rocket; deployment failure "strea...
# help
s
Hello, I got one of my apps to deploy just fine after the 0.12.0 upgrade, but my rocket + dyn_templates + htmx project won't deploy 😦
cargo shuttle deployment list
shows 'completed' (which is an upgrade on 'crashed' which I was getting with 0.11.0, so definitely things moving in the right direction! Can anyone suggest where to go next to debug for myself what is causing my deploy to fail? The last few lines of the log are as follows:
Copy code
2023-03-20T17:50:44.842967128Z DEBUG {service.ready=true} tower::buffer::worker: processing request
2023-03-20T17:50:44.843189276Z  INFO shuttle_deployer::deployment::run: starting service
2023-03-20T17:50:44.846019296Z DEBUG {service.ready=true} tower::buffer::worker: processing request
2023-03-20T17:50:44.849106780Z TRACE shuttle_runtime::alpha: alpha starting
2023-03-20T17:50:44.849114553Z TRACE {service_address="127.0.0.1:18695"} shuttle_runtime::alpha: starting
2023-03-20T17:50:44.849272683Z  INFO {response="StartResponse { success: true }"} shuttle_deployer::deployment::run: start client response: 
2023-03-20T17:50:44.855966225Z DEBUG {response="Some(SubscribeStopResponse { reason: End, message: \"\" })"} shuttle_deployer::deployment::run: stop client response: 

2023-03-20T17:50:44.862757206Z  INFO Entering completed state
2023-03-20T17:50:44.865845513Z  INFO shuttle_deployer::deployment::run: service finished all on its own
2023-03-20T17:50:44.872714965Z DEBUG hyper::proto::h2::server: stream error: error writing a body to connection: send stream capacity unexpectedly closed
The (messy) code is here if anyone wants to take a look: https://github.com/jhawkesworth/jh-hello-htmx/
a
looks like something broke with hyper for some reason
does your rocket app run locally?
s
Yeah I can cargo shuttle run locally.
Seems to be something to do with rocket's FileServer
k
Yeah, I'm not quite sure what the problem is either, but it looks like it's panicking immediately after starting. I'm not sure why it's happening only for deployments though 🤔
s
Thanks for taking a look @kind-area-3810 I did get one deploy to fail with an error from rocket_dyn_templates about the templates folder not being present, but next try with the same code just went back to the panic.
To follow up on this, I started again with a fresh project and rocket's FileServer works just fine, so latest theory is it is some problem caused by mixing the file server with rocket's dynamic templates.
Well the theory remains, rocket_dyn_templates and shuttle don't seem to mix, for me at least. I moved specified a folder called 'templates' so I could avoid having to have a Rocket.toml to specify the template location, and this works fine when I
cargo shuttle run
but deploying to shuttle just dies, same error as I originally reported. If anyone has a few minutes to pull the code and see if they can get it to deploy I'd be super grateful. I've done a
cargo shuttle clean; cargo shuttle project rm; cargo shuttle project new; cargo shuttle deploy
but I'm wondering if once I've crashed a deployment like this, it is leaving a mess behind on shuttle that is breaking future deployments. Is that possible? The code for the fresh project is here: https://github.com/jhawkesworth/jh-rocket-fs
Updated to 0.13.0 but results are almost exactly the same, but now the resources output is populated:
2023-03-27T17:30:56.844427572Z  INFO {response="LoadResponse { success: true, message: \"\", resources: [[123, 34, 116, 121, 112, 101, 34, 58, 34, 115, 116, 97, 116, 105, 99, 102, 111, 108, 100, 101, 114, 34, 44, 34, 99, 111, 110, 102, 105, 103, 34, 58, 123, 34, 102, 111, 108, 100, 101, 114, 34, 58, 34, 116, 101, 109, 112, 108, 97, 116, 101, 115, 34, 125, 44, 34, 100, 97, 116, 97, 34, 58, 34, 47, 111, 112, 116, 47, 115, 104, 117, 116, 116, 108, 101, 47, 115, 104, 117, 116, 116, 108, 101, 45, 115, 116, 111, 114, 97, 103, 101, 47, 106, 104, 45, 114, 111, 99, 107, 101, 116, 45, 102, 115, 47, 116, 101, 109, 112, 108, 97, 116, 101, 115, 34, 125]] }"} shuttle_deployer::deployment::run: loading response
g
For reference, the numbers decode into
{"type":"staticfolder","config":{"folder":"templates"},"data":"/opt/shuttle/shuttle-storage/jh-rocket-fs/templates"}
s
Thanks @gentle-ice-1561 that makes sense, even if it is kinda odd that it hasn't been decoded.
Just in case anyone is tracking this but not the github issue, @kind-area-3810 suggested a change that makes this work - see the github issue for code example until I get round to contributing a full example.