docker/compose · error
cannot share IPC namespace with service %s: container missin
Error message
cannot share IPC namespace with service %s: container missing
What it means
The IPC arm of resolveSharedNamespaces: an `ipc: "service:<name>"` setting must be rewritten to container:<id> of a live container of that service. When containersByService has no entry (zero containers) for the referenced service, the IPC namespace cannot be shared and convergence fails.
Source
Thrown at pkg/compose/convergence.go:105
}
service.VolumesFrom[i] = dependencies.sorted()[0].ID
}
return nil
}
func resolveSharedNamespaces(service *types.ServiceConfig, containersByService map[string]Containers) error {
if name := getDependentServiceFromMode(service.NetworkMode); name != "" {
dependencies := containersByService[name]
if len(dependencies) == 0 {
return fmt.Errorf("cannot share network namespace with service %s: container missing", name)
}
service.NetworkMode = types.ContainerPrefix + dependencies.sorted()[0].ID
}
if name := getDependentServiceFromMode(service.Ipc); name != "" {
dependencies := containersByService[name]
if len(dependencies) == 0 {
return fmt.Errorf("cannot share IPC namespace with service %s: container missing", name)
}
service.Ipc = types.ContainerPrefix + dependencies.sorted()[0].ID
}
if name := getDependentServiceFromMode(service.Pid); name != "" {
dependencies := containersByService[name]
if len(dependencies) == 0 {
return fmt.Errorf("cannot share PID namespace with service %s: container missing", name)
}
service.Pid = types.ContainerPrefix + dependencies.sorted()[0].ID
}
return nil
}
func getContainerName(projectName string, service types.ServiceConfig, number int) string {
name := getDefaultContainerName(projectName, service.Name, strconv.Itoa(number))
if service.ContainerName != "" {View on GitHub (pinned to ddc4b044b6)
Solutions
- Bring up the provider alongside the dependent (add depends_on or include it in the up command)
- Verify the provider container exists and stays running: `docker compose ps -a <provider>` and its logs
- As a fallback for plain /dev/shm sharing, use a tmpfs/size option or shared volume instead of service IPC sharing
Example fix
# before
services:
shm:
image: busybox
app:
ipc: "service:shm"
# after
services:
shm:
image: busybox
app:
depends_on: [shm]
ipc: "service:shm" Defensive patterns
Strategy: validation
Validate before calling
if name := getDependentServiceFromMode(svc.Ipc); name != "" {
if len(containersByService[name]) == 0 {
return fmt.Errorf("ipc service:%s has no containers", name)
}
} Prevention
- Add depends_on to IPC providers and verify they stay running
- For /dev/shm needs consider shm_size instead of service IPC sharing
When it happens
Trigger: `docker compose up` with `ipc: service:ipcserver` where ipcserver has no created containers — same family of failures as network_mode service: sharing: provider never started, crashed, or omitted from the selected services.
Common situations: Performance-sensitive setups sharing a shared-memory IPC sidecar (e.g. chrome/selenium, databases with /dev/shm sharing); partial `up` invocations that skip the provider; provider image pull failures in CI.
Related errors
- cannot share network namespace with service %s: container mi
- cannot share PID namespace with service %s: container missin
- cannot share volume with service %s: container missing
- %s is missing dependency %s
- service %q didn't complete successfully: exit %d
AI-assisted analysis of docker/compose@ddc4b044b6 (2026-08-15).
Data as JSON: /api/errors/e6ff6d3095bd0523.
Report an issue: GitHub.