Skip to content
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

Restart Container failed 0- debugging, diagnosing? #111

Open
psyciknz opened this issue Sep 13, 2023 · 3 comments
Open

Restart Container failed 0- debugging, diagnosing? #111

psyciknz opened this issue Sep 13, 2023 · 3 comments

Comments

@psyciknz
Copy link

image

Any way of getting more information as to why it fails?

@psyciknz
Copy link
Author

So i had a dig around in the docker-entrypoint and found the command that restarts a container. And contructed the following:

 curl -v -X POST --unix-socket /var/run/docker.sock http://localhost/containers/ba2ac8f3daa4/restart?t=10

When I execute that in the autoheal container, I can see the container that fails restarting.

@tmknight
Copy link

tmknight commented Feb 17, 2024

This can be accommodated by capturing the result of the API call into stdout.

Though not using the same methodology as this project, here's an example of how this could be accommodated

@napalmz
Copy link

napalmz commented Jun 24, 2024

I get the same problem but, launching curl command from within autoheal container, everything goes well.
Logs:

24-06-2024 06:50:12 Container /apcupsd (38b41cc6f688) found to be unhealthy - Restarting container now with 10s timeout
24-06-2024 06:50:12 Restarting container 38b41cc6f688 failed

Manual restart from container:

/ # curl -v -X POST --unix-socket /var/run/docker.sock http://localhost/containers/38b41cc6f688/restart?t=10
*   Trying /var/run/docker.sock:0...
* Connected to localhost (/run/docker.sock) port 80
> POST /containers/38b41cc6f688/restart?t=10 HTTP/1.1
> Host: localhost
> User-Agent: curl/8.5.0
> Accept: */*
> 
< HTTP/1.1 204 No Content
< Api-Version: 1.45
< Docker-Experimental: false
< Ostype: linux
< Server: Docker/26.1.4 (linux)
< Date: Mon, 24 Jun 2024 10:11:54 GMT
< 
* Connection #0 to host localhost left intact
/ # 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants