[Bug]: handler for containerDial threw error invalidState: "no sandbox client exists: container is stopped"
- Dominant language
- Swift
- Stars
- 49.9k
- Forks
- 1.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 22
Description
### I have done the following
- [x] I have searched the existing issues
- [ ] If possible, I've reproduced the issue using the 'main' branch of this project
### Steps to reproduce
Not sure what is causing it would love some pointers on where to look. I've been playing around with `container` by spinning up small images and occasionally I'll get a complete down of `container` where the api server seems to stop responding and I wont be able to cleanly stop it through `container system stop` either.
### Current behavior
Everything hangs. I cannot build any new images and when I try to spin down using container system stop it seems to hang.
### Expected behavior
Things should not be crashing.
### Environment
```markdown
- OS: macOS 15.6
- Xcode:
- Container: Container CLI version 0.5.0
```
### Relevant log output
```shell
2025-10-03 17:49:51.031450-0700 0x3b93d1 Info 0x0 2826 0 container-apiserver: [com.apple.container:APIServer] network service: list
2025-10-03 17:49:51.033222-0700 0x3b9233 Info 0x0 89868 0 container-core-images: [com.apple.container:ImagesHelper] ImagesService: list()
2025-10-03 17:49:51.036917-0700 0x3b9233 Info 0x0 89868 0 container-core-images: [com.apple.container:ImagesHelper] ImagesService: getImageSnapshot(description:platform:) - description: ImageDescription(reference: "ghcr.io/apple/containerization/vminit:0.9.1", descriptor: ContainerizationOCI.Descriptor(mediaType: "application/vnd.oci.image.index.v1+json", digest: "sha256:6839bd6e230281df328571bd15929f8115303cba19737f3d888cc77a113e482d", size: 306, urls: nil, annotations: nil, platform: nil)), platform: Platform(osVersion: nil, osFeatures: nil, variant: nil, _rawOS: "linux", _rawArch: "arm64")
2025-10-03 17:49:51.041618-0700 0x3b94f5 Info 0x0 89868 0 container-core-images: [com.apple.container:ImagesHelper] ImagesService: getImageSnapshot(description:platform:) - description: ImageDescription(reference: "docker.io/library/houston-web:latest", descriptor: ContainerizationOCI.Descriptor(mediaType: "application/vnd.oci.image.index.v1+json", digest: "sha256:9e56e72aa3b87dd23ecdf9ad8d40b3cd9f61197341f59a6f5c8388aa77c86fa5", size: 375, urls: nil, annotations: Optional(["io.containerd.image.name": "docker.io/library/houston-web:minimal", "com.apple.containerization.image.name": "houston-web:minimal", "org.opencontainers.image.created": "2025-10-04T00:34:22Z", "org.opencontainers.image.ref.name": "minimal"]), platform: nil)), platform: Platform(osVersion: nil, osFeatures: nil, variant: nil, _rawOS: "linux", _rawArch: "arm64")
2025-10-03 17:49:51.046129-0700 0x3b94e4 Info 0x0 2826 0 container-apiserver: [com.apple.container:APIServer] Registering plugin [id=com.apple.container.container-runtime-linux.houston-web]
2025-10-03 17:49:51.108759-0700 0x3b9680 Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] starting start [uuid=houston-web]
2025-10-03 17:49:51.110039-0700 0x3b9680 Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] configuring XPC server [uuid=houston-web]
2025-10-03 17:49:51.110245-0700 0x3b9680 Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] starting XPC server [uuid=houston-web]
2025-10-03 17:49:51.110551-0700 0x3b9680 Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] `createEndpoint` xpc handler [uuid=houston-web]
2025-10-03 17:49:51.110782-0700 0x3b968a Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] `bootstrap` xpc handler [uuid=houston-web]
2025-10-03 17:49:51.114434-0700 0x3b9513 Info 0x0 89867 0 container-network-vmnet: [com.apple.container:NetworkVmnetHelper] allocated attachment [hostname=houston-web] [id=default] [address=192.168.64.8/24] [gateway=192.168.64.1]
2025-10-03 17:49:51.351637-0700 0x3b9506 Info 0x0 3108 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] Shutting down SandboxService [uuid=houston-memory]
2025-10-03 17:49:51.529949-0700 0x3b968a Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] creating forwarder for [uuid=houston-web] [server=[IPv4]192.168.64.8:8000] [proxy=[IPv4]0.0.0.0:8000] [protocol=tcp]
2025-10-03 17:49:51.635206-0700 0x3b968b Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] `startProcess` xpc handler [uuid=houston-web]
2025-10-03 17:49:51.728564-0700 0x3b93d1 Info 0x0 2826 0 container-apiserver: [com.apple.container:APIServer] registering container houston-web with exit monitor
2025-10-03 17:49:51.728640-0700 0x3b9680 Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] `state` xpc handler [uuid=houston-web]
2025-10-03 17:49:51.730593-0700 0x3b968a Info 0x0 3156 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] `wait` xpc handler [uuid=houston-web]
2025-10-03 17:50:01.222593-0700 0x3b960f Error 0x0 3140 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] backend - connect failed: connection reset (error set): Connection refused (errno: 61) [uuid=houston-agent] [proxy=[IPv4]127.0.0.1/127.0.0.1:8002] [server=[IPv4]127.0.0.1/127.0.0.1:50892]
2025-10-03 17:50:13.842623-0700 0x3b9b70 Error 0x0 2826 0 container-apiserver: [com.apple.container:APIServer] handler for containerDial threw error invalidState: "no sandbox client exists: container is stopped"
2025-10-03 17:50:13.846768-0700 0x3b90ac Info 0x0 91888 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] `createEndpoint` xpc handler [uuid=buildkit]
2025-10-03 17:50:13.847052-0700 0x3b9d56 Info 0x0 91888 0 container-runtime-linux: [com.apple.container:RuntimeLinuxHelper] `bootstrap` xpc handler [uuid=buildkit]
2025-10-03 17:56:06.555200-0700 0x3b9d54 Error 0x0 2826 0 container-apiserver: [com.apple.container:APIServer] xpc client handler connection error Connection invalid
2025-10-03 17:56:24.226109-0700 0x3bbe3a Error 0x0 2826 0 container-apiserver: [com.apple.container:APIServer] xpc client handler connection error Connection invalid
```
### Code of Conduct
- [x] I agree to follow this project's Code of Conduct
Contributor guide
Assessment
This issue has not been assessed yet.