{"record":{"id":"10dc1d69f2a252a1","repo":"ipfs/kubo","slug":"all-strategy-cannot-be-combined-with-other-strat","errorCode":null,"errorMessage":"\"all\" strategy cannot be combined with other strategies in %q","messagePattern":"\"all\" strategy cannot be combined with other strategies in %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/provide.go","lineNumber":169,"sourceCode":"\t\t\t\treturn 0, fmt.Errorf(\"invalid provide strategy: empty token in %q\", s)\n\t\t\t}\n\t\tcase \"pinned\":\n\t\t\tstrategy |= ProvideStrategyPinned\n\t\tcase \"roots\":\n\t\t\tstrategy |= ProvideStrategyRoots\n\t\tcase \"mfs\":\n\t\t\tstrategy |= ProvideStrategyMFS\n\t\tcase \"unique\":\n\t\t\tstrategy |= ProvideStrategyUnique\n\t\tcase \"entities\":\n\t\t\tstrategy |= ProvideStrategyEntities | ProvideStrategyUnique\n\t\tdefault:\n\t\t\treturn 0, fmt.Errorf(\"unknown provide strategy token: %q in %q\", part, s)\n\t\t}\n\t}\n\t// \"all\" provides every block and cannot be combined with selective strategies\n\tif strategy&ProvideStrategyAll != 0 && strategy != ProvideStrategyAll {\n\t\treturn 0, fmt.Errorf(\"\\\"all\\\" strategy cannot be combined with other strategies in %q\", s)\n\t}\n\t// +unique/+entities require a base strategy that walks DAGs (pinned and/or mfs)\n\twantsDedup := strategy&(ProvideStrategyUnique|ProvideStrategyEntities) != 0\n\tif wantsDedup {\n\t\twalksDAGs := strategy&(ProvideStrategyPinned|ProvideStrategyMFS) != 0\n\t\tif !walksDAGs {\n\t\t\treturn 0, fmt.Errorf(\"+unique/+entities must combine with pinned and/or mfs in %q\", s)\n\t\t}\n\t\tif strategy&ProvideStrategyRoots != 0 {\n\t\t\treturn 0, fmt.Errorf(\"+unique/+entities is incompatible with roots in %q\", s)\n\t\t}\n\t}\n\treturn strategy, nil\n}\n\n// MustParseProvideStrategy is like ParseProvideStrategy but panics on error.\n// Use with strategy strings that have already been validated at startup.\nfunc MustParseProvideStrategy(s string) ProvideStrategy {","sourceCodeStart":151,"sourceCodeEnd":187,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/config/provide.go#L151-L187","documentation":"'all' (or its alias 'flat') means provide every block in the store; it is mutually exclusive with the selective strategies (pinned, roots, mfs). ParseProvideStrategy rejects any combination where ProvideStrategyAll is set together with other bits and returns this error for the offending string.","triggerScenarios":"Setting Provide.Strategy to combinations like 'all+pinned', 'flat+mfs', or 'all+roots' — any string containing 'all'/'flat' plus at least one other token — at daemon startup or via ValidateProvideConfig.","commonSituations":"Appending a selective token to a default 'all' strategy when tuning provide bandwidth; scripted merging of strategy fragments that join 'all' with others; misunderstanding that 'all' is a base to be extended rather than an exclusive mode.","solutions":["Pick one mode: use 'all' alone for full coverage, or drop 'all' and keep only selective tokens: ipfs config Provide.Strategy 'pinned+mfs'","If the goal is bandwidth reduction, replace 'all' with 'pinned+mfs' (optionally '+unique')","Reset to default: ipfs config Provide.Strategy '' (empty maps to 'all')"],"exampleFix":"// before\nipfs config Provide.Strategy 'all+pinned'\n// after\nipfs config Provide.Strategy 'pinned'","handlingStrategy":"validation","validationCode":"if (strings.Contains(s, \"all\") || strings.Contains(s, \"flat\")) && strings.ContainsAny(strings.TrimPrefix(strings.TrimPrefix(s, \"all\"), \"flat\"), \"+\") {\n\treturn fmt.Errorf(\"'all' cannot be combined: %q\", s)\n}","typeGuard":"func isExclusiveAll(s string) bool {\n\tst, err := config.ParseProvideStrategy(s)\n\t_ = st\n\treturn err != nil && strings.Contains(err.Error(), \"cannot be combined\")\n}","tryCatchPattern":"strategy, err := config.ParseProvideStrategy(s)\nif err != nil {\n\treturn fmt.Errorf(\"Provide.Strategy %q invalid: %w\", s, err)\n}","preventionTips":["Treat 'all'/'flat' as a standalone mode, never a base for modifiers","For selective providing start from 'pinned+mfs' and add modifiers","Empty string already means 'all' — do not spell it out plus extras"],"tags":["config","provide","dht","validation"],"backgroundTag":"incompatible-strategy-combination","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}