Scale to Zero: ELIFECYCLE Command failed.
Just tried out the new Scale to Zero feature, appears to work well but upon sleeping the app logged
ELIFECYCLE Command failed.
which showed the deploy as crashed.23 Replies
Project ID:
11bc459c-c00e-41c9-b774-5feb910b2982
11bc459c-c00e-41c9-b774-5feb910b2982
Hmm. What kind of application?
Websocket server using ws
You can checkout the code here https://github.com/dayblox/plot
GitHub
GitHub - dayblox/plot: WebSocket chatrooms server
WebSocket chatrooms server. Contribute to dayblox/plot development by creating an account on GitHub.
(It is a template which you should be able to deploy and test)
Hmm. I wonder if it expects you to terminate the streams gracefully (aka handle the kill) or it errors?
Maybe, I'll try things out tomorrow, it's late
I'll keep you updated
Thanks for your time!
Of course and please do! This is why it's PB; there might be stuff like this that we can fix 😄
Happy to contribute 👌
Hey, thanks for reporting this @Dayblox. I'll try to reproduce the issue. It is interesting that it sleeps correctly but then crashes on start.
The sleep and awake code are just stop and start commands without any severe signals like sigkill so the container does have time to shut down. It seems to be some issue related to node_modules maybe from what I've searched so far.
spun up a test app, after 30 minutes the sigterm signal was sent and the app was given 3 seconds before being force killed, same thing happens when a container is removed because a new deployment went live, restarts also get a sigterm, but they get 15 seconds to clean up before being force killed
I can reproduce this locally so that's good. I've noticed even just restarting the container (no application sleep code) causes it to crash on next boot.
The reason the dashboard is showing container crashed is because when the sleep code stops the container it exits with a non-zero exit code. I think the sleep code shouldn't trigger this reaction on the dashboard though because when you receive traffic, the container will be started like normal so it's basically just a docker event that shouldn't have been shown. I'll fix that but just know everything was still working, the UI was just confusing.
btw, I think the plot code should also handle termination signals better. For example, when I just run the application without any docker container it exits with a non-zero exit code. I also get the
ELIFECYCLE Command failed.
error.
Agreed on both counts!
My code should handle graceful termination and the dashboard should not show a crashed state in the case of Scale to Zero error codes
Thanks again for the reactivity and hard work 👌
Just realized you said you would fix it, cool!
Solution
I'll have the fix merged on Monday 🙂
How do I mark the topic as solved in here?
Oh just saw the option
for future reference, open the context menu for the message you'd like to mark as the solution -> apps -> mark solution
Is there a way for us to see and follow the issues?
mig will probably just come back here and tell us what's up
I got a PR up for it. Will be merging it today and i'll report back here
He merged it 30 minutes ago
(If y’all wanna check)
I'll check later today, thanks!
It's working fine now, thanks @Mig !
great! thanks for reporting this, very valid feedback that improved the product 🙂