{"record":{"id":"b0a0793a6f62b8ac","repo":"ipfs/kubo","slug":"unknown-provide-strategy-token-q-in-q","errorCode":null,"errorMessage":"unknown provide strategy token: %q in %q","messagePattern":"unknown provide strategy token: %q in %q","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"config/provide.go","lineNumber":164,"sourceCode":"\t\t\t// empty string (default config) maps to \"all\",\n\t\t\t// but empty tokens from splitting (e.g. \"pinned+\") are invalid\n\t\t\tif s == \"\" {\n\t\t\t\tstrategy |= ProvideStrategyAll\n\t\t\t} else {\n\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","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/config/provide.go#L146-L182","documentation":"ParseProvideStrategy splits Provide.Strategy on '+' and recognizes only: all/flat, pinned, roots, mfs, unique, entities. Any other token hits the default branch and returns this error naming both the bad token and the full strategy string.","triggerScenarios":"Setting Provide.Strategy containing an unrecognized token — e.g. 'everything', 'pins' (singular), 'flat+unique' with a typo like 'flatt', or an old strategy name removed in newer kubo — at daemon startup or via ValidateProvideConfig.","commonSituations":"Copying a strategy string from an older kubo version or another implementation with different vocabulary; misremembering token names ('pins' vs 'pinned'); typos in deployment automation.","solutions":["Replace the token with a valid one: all|flat, pinned, roots, mfs, unique, entities — e.g. ipfs config Provide.Strategy 'pinned+mfs'","Check the current vocabulary in docs/config.md under Provide.Strategy for your kubo version","If migrating from an old value like 'flat', note it is now a synonym of 'all': ipfs config Provide.Strategy all"],"exampleFix":"// before\nipfs config Provide.Strategy 'pins+mfs'\n// after\nipfs config Provide.Strategy 'pinned+mfs'","handlingStrategy":"validation","validationCode":"validTokens := map[string]struct{}{\"all\": {}, \"flat\": {}, \"pinned\": {}, \"roots\": {}, \"mfs\": {}, \"unique\": {}, \"entities\": {}}\nfor part := range strings.SplitSeq(s, \"+\") {\n\tif _, ok := validTokens[part]; !ok {\n\t\treturn fmt.Errorf(\"unknown token %q\", part)\n\t}\n}","typeGuard":"func isValidStrategyToken(t string) bool {\n\tswitch t {\n\tcase \"all\", \"flat\", \"pinned\", \"roots\", \"mfs\", \"unique\", \"entities\":\n\t\treturn true\n\t}\n\treturn false\n}","tryCatchPattern":"strategy, err := config.ParseProvideStrategy(s)\nif err != nil {\n\treturn fmt.Errorf(\"Provide.Strategy %q invalid: %w\", s, err)\n}","preventionTips":["Check docs/config.md Provide.Strategy for the token list of your kubo version","Use plurals as documented: 'pinned' not 'pins', 'roots' not 'root'","Validate strategy strings in deployment scripts before writing them to config"],"tags":["config","provide","parsing","dht"],"backgroundTag":"invalid-enum-value","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"}