You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If possible, I've reproduced the issue using the 'main' branch of this project
Steps to reproduce
container rm -f
Current behavior
container rm -f better-error
2026-01-15T19:30:03-0800 error com.apple.container: [ContainerCommands] failed to delete container better-error: internalError: "failed to delete container" (cause: "unknown: "Error Domain=NSCocoaErrorDomain Code=260 "The file “config.json” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/ptone/Library/Application Support/com.apple.container/containers/better-error/config.json, NSURL=file:///Users/ptone/Library/Application%20Support/com.apple.container/containers/better-error/config.json, NSUnderlyingError=0x6000005c8390 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}"")
Error: internalError: "delete failed for one or more containers: ["better-error"]"
Expected behavior
I expected to delete the container
Environment
- OS:
System Version: macOS 15.7.3 (24G419)
Kernel Version: Darwin 24.6.0
- Xcode:
- Container:
I think I have the same issue, and I think I found a way to reproduce it.
M2 Air (Tahoe 26.2, 0.7.1, release, commit 420be74), stumbled upon while trying to figure out why oraclelinux:10 would immediately exit (fumbled -it...):
user@Mac ~> container run --name ora10 oraclelinux:10
user@Mac ~> container inspect ora10 | jq '.[].status' -r
stopped
user@Mac ~> container exec ora10 sh
Error: invalidState: "container ora10 is not running"
user@Mac ~ [1]> container start ora10 && container exec ora10 sh
ora10
Error: internalError: "failed to create process in container" (cause: "internalError: "failed to create process 4aaf807e-440c-4be6-9dd7-381a3f8e64c1 in container ora10 (cause: "invalidState: "cannot exec: container is not running"")"")
user@Mac ~ [1]> container rm ora10
2026-01-20T23:36:29+0100 error com.apple.container: [ContainerCommands] failed to delete container ora10: internalError: "failed to delete container" (cause: "unknown: "Error Domain=NSCocoaErrorDomain Code=260 "The file “config.json” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/user/Library/Application Support/com.apple.container/containers/ora10/config.json, NSURL=file:///Users/user/Library/Application%20Support/com.apple.container/containers/ora10/config.json, NSUnderlyingError=0x7ab0e0270 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}"")
Error: internalError: "delete failed for one or more containers: ["ora10"]"
Trying to exec on a stopped container results in the Error: invalidState: "container ora10 is not running" error message, but the error is different when the container was just started (and immediately stopped). inspect briefly reveals the status at that point as running:
Running exec on a container (and letting it fail) during this brief running period reliably seems to result in the containers/<name> directory being lost.
% container run --name ora10 oraclelinux:10Warning! Running debug build. Performance may be degraded.
% container exec ora10 sh Warning! Running debug build. Performance may be degraded.Error: invalidState: "container ora10 is not running"
% container start ora10 && container exec ora10 shWarning! Running debug build. Performance may be degraded.ora10Warning! Running debug build. Performance may be degraded.Error: internalError: "failed to create process in container" (cause: "internalError: "failed to create process a00ce02f-3331-4016-84e0-cef23af523db in container ora10 (cause: "invalidState: "cannot exec: container is not running"")"")
% container ls -aWarning! Running debug build. Performance may be degraded.ID IMAGE OS ARCH STATE ADDR CPUS MEMORY STARTEDora10 docker.io/library/oraclelinux:10 linux arm64 stopped 4 1024 MB 2026-01-21T18:00:50Z
% container rm ora10Warning! Running debug build. Performance may be degraded.failed to delete container ora10: internalError: "failed to delete container" (cause: "unknown: "Error Domain=NSCocoaErrorDomain Code=260 "The file “config.json” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/Users/john/Library/Application Support/com.apple.container/containers/ora10/config.json, NSURL=file:///Users/john/Library/Application%20Support/com.apple.container/containers/ora10/config.json, NSUnderlyingError=0xc390345a0 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}"")Error: internalError: "delete failed for one or more containers: ["ora10"]"
% container system stopWarning! Running debug build. Performance may be degraded.2026-01-21T10:01:19-0800 info com.apple.container.cli: [ContainerCommands] checking if APIServer is alive2026-01-21T10:01:19-0800 info com.apple.container.cli: stopTimeoutSeconds=5 [ContainerCommands] stopping containersora102026-01-21T10:01:19-0800 info com.apple.container.cli: [ContainerCommands] waiting for containers to exit2026-01-21T10:01:19-0800 info com.apple.container.cli: label=gui/501/com.apple.container.apiserver [ContainerCommands] stopping service2026-01-21T10:01:19-0800 info com.apple.container.cli: label=gui/501/com.apple.container.container-network-vmnet.default [ContainerCommands] stopping service2026-01-21T10:01:19-0800 info com.apple.container.cli: label=gui/501/com.apple.container.container-core-images [ContainerCommands] stopping service2026-01-21T10:01:19-0800 info com.apple.container.cli: label=gui/501/com.apple.container.apiserver [ContainerCommands] stopping service
% container system startWarning! Running debug build. Performance may be degraded.Verifying apiserver is running...
% container ls -aWarning! Running debug build. Performance may be degraded.ID IMAGE OS ARCH STATE ADDR CPUS MEMORY STARTED
I think what's happening here is that the exec error is failing at a point in the code such that the cleanup being applied is the same as for run, where we'd want to remove the container if the workload startup (not the workload itself) fails for any reason.
In the run case the in-memory container entity is never created, so there's no need to remove it, which means here, the on-disk container gets removed while the in-memory entity remains.
Definitely a bug. Thanks again for filing the issue!
I don't have quite the repro steps, but I will say that my use-case does involve routinely exec'ing into a container to rejoin a tmux session in the container - the the above flow looks similar
Activity
jglogan commentedon Jan 16, 2026
@ptone What was your container run command? Can you provide repro steps?
MarkOtzen commentedon Jan 20, 2026
I think I have the same issue, and I think I found a way to reproduce it.
M2 Air (Tahoe 26.2,
0.7.1, release, commit 420be74), stumbled upon while trying to figure out whyoraclelinux:10would immediately exit (fumbled-it...):Trying to
execon astoppedcontainer results in theError: invalidState: "container ora10 is not running"error message, but the error is different when the container was juststarted (and immediatelystopped).inspectbriefly reveals the status at that point asrunning:Running
execon a container (and letting it fail) during this briefrunningperiod reliably seems to result in thecontainers/<name>directory being lost.jglogan commentedon Jan 21, 2026
@MarkOtzen Thanks for the report! I'll see if I can reproduce the container going missing via exec.
jglogan commentedon Jan 21, 2026
I see the same on main:
jglogan commentedon Jan 21, 2026
I think what's happening here is that the exec error is failing at a point in the code such that the cleanup being applied is the same as for run, where we'd want to remove the container if the workload startup (not the workload itself) fails for any reason.
In the run case the in-memory container entity is never created, so there's no need to remove it, which means here, the on-disk container gets removed while the in-memory entity remains.
Definitely a bug. Thanks again for filing the issue!
ptone commentedon Jan 22, 2026
I don't have quite the repro steps, but I will say that my use-case does involve routinely exec'ing into a container to rejoin a tmux session in the container - the the above flow looks similar
finagolfin commentedon Jan 24, 2026
I just saw a container disappear in a similar scenario, was pretty surprising.
Refactor container lifecycle functions to perform scoped rollback on …
MarkOtzen commentedon Jan 31, 2026
Can no longer reproduce on current main (
0.8.0-24-g113a6ec), thanks to everyone involved.Squashed commit of the following:
Squashed commit of the following: