{"record":{"id":"e6ff6d3095bd0523","repo":"docker/compose","slug":"cannot-share-ipc-namespace-with-service-s-contai","errorCode":null,"errorMessage":"cannot share IPC namespace with service %s: container missing","messagePattern":"cannot share IPC namespace with service (.+?): container missing","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/convergence.go","lineNumber":105,"sourceCode":"\t\t}\n\t\tservice.VolumesFrom[i] = dependencies.sorted()[0].ID\n\t}\n\treturn nil\n}\n\nfunc resolveSharedNamespaces(service *types.ServiceConfig, containersByService map[string]Containers) error {\n\tif name := getDependentServiceFromMode(service.NetworkMode); name != \"\" {\n\t\tdependencies := containersByService[name]\n\t\tif len(dependencies) == 0 {\n\t\t\treturn fmt.Errorf(\"cannot share network namespace with service %s: container missing\", name)\n\t\t}\n\t\tservice.NetworkMode = types.ContainerPrefix + dependencies.sorted()[0].ID\n\t}\n\n\tif name := getDependentServiceFromMode(service.Ipc); name != \"\" {\n\t\tdependencies := containersByService[name]\n\t\tif len(dependencies) == 0 {\n\t\t\treturn fmt.Errorf(\"cannot share IPC namespace with service %s: container missing\", name)\n\t\t}\n\t\tservice.Ipc = types.ContainerPrefix + dependencies.sorted()[0].ID\n\t}\n\n\tif name := getDependentServiceFromMode(service.Pid); name != \"\" {\n\t\tdependencies := containersByService[name]\n\t\tif len(dependencies) == 0 {\n\t\t\treturn fmt.Errorf(\"cannot share PID namespace with service %s: container missing\", name)\n\t\t}\n\t\tservice.Pid = types.ContainerPrefix + dependencies.sorted()[0].ID\n\t}\n\n\treturn nil\n}\n\nfunc getContainerName(projectName string, service types.ServiceConfig, number int) string {\n\tname := getDefaultContainerName(projectName, service.Name, strconv.Itoa(number))\n\tif service.ContainerName != \"\" {","sourceCodeStart":87,"sourceCodeEnd":123,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/convergence.go#L87-L123","documentation":"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.","triggerScenarios":"`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.","commonSituations":"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.","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"],"exampleFix":"# before\nservices:\n  shm:\n    image: busybox\n  app:\n    ipc: \"service:shm\"\n\n# after\nservices:\n  shm:\n    image: busybox\n  app:\n    depends_on: [shm]\n    ipc: \"service:shm\"","handlingStrategy":"validation","validationCode":"if name := getDependentServiceFromMode(svc.Ipc); name != \"\" {\n    if len(containersByService[name]) == 0 {\n        return fmt.Errorf(\"ipc service:%s has no containers\", name)\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Add depends_on to IPC providers and verify they stay running","For /dev/shm needs consider shm_size instead of service IPC sharing"],"tags":["ipc","namespaces","dependencies","convergence"],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}