-
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
container state improper 409 - via stats endpoint for container in created state #14498
Labels
HTTP API
Bug is in RESTful API
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Comments
Any chance you have easy access to the Docker CLI and see if they return a similar error to our CLI or just stream all-0s stats like the API does? |
|
@jwhonce If you have time, PTAL; otherwise, could be a good candidate for the interns. |
I can take this one |
You got it |
I would guess users would expect this to match Docker as much as possible. |
jakecorrenti
pushed a commit
to jakecorrenti/podman
that referenced
this issue
Jun 13, 2022
Previously, if a container was created and not running, the `stats` command would return an error: `Error: container state improper`. Like Docker, Podman now reports all 0s for the stats if the container is not running: ``` $ bin/podman stats --no-stream strange_robinson ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS CPU TIME AVG CPU % 146cd3530464 strange_robinson 0.00% 0B / 0B 0.00% 0B / 0B 0B / 0B 0 0s 0.00% ``` Closes: containers#14498 Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
jakecorrenti
pushed a commit
to jakecorrenti/podman
that referenced
this issue
Jun 13, 2022
command Previously, if a container was not running, and the user ran the `podman stats` command, an error would be reported: `Error: container state improper`. Podman now reports stats as the fields' default values for their respective type if the container is not running: ``` $ podman stats --no-stream demo ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS CPU TIME AVG CPU % 4b4bf8ce84ed demo 0.00% 0B / 0B 0.00% 0B / 0B 0B / 0B 0 0s 0.00% ``` Closes: containers#14498 Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
mheon
pushed a commit
to mheon/libpod
that referenced
this issue
Jun 14, 2022
command Previously, if a container was not running, and the user ran the `podman stats` command, an error would be reported: `Error: container state improper`. Podman now reports stats as the fields' default values for their respective type if the container is not running: ``` $ podman stats --no-stream demo ID NAME CPU % MEM USAGE / LIMIT MEM % NET IO BLOCK IO PIDS CPU TIME AVG CPU % 4b4bf8ce84ed demo 0.00% 0B / 0B 0.00% 0B / 0B 0B / 0B 0 0s 0.00% ``` Closes: containers#14498 Signed-off-by: Jake Correnti <jcorrenti13@gmail.com>
ttys3
added a commit
to ttys3/nomad-driver-podman
that referenced
this issue
Aug 5, 2022
ttys3
added a commit
to ttys3/nomad-driver-podman
that referenced
this issue
Aug 7, 2022
…dy if the container is exited Refs: containers/podman#14498 containers/podman#15218
github-actions
bot
added
the
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
label
Sep 20, 2023
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
HTTP API
Bug is in RESTful API
kind/bug
Categorizes issue or PR as related to a bug.
locked - please file new issue/PR
Assist humans wanting to comment on an old issue or PR with locked comments.
Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind bug
Description
/container/{id}/stats
if the container is created via/containers/create
endpoint and is in created/initialized state. Same applies for CLI (podman stats {id}
).Steps to reproduce the issue:
containerid=$(curl -s --unix-socket /run/podman/podman.sock -X POST -H "Content-Type: application/json" -d @payload.json "http://d/containers/create" | jq -r .Id)
curl -s --unix-socket /run/podman/podman.sock -X GET http://d/containers/$containerid/stats
Describe the results you received:
Response from step2
{"cause":"container state improper","message":"container state improper","response":409}
Describe the results you expected:
Empty stats are streamed
Additional information you deem important (e.g. issue happens only occasionally):
Output of
podman version
:Output of
podman info --debug
:Package info (e.g. output of
rpm -q podman
orapt list podman
):Have you tested with the latest version of Podman and have you checked the Podman Troubleshooting Guide? (https://github.com/containers/podman/blob/main/troubleshooting.md)
No
Additional environment details (AWS, VirtualBox, physical, etc.):
The text was updated successfully, but these errors were encountered: