-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot determine if a container was unable to start #13729
Comments
For reference, this is what I'm doing now as a workaround: https://gist.github.com/paralin/ad4279d14a588eb3e897519b9f299907 ... the error is only exposed when calling Start on the container, so if the Pod fails to start (created state), I have to loop over the containers & call Start on each until one returns an error. |
So, to be perfectly clear, the request is to include the error in the |
@mheon That would work, that & also hopefully some indication of the exit code or the nature of the failure. |
A friendly reminder that this issue had no activity for 30 days. |
This is still relevant, I think, there's no non hacky way to determine if a container failed to start |
A friendly reminder that this issue had no activity for 30 days. |
@mheon any chance you can make this happen? Or should we hand this to an intern? |
Sure. Just need to add a field to the DB to store the error message from the last run, and throw that in |
A friendly reminder that this issue had no activity for 30 days. |
@mheon Any chance you can implement this? |
Sure, I'll put it on the list |
A friendly reminder that this issue had no activity for 30 days. |
@mheon Any progress on this? |
A friendly reminder that this issue had no activity for 30 days. |
@mheon Reminder. |
On it |
@mheon if you're not too far along with this I wouldn't mind taking a stab at it |
@jakecorrenti Feel free to take a stab at it! |
I currently have a partial fix for this, but it isn't capturing the entire scope of the issue. In podman/libpod/container_api.go Line 85 in 639efd8
saveErrorState := func(e error) error {
c.state.Error = e.Error()
if err := c.save(); err != nil {
return err
}
return nil
} which is called when an error occurs in the function. The issue is this doesn't allow for the entire issue to be solved. If an error occurs in the container engine's For reference, this is the result of the above fix in regards to the issue above
|
Honestly, I think it's sufficient to just capture the Libpod bits... Probably would even be sufficient to capture just errors out of the OCI runtime, even. |
sounds good |
This change aims to store an error message to the ContainerState struct with the last known error from the Start, StartAndAttach, and Stop OCI Runtime functions. The goal was to act in accordance with Docker's behavior. Fixes: containers#13729 Signed-off-by: Jake Correnti <[email protected]>
/kind feature
Description
Say I execute a pod with the following pod spec:
The resulting container, of course, cannot start:
... due to command not found.
However, this error does not appear anywhere in the "podman inspect" output:
... the container just appears as "created" and there's no way to distinguish why it failed.
Describe the results you received:
What is the correct way to check if a container is in this kind of failed state via the API, and how to get the error message?
Is the best way to just check if the container is in "created" state, try to start it via api, and check for an error?
Describe the results you expected:
This seems like a bit of a hack/workaround, it'd be best if the error was in the container status somewhere.
The text was updated successfully, but these errors were encountered: