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

stats API endpoint crashing 500 when container has no cgroup #24632

Open
mrgleeco opened this issue Nov 21, 2024 · 0 comments
Open

stats API endpoint crashing 500 when container has no cgroup #24632

mrgleeco opened this issue Nov 21, 2024 · 0 comments
Labels
kind/bug Categorizes issue or PR as related to a bug.

Comments

@mrgleeco
Copy link

mrgleeco commented Nov 21, 2024

Issue Description

hello! I found a surprising behavior via use of the podman-exporter to report metrics.

In creating a pod via kube play, the pod is created fine, but the metrics endpoint is failing with 500:

curl -s localhost:5000/v5.2.5/libpod/containers/stats
Request Failed(Internal Server Error): cannot run top on container 0c72.. as it did not create a cgroup: this container does not have a cgroup

error logged:

GET /v5.2.5/libpod/containers/stats?all=false&interval=1&stream=false HTTP/1.1" 500 239 "" "Go-http-client/1.1"

Here the container 0c72.. is a pause container. I would not expect the endpoint to crash 500 and deny all stat info.

Notably podman is rootless mode and in k8s (ie like DnD). Not seeing the problem in native host mode.

Unclear if containers.conf is the source of problem. Have not had time to extensively rtfm there, but a latest attempt looked like this (largely inherited from /etc version found at https://quay.io/repository/containers/podman)

[containers]
netns="host"
userns="host"
ipcns="host"
utsns="host"
cgroupns="host"
cgroups="disabled"
log_driver = "k8s-file"
volumes = [
        "/proc:/proc",
]
default_sysctls = []

[engine]
cgroup_manager = "cgroupfs"
events_logger="file"
runtime="crun"

Version info

$ podman version
Client:       Podman Engine
Version:      5.2.5
API Version:  5.2.5
Go Version:   go1.23.2
Built:        Fri Oct 18 00:00:00 2024
OS/Arch:      linux/amd64
@mrgleeco mrgleeco added the kind/bug Categorizes issue or PR as related to a bug. label Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug.
Projects
None yet
Development

No branches or pull requests

1 participant