{"record":{"id":"d290e8c5cf914390","repo":"docker/cli","slug":"bind-options-are-incompatible-with-type-cluster","errorCode":null,"errorMessage":"bind options are incompatible with type cluster","messagePattern":"bind options are incompatible with type cluster","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/compose/convert/volume.go","lineNumber":207,"sourceCode":"\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,\n\tnamespace Namespace,\n) (mount.Mount, error) {\n\tif volume.Source == \"\" {\n\t\treturn mount.Mount{}, errors.New(\"invalid cluster source, source cannot be empty\")\n\t}\n\tif volume.Tmpfs != nil {\n\t\treturn mount.Mount{}, errors.New(\"tmpfs options are incompatible with type cluster\")\n\t}\n\tif volume.Bind != nil {\n\t\treturn mount.Mount{}, errors.New(\"bind options are incompatible with type cluster\")\n\t}\n\tif volume.Volume != nil {\n\t\treturn mount.Mount{}, errors.New(\"volume options are incompatible with type cluster\")\n\t}\n\n\tresult := createMountFromVolume(volume)\n\tresult.ClusterOptions = &mount.ClusterOptions{}\n\n\tif !strings.HasPrefix(volume.Source, \"group:\") {\n\t\t// if the volume is a cluster volume and the source is a volumegroup, we\n\t\t// will ignore checking to see if such a volume is defined. the volume\n\t\t// group isn't namespaced, and there's no simple way to indicate that\n\t\t// external volumes with a given group exist.\n\t\tstackVolume, exists := stackVolumes[volume.Source]\n\t\tif !exists {\n\t\t\treturn mount.Mount{}, fmt.Errorf(\"undefined volume %q\", volume.Source)\n\t\t}\n","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/docker/cli/blob/4f84911bfe8811e9b028e4b1fee8e7510be79387/cli/compose/convert/volume.go#L189-L225","documentation":"Returned by handleClusterToMount (cli/compose/convert/volume.go:206-207). Propagation is a bind-mount concept and does not apply to Swarm cluster volumes, so a `bind:` block on a cluster entry is rejected.","triggerScenarios":"ServiceVolumeConfig with Type==\"cluster\" and Bind!=nil passed to convertVolumeToMount().","commonSituations":"Migrating a bind entry to a cluster volume without stripping the `bind: { propagation: ... }` block; YAML merge pulling in bind options.","solutions":["Remove the `bind:` options block from the cluster entry.","If propagation was genuinely required, restore `type: bind` with a host path source."],"exampleFix":"# before\nvolumes:\n  - type: cluster\n    source: my-cluster-vol\n    target: /data\n    bind:\n      propagation: rshared\n\n# after\nvolumes:\n  - type: cluster\n    source: my-cluster-vol\n    target: /data","handlingStrategy":"validation","validationCode":"for i, v := range serviceVolumes {\n    if v.Type == \"cluster\" && v.Bind != nil {\n        return fmt.Errorf(\"service volume[%d] target=%q: type cluster must not declare a bind block\", i, v.Target)\n    }\n}","typeGuard":null,"tryCatchPattern":"mounts, err := convert.Volumes(serviceVolumes, stackVolumes, namespace)\nif err != nil && strings.Contains(err.Error(), \"bind options are incompatible with type cluster\") {\n    return fmt.Errorf(\"compose config error: %w (remove the bind: block from the cluster entry)\", err)\n}","preventionTips":["Propagation is bind-only; cluster volumes do not accept a bind block.","Audit option blocks whenever changing a volume's `type:`."],"tags":["docker","compose","volumes","cluster-volume","bind-mount","config-validation"],"backgroundTag":null,"analyzedSha":"4f84911bfe8811e9b028e4b1fee8e7510be79387","analyzedAt":"2026-08-07T12:15:29.814Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}