{"record":{"id":"2d75f7295fab9bed","repo":"docker/cli","slug":"volume-options-are-incompatible-with-type-npipe","errorCode":null,"errorMessage":"volume options are incompatible with type npipe","messagePattern":"volume options are incompatible with type npipe","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":179,"sourceCode":"\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\nfunc handleClusterToMount(\n\tvolume composetypes.ServiceVolumeConfig,\n\tstackVolumes volumes,","sourceCodeStart":161,"sourceCodeEnd":197,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/compose/convert/volume.go#L161-L197","documentation":"Returned by handleNpipeToMount (cli/compose/convert/volume.go:178-179). Named-pipe mounts do not use named-volume options (nocopy/subpath); supplying a `volume:` block on an npipe entry is contradictory and is rejected. Note the handler intentionally allows a `bind:` block (for propagation) — only volume options are refused.","triggerScenarios":"ServiceVolumeConfig with Type==\"npipe\" and Volume!=nil passed to convertVolumeToMount().","commonSituations":"Adapting a named-volume entry into an npipe entry and leaving the `volume:` block; copy-paste between definitions.","solutions":["Remove the `volume:` options block from the npipe entry.","If propagation is needed, use `bind: { propagation: ... }` (npipe accepts it) instead."],"exampleFix":"# before\nvolumes:\n  - type: npipe\n    source: \\\\.\\\\pipe\\\\engine\n    target: \\\\.\\\\pipe\\\\engine\n    volume:\n      nocopy: true\n\n# after\nvolumes:\n  - type: npipe\n    source: \\\\.\\\\pipe\\\\engine\n    target: \\\\.\\\\pipe\\\\engine","handlingStrategy":"validation","validationCode":"for i, v := range serviceVolumes {\n    if v.Type == \"npipe\" && v.Volume != nil {\n        return fmt.Errorf(\"service volume[%d] target=%q: type npipe must not declare a volume block (use bind: for propagation)\", i, v.Target)\n    }\n}","typeGuard":null,"tryCatchPattern":"mounts, err := convert.Volumes(serviceVolumes, stackVolumes, namespace)\nif err != nil && strings.Contains(err.Error(), \"volume options are incompatible with type npipe\") {\n    return fmt.Errorf(\"compose config error: %w (remove the volume: block; npipe accepts bind: for propagation)\", err)\n}","preventionTips":["Remember npipe is the one non-bind type that accepts a `bind:` block (for propagation) — but never a `volume:` block.","Avoid reusing named-volume templates for npipe entries."],"tags":["docker","compose","volumes","npipe","named-volume","config-validation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}