{"record":{"id":"5b137e585825652b","repo":"docker/cli","slug":"invalid-npipe-source-source-cannot-be-empty","errorCode":null,"errorMessage":"invalid npipe source, source cannot be empty","messagePattern":"invalid npipe source, source cannot be empty","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":176,"sourceCode":"\tif volume.Image != nil {\n\t\treturn mount.Mount{}, errors.New(\"image options are incompatible with type tmpfs\")\n\t}\n\tif volume.Cluster != nil {\n\t\treturn mount.Mount{}, errors.New(\"cluster options are incompatible with type tmpfs\")\n\t}\n\tif volume.Tmpfs != nil {\n\t\tresult.TmpfsOptions = &mount.TmpfsOptions{\n\t\t\tSizeBytes: volume.Tmpfs.Size,\n\t\t}\n\t}\n\treturn result, nil\n}\n\nfunc handleNpipeToMount(volume composetypes.ServiceVolumeConfig) (mount.Mount, error) {\n\tresult := createMountFromVolume(volume)\n\n\tif volume.Source == \"\" {\n\t\treturn mount.Mount{}, errors.New(\"invalid npipe source, source cannot be empty\")\n\t}\n\tif volume.Volume != nil {\n\t\treturn mount.Mount{}, errors.New(\"volume options are incompatible with type npipe\")\n\t}\n\tif volume.Image != nil {\n\t\treturn mount.Mount{}, errors.New(\"image options are incompatible with type npipe\")\n\t}\n\tif volume.Tmpfs != nil {\n\t\treturn mount.Mount{}, errors.New(\"tmpfs options are incompatible with type npipe\")\n\t}\n\tif volume.Bind != nil {\n\t\tresult.BindOptions = &mount.BindOptions{\n\t\t\tPropagation: mount.Propagation(volume.Bind.Propagation),\n\t\t}\n\t}\n\treturn result, nil\n}\n","sourceCodeStart":158,"sourceCodeEnd":194,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/compose/convert/volume.go#L158-L194","documentation":"Returned by handleNpipeToMount (cli/compose/convert/volume.go:175-176). A named-pipe mount forwards a Windows named pipe (e.g. \\\\.\\pipe\\docker_engine) into the container and therefore requires a concrete source path. An empty source makes the mount unresolvable, so it is rejected before reaching the engine.","triggerScenarios":"ServiceVolumeConfig with Type==\"npipe\" and Source==\"\" passed to convertVolumeToMount().","commonSituations":"Using `type: npipe` without a `source:`; interpolation of a pipe name that resolved to empty; running an npipe entry on a non-Windows host where the path was parameterised away.","solutions":["Add the Windows named-pipe path as `source:` (e.g. `\\\\.\\\\pipe\\\\docker_engine`).","Guard interpolation: `source: ${PIPE_NAME:?must be set}`.","If you are not on Windows, remove the npipe entry or gate it behind a compose profile/condition."],"exampleFix":"# before\nvolumes:\n  - type: npipe\n    target: \\\\.\\\\pipe\\\\docker_engine\n\n# after\nvolumes:\n  - type: npipe\n    source: \\\\.\\\\pipe\\\\docker_engine\n    target: \\\\.\\\\pipe\\\\docker_engine","handlingStrategy":"validation","validationCode":"for i, v := range serviceVolumes {\n    if v.Type == \"npipe\" && strings.TrimSpace(v.Source) == \"\" {\n        return fmt.Errorf(\"service volume[%d] target=%q: npipe mount requires a non-empty Windows named-pipe source\", i, v.Target)\n    }\n}","typeGuard":null,"tryCatchPattern":"mounts, err := convert.Volumes(serviceVolumes, stackVolumes, namespace)\nif err != nil && strings.Contains(err.Error(), \"invalid npipe source\") {\n    return fmt.Errorf(\"compose config error: %w (set source: to a \\\\\\\\.\\\\\\\\pipe\\\\\\\\... path; guard interpolation with ${VAR:?msg})\", err)\n}","preventionTips":["npipe is Windows-only; always provide a `\\\\.\\\\pipe\\\\...` source.","Gate npipe entries behind a profile/condition on non-Windows hosts.","Use `${VAR:?must be set}` for interpolated pipe names so empties fail loudly."],"tags":["docker","compose","volumes","npipe","windows","config-validation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}