Repository navigation
Description
I have done the following
- I have searched the existing issues
- If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
Hi @jglogan !
While testing #1041 using the kill script in #614, I had noticed that state of the container is not updated if it is killed via kill or launchctl bootout.
Start a container:
container run --name alpine-sleep-$(date +%H%M) --detach alpine sleep infinity
container list
ID IMAGE OS ARCH STATE ADDR CPUS MEMORY STARTED
alpine-sleep-1648 docker.io/library/alpine:latest linux arm64 running 192.168.64.2/24 4 1024 MB 2026-01-14T15:48:52Z
Kill:
launchctl list | grep "com.apple.container.*alpine-sleep" | awk '{print $1}' | xargs kill
Container is showing as running:
container list
ID IMAGE OS ARCH STATE ADDR CPUS MEMORY STARTED
alpine-sleep-1648 docker.io/library/alpine:latest linux arm64 running 192.168.64.2/24 4 1024 MB 2026-01-14T15:48:52Z
Failing to be stopped:
2026-01-14T16:52:11+0100 error com.apple.container: [ContainerCommands] failed to stop container alpine-sleep-1648: internalError: "failed to stop container" (cause: "internalError: "failed to stop container alpine-sleep-1648 (cause: "interrupted: "XPC connection error: Connection invalid"")"")
Error: internalError: "stop failed for one or more containers alpine-sleep-1648"
Still showing as running:
container list
ID IMAGE OS ARCH STATE ADDR CPUS MEMORY STARTED
alpine-sleep-1648 docker.io/library/alpine:latest linux arm64 running 192.168.64.2/24 4 1024 MB 2026-01-14T15:48:52Z
State will be updated only after full system stop:
container system stop
container system start
Current behavior
Container is shown as running; cannot be stopped and continues to be shown as running until container system stop.
Expected behavior
Update container system state if the container exited outside of container.
Environment
- OS: macOS 26.2
- Xcode: 26.2
- Container: container CLI version 0.7.1-49-gdbec1db (build: release, commit: dbec1db)Relevant log output
N/ACode of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
No labels
Activity
Ronitsabhaya75 commentedon Jan 15, 2026
Hi @vsarunas ! Thanks for the detailed report.
Root Cause:
Fix:
Modified
Fix apple#1050: Handle XPC connection loss to update container state …
jglogan commentedon Jan 15, 2026
For comparison here's what shows up in the logs if I kill the
com.apple.Virtualization.VirtualMachineprocess:jglogan commentedon Jan 15, 2026
Here's the log output when killing
container-runtime-linuxprocess:ContainerSvc: Handle unexpected sandbox svc exits (apple#1065)
Squashed commit of the following:
Squashed commit of the following:
Squashed commit of the following:
ContainerSvc: Handle unexpected sandbox svc exits (apple#1065)
ContainerSvc: Handle unexpected sandbox svc exits (apple#1065)
Fix apple#1050: Handle XPC connection loss to update container state …
Fix apple#1050: Handle XPC connection loss to update container state …