{"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/e9452d6e785f6e365712b9d71bd7517591773c86/cli/compose/convert/volume.go#L158-L194","documentation":"Raised by handleNpipeToMount when a `type: npipe` (Windows named pipe) service volume has an empty `source`. An npipe mount forwards a specific host named pipe (e.g. \\\\.\\pipe\\docker_engine) into the container, so the source pipe path is mandatory.","triggerScenarios":"ServiceVolumeConfig with Type npipe and Source == \"\" during `docker stack deploy` conversion — e.g. long-syntax entry with only `target:` set.","commonSituations":"Windows containers mounting the Docker engine pipe but omitting `source:`; templated compose files where the source variable expands to empty; confusing npipe with tmpfs (which requires an empty source).","solutions":["Add the host named-pipe path as `source:`, e.g. `source: \\\\.\\pipe\\docker_engine`","Check that any environment variable used for the source is actually set at deploy time"],"exampleFix":"# before\nvolumes:\n  - type: npipe\n    target: \\\\.\\pipe\\docker_engine\n# after\nvolumes:\n  - type: npipe\n    source: \\\\.\\pipe\\docker_engine\n    target: \\\\.\\pipe\\docker_engine","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":["docker","compose","stack-deploy","npipe","windows","config-validation"],"analyzedSha":"e9452d6e785f6e365712b9d71bd7517591773c86","analyzedAt":"2026-08-01T07:09:22.474Z","schemaVersion":2}