This repository has been archived by the owner on Jan 8, 2024. It is now read-only.
[Entrypoint] Exit Code 2 even when it shouldn't #4664
Labels
bug
Something isn't working
entrypoint
Things related to the entrypoint binary run inside a deployment
jira
Will add an Issue to Jira
Describe the bug
Note: There is also a discussion thread about this topic.
We are noticing an issue with the waypoint-entrypoint where it always exits with an exit code 2 and does not seem to be propagating the SIGTERM to the process that it is executing. This surfaces in Nomad with the following error when stopping an allocation:
Since the SIGTERM isn't propagating, the process is being hard-killed, which isn't very conducive to clean migrations to other Nomad Nodes, etc.
Steps to Reproduce
I’ve been playing a bit with this on my local machine and have managed to reproduce this with just docker. Here is an example of running without the waypoint-entrypoint and the exit is graceful:
As you can see, the gunicorn process recieves the SIGTERM, exits gracefully and the exit code is 0.
If I run that exact same process, but with a waypoint-entrypoint, I see the following:
This time, the gunicorn process does not receive the SIGTERM and the exit code for the container is 2. Interestingly, the container shuts down almost immediately so it’s not waiting for the web process to finish.
For the same app running in Nomad, the resource event log looks like this:
In the app log, there is nothing output. Nothing from the entrypoint and nothing from the app itself.
Expected behavior
I would expect the entrypoint to propagate the SIGTERM so the application can exit gracefully and the entrypoint should also exit gracefully.
Waypoint Platform Versions
Additional version and platform information to help triage the issue if
applicable:
We are seeing this across multiple apps built multiple ways. Some with pack, some with docker files. Some python, some ruby.
Any help in resolving this is greatly appreciated. Let me know if there is any additional context we can provide.
The text was updated successfully, but these errors were encountered: