{"record":{"id":"c75da47081067f92","repo":"docker/compose","slug":"external-volume-q-not-found","errorCode":null,"errorMessage":"external volume %q not found","messagePattern":"external volume %q not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/compose/create.go","lineNumber":221,"sourceCode":"}\n\n// checkExternalVolumes validates that every external volume exists and returns\n// their resolved names. External volumes carry no compose label and are\n// therefore absent from the label-scoped observed state, so the reconciler needs\n// them injected via setResolvedVolumes.\n//\n// Managed and legacy (unlabeled, name-matched) volumes are discovered by\n// collectObservedState; their lifecycle is owned by the reconciliation plan, so\n// this function performs no mutation on them.\nfunc (s *composeService) checkExternalVolumes(ctx context.Context, project *types.Project) (map[string]string, error) {\n\texternal := map[string]string{}\n\tfor k, volume := range project.Volumes {\n\t\tif !volume.External {\n\t\t\tcontinue\n\t\t}\n\t\tif _, err := s.apiClient().VolumeInspect(ctx, volume.Name, client.VolumeInspectOptions{}); err != nil {\n\t\t\tif errdefs.IsNotFound(err) {\n\t\t\t\treturn nil, fmt.Errorf(\"external volume %q not found\", volume.Name)\n\t\t\t}\n\t\t\treturn nil, err\n\t\t}\n\t\texternal[k] = volume.Name\n\t}\n\treturn external, nil\n}\n\n// warnUnmanagedVolumes warns about declared volumes backed by a live volume that\n// this project does not own — either created outside Compose (no project label)\n// or by another project. Such volumes are matched by name and reused untouched\n// (see collectObservedState); the warning tells the user to set `external: true`\n// to make the intent explicit.\nfunc warnUnmanagedVolumes(project *types.Project, observed *ObservedState) {\n\tfor k, volume := range project.Volumes {\n\t\tif volume.External {\n\t\t\tcontinue\n\t\t}","sourceCodeStart":203,"sourceCodeEnd":239,"githubUrl":"https://github.com/docker/compose/blob/ddc4b044b62e9f715212ea4143fa830fac76382f/pkg/compose/create.go#L203-L239","documentation":"Error \"external volume %q not found\" thrown in docker/compose.","triggerScenarios":"A volume declared with 'external: true' in the compose file does not exist in the Docker engine when the service is created.","commonSituations":"The external volume was never created, was removed, or the name in the compose file (including project prefix handling) does not match the actual volume name.","solutions":["Create the external volume first: docker volume create <name>.","Check the volume name for typos, or remove external: true from the volume definition so Compose creates it."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"ddc4b044b62e9f715212ea4143fa830fac76382f","analyzedAt":"2026-08-15T13:31:42.319Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}