The unexpected exit of `jsonfile.Encode` is blocking the container's stdout and stderr.
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 52/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Stale
- Tech stack
- go
- Domain
- cli, observability-sre
Research direction
Start by reading pkg/logging/jsonfile/jsonfile.go around lines 62-65, then run the listed nerdctl reproduction with the json-file log driver and a full or immutable log file. Done means a file write error no longer stops log copying and the ping container does not hang; verify the behavior against the reported expected result.
Written by the indexing model from the issue text.
Description
Description
Any file write error will cause jsonfile.Encode to exit, stopping the copying of container logs. When buffer is full, container log writes will then block and hang.
Due to a full file system in our environment, a container hung on write logs. Despite our prompt cleanup, the issue persisted and was resolved by restarting the container finally.
relate https://github.com/containerd/containerd/issues/12462
Container use json-file log driver have this issue.
Steps to reproduce the issue
nerdctl run -d --name logging-test docker.io/library/busybox:latest ping 127.0.0.1 -i 0.1 -c 3000chattr +i $(nerdctl inspect logging-test -f {{.LogPath}}); sleep 1; chattr -i $(nerdctl inspect logging-test -f {{.LogPath}})- The ping commands hangs forever.
Describe the results you received and expected
Received: container hang
Expected: container not hang
What version of nerdctl are you using?
Client:
Version: 1.7.7
OS/Arch: linux/amd64
Git commit: 23d838b457213765095992ddd2c1b26a0c402632.m
buildctl:
Version:
Server:
containerd:
Version: 1.6.32
GitCommit: 8b3b7ca2e5ce38e8f31a34f35b2b68ceb8470d89
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
Are you using a variant of nerdctl? (e.g., Rancher Desktop)
None
Host information
Client:
Namespace: default
Debug Mode: false
Server:
Server Version: 1.6.32
Storage Driver: overlayfs
Logging Driver: json-file
Cgroup Driver: cgroupfs
Cgroup Version: 1
Plugins:
Log: fluentd journald json-file syslog
Storage: native overlayfs
Security Options:
seccomp
Profile: builtin
Kernel Version: 4.18.0-513.24.1.el8_9.v1.x86_64
Operating System: Rocky Linux 8.9 (Green Obsidian)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.718GiB
Name: osbuild
ID: ef318042-eff5-4f1c-9609-b726bd1e0a19
WARNING: IPv4 forwarding is disabled
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
- Dominant language
- Go
- Stars
- 10.5k
- Forks
- 853
- Avg merge
- 6d 14h
- Merged PRs (30d)
- 38
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- No contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from containerd/nerdctl
-
Test and examples: update wordpress images (to silence potential false security alerts)Possibly taken @Guurdeep claimed this 20 days ago. Openarea/ci documentation priority/low
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
containerd/nerdctl#5283 · 2 comments ·
Maintainers usually reply within 3 days
-
`nerdctl kill` shouldn't set `containerd.io/restart.explicitly-stopped` label for non-stop signalsMay be free again A pull request for this issue was closed without being merged. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
containerd/nerdctl#5171 · 3 comments ·
Maintainers usually reply within 3 days
-
area/project
Difficulty 1/5 Under an hour Newbie friendliness 25/100
containerd/nerdctl#5383 · 5 comments ·
Maintainers usually reply within 3 days
-
Restart-policy containers loop on "unable to apply apparmor profile" after reboot until the creating user logs in (OCI hook inherits the client's XDG_RUNTIME_DIR)Possibly taken @Shubhranshu153 claimed this today. Openarea/rootless bug
Difficulty 3/5 1-2 days Newbie friendliness 72/100
containerd/nerdctl#5377 · 1 assignee ·
Maintainers usually reply within 3 days
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
containerd/nerdctl#5355 ·
Maintainers usually reply within 3 days
All issues in containerd/nerdctl
Similar issues
-
ready-for-agent
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
jordansmall/spindrift#7895 ·
Maintainers usually reply within 1 day
-
documentation priority: medium skill: intermediate status: ready for dev
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
hyperledger-labs/fabric-smart-client#2830 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
P3 tech debt
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day