Skip to content

Panic in dockerContainerHandler.GetStats on Ubuntu 24.04 (v0.54.0) #3758

@yaroslav-gwit

Description

@yaroslav-gwit

What happened?

cAdvisor is crashing with a nil pointer dereference shortly after start.

I’m running the prebuilt v0.54.0 release binary as root on a bare-metal Ubuntu 24.04 machine. Very soon after startup it panics with the following stack trace:

I1204 01:43:35.078794 2196020 cadvisor.go:179] Starting cAdvisor version: v0.54.0-unknown on port 10880
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x840 pc=0xb707fe]

goroutine 337981 [running]:
github.com/google/cadvisor/container/docker.(*dockerContainerHandler).GetStats(0xc001e75680)
        /go/src/github.com/google/cadvisor/container/docker/handler.go:332 +0x3e
github.com/google/cadvisor/manager.(*containerData).updateStats(0xc001fe6248)
        /go/src/github.com/google/cadvisor/manager/container.go:647 +0x3b
github.com/google/cadvisor/manager.(*containerData).housekeepingTick(0xc001fe6248, 0x5b?, 0x5f5e100)
        /go/src/github.com/google/cadvisor/manager/container.go:585 +0x14e
github.com/google/cadvisor/manager.(*containerData).housekeeping(0xc001fe6248)
        /go/src/github.com/google/cadvisor/manager/container.go:533 +0x3f3
created by github.com/google/cadvisor/manager.(*containerData).Start in goroutine 314
        /go/src/github.com/google/cadvisor/manager/container.go:120 +0x4f

It looks like dockerContainerHandler.GetStats is dereferencing a nil field.

What did you expect to happen?

cAdvisor should start and continue running, or at least log an error if Docker/container stats cannot be read, instead of panicking.

How can we reproduce it (as minimally and precisely as possible)?

On a fresh Ubuntu 24.04 bare-metal host:

  • Download the cadvisor v0.54.0 release binary from the GitHub Releases page.
  • Make it executable and run it as root, listening on a non-privileged port:
chmod +x cadvisor
sudo ./cadvisor --port=10880

After a short while, cAdvisor panics with the stack trace above.

If you need more exact repro info I can provide:

  • Output of docker info (if relevant)
  • Any extra logs (using higher verbosity level)

Environment

cAdvisor version: v0.54.0 (prebuilt release binary)

Installation method: downloaded release binary (not built from source)

OS: Ubuntu 24.04 LTS (bare metal)

Kernel: 6.8.0-87-generic

Architecture: amd64

Container runtime: Docker

Running as:

sudo ./cadvisor --port=10880

Docker version:

# docker version
Client: Docker Engine - Community
 Version:           29.0.1
 API version:       1.52
 Go version:        go1.25.4
 Git commit:        eedd969
 Built:             Fri Nov 14 16:17:49 2025
 OS/Arch:           linux/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          29.0.1
  API version:      1.52 (minimum version 1.44)
  Go version:       go1.25.4
  Git commit:       198b5e3
  Built:            Fri Nov 14 16:17:49 2025
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v2.1.5
  GitCommit:        fcd43222d6b07379a4be9786bda52438f0dd16a1
 runc:
  Version:          1.3.3
  GitCommit:        v1.3.3-0-gd842d771
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions