nerdctl checkpoint rm requires the container to exist, so a checkpoint whose container was removed can never be removed and its directory stays in the data root
Maintainer thường phản hồi trong vòng 2 ngày
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
Read pkg/cmd/checkpoint/remove.go and trace how container.ID() is used to build the checkpoint directory with checkpointutil.GetCheckpointDir. Check how checkpoint removal and its tests handle missing containers and checkpoint directories. Done means an orphaned checkpoint can be removed safely and existing removal behavior remains covered by tests.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
nerdctl checkpoint rm resolves the container argument and refuses to remove
the checkpoint if the container cannot be found — and it does so before it
deletes anything. So a checkpoint whose container has already been removed
cannot be removed with nerdctl at all, and its directory stays in the data root
forever.
The behaviour
$ nerdctl checkpoint rm <gone-container> <checkpoint-name>
error removing checkpoint for container: <gone-container>, no such container
$ echo $?
1
and the checkpoint directory is still there:
$ ls ~/.local/share/nerdctl/checkpoints/
<checkpoint-name>/
The same applies to a checkpoint whose create failed: nothing was stored, and
the removal fails for the same reason.
The source
pkg/cmd/checkpoint/remove.go:
n, err := walker.Walk(ctx, containerID)
if err != nil {
return err
} else if n == 0 {
return fmt.Errorf("error removing checkpoint for container: %s, no such container", containerID)
}
targetPath, err := checkpointutil.GetCheckpointDir(options.CheckpointDir, checkpointName, container.ID(), false)
if err != nil {
return err
}
return os.RemoveAll(targetPath)
The container lookup is a hard precondition for the removal, and it is
resolved before os.RemoveAll(targetPath).
Note also that the target path is derived from container.ID() — so the
container's identity is load-bearing for the removal, not merely for the
lookup.
Why this matters
The checkpoint store is a directory of CRIU image files under the nerdctl
data root — it is not a containerd object, and the name is not scoped by
container or by namespace. That is a reasonable design (a checkpoint is a
self-contained image set), but it creates a gap: the store outlives both the
container and the namespace, while the only supported removal path requires the
container.
The result is a directory that:
- occupies disk in the user's data root (a CRIU image set is not small);
- cannot be removed with
nerdctl checkpoint rm, because the container it was
named after is gone; - can only be removed by hand, with
rm -rfagainst a path the user has to
reconstruct.
The natural order — remove the container, then the checkpoint — is the order a
user reaches for first, and it is the order that strands the directory. The
working order is the reverse: checkpoint rm then rm.
Suggested direction
Two independent improvements, either of which closes the gap:
-
Do not require the container when the checkpoint directory exists. The
container lookup appears to be a guard against removing a checkpoint that
does not exist, butos.RemoveAllon a non-existent path is already
idempotent. If the lookup failed, the removal could still proceed against
the checkpoint directory alone. -
Add an explicit "remove by name" path — e.g. allowing the container
argument to be omitted, or a--force/--allmode that removes orphaned
checkpoint directories whose container no longer exists. Anerdctl checkpoint lsthat can list a directory with no container would also make the orphan
visible to the user.
Environment
- nerdctl 2.4.1
- containerd v2.4.1
- CRIU 4.2.1
- Ngôn ngữ chính
- Go
- Star
- 10.5k
- Fork
- 839
- Merge trung bình
- 3 ngày 11 giờ
- Pull request đã merge (30 ngày)
- 41
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của containerd/nerdctl
-
Test and examples: update wordpress images (to silence potential false security alerts)Có thể làm lại được @ayushpratap27 đã nhận 13 ngày trước và không có pull request nào đang mở. Đang mởarea/ci documentation priority/low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
containerd/nerdctl#5283 · 2 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
`nerdctl kill` shouldn't set `containerd.io/restart.explicitly-stopped` label for non-stop signalsCó thể làm lại được Pull request cho issue này đã bị đóng mà không được merge. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
containerd/nerdctl#5171 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
containerd/nerdctl#5323 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
-
fluentd log driver: default retry wait is passed in nanosecondsCó thể đã có người làm @ogulcanaydogan đã nhận 2 ngày trước. Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 25/100
containerd/nerdctl#5320 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
compose: only the last volume's create_host_path directories are createdCó thể đã có người làm @ogulcanaydogan đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 25/100
containerd/nerdctl#5317 ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của containerd/nerdctl
Issue tương tự
-
Add an MCP server: imageatĐang mởneeds-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
stacklok/toolhive-catalog#1890 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
integrations/terraform-provider-github#3719 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Wayfinder sample agents don't reach the Data Plane on the quickstart packCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mởType/Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
thunder-id/thunderid#6402 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
GoStratumEngineĐang mởaddition
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
awesome-selfhosted/awesome-selfhosted-data#3290 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
log4j2.xml from orchestration.extraConfiguration is rendered twice, and the install fails when orchestration.log4j2 is also setCó thể đã có người làm @irisfield đã nhận hôm nay. Đang mởplatform/local
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
camunda/camunda-platform-helm#7854 ·
Maintainer thường phản hồi trong vòng 1 ngày