{"record":{"id":"17caa11959e44c4c","repo":"ipfs/kubo","slug":"invalid-configuration-profile-s","errorCode":null,"errorMessage":"invalid configuration profile: %s","messagePattern":"invalid configuration profile: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cmd/ipfs/kubo/init.go","lineNumber":138,"sourceCode":"\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\tprofiles, _ := req.Options[profileOptionName].(string)\n\t\treturn doInit(os.Stdout, cctx.ConfigRoot, empty, profiles, conf)\n\t},\n}\n\nfunc applyProfiles(conf *config.Config, profiles string) error {\n\tif profiles == \"\" {\n\t\treturn nil\n\t}\n\n\tfor profile := range strings.SplitSeq(profiles, \",\") {\n\t\ttransformer, ok := config.Profiles[profile]\n\t\tif !ok {\n\t\t\treturn fmt.Errorf(\"invalid configuration profile: %s\", profile)\n\t\t}\n\n\t\tif err := transformer.Transform(conf); err != nil {\n\t\t\treturn err\n\t\t}\n\t}\n\treturn nil\n}\n\nfunc doInit(out io.Writer, repoRoot string, empty bool, confProfiles string, conf *config.Config) error {\n\tif _, err := fmt.Fprintf(out, \"initializing IPFS node at %s\\n\", repoRoot); err != nil {\n\t\treturn err\n\t}\n\n\tif err := checkWritable(repoRoot); err != nil {\n\t\treturn err\n\t}\n","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/cmd/ipfs/kubo/init.go#L120-L156","documentation":"Thrown by applyProfiles during `ipfs init --profile <name>` when a profile name given by the user is not a registered key in config.Profiles. Kubo validates each comma-separated profile name before applying its transformer; an unknown name aborts initialization before any repo is created. Profiles are fixed sets of config transforms (server, datastore, flatfs, local-discovery, randomports, etc.) defined in the config package.","triggerScenarios":"Running `ipfs init --profile <name>` (or Init initializer with Profiles option) where <name> is misspelled, does not exist, or a comma-separated list contains any single invalid entry. Note the split uses strings.SplitSeq on ',', so an empty segment (trailing comma like 'server,') also fails.","commonSituations":"Typos such as `--profile servers` instead of `server`; copying profile names from older docs that have since been renamed or removed; scripting with interpolated empty profile variables producing a trailing comma.","solutions":["Run `ipfs init --help` and use one of the listed profile names exactly (e.g. server, datastore, flatfs, local-discovery, randomports, badgerds, lowpower, test-profile).","Check for stray commas or whitespace in the --profile value and fix the list (e.g. 'server,randomports').","If you need config not covered by a profile, initialize without --profile and edit the repo config afterwards with `ipfs config`."],"exampleFix":"// before\nipfs init --profile servers\n// after\nipfs init --profile server","handlingStrategy":"validation","validationCode":"// validate profile names before running init\nprofiles := \"server,randomports\"\nfor p := range strings.SplitSeq(profiles, \",\") {\n\tif _, ok := config.Profiles[p]; !ok {\n\t\treturn fmt.Errorf(\"unknown profile %q; see `ipfs init --help`\", p)\n\t}\n}\nipfsInit.Init(ipfsPath, config.Profiles(profiles))","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Copy profile names only from `ipfs init --help` output, not from memory or stale docs","Avoid building profile lists programmatically without trimming empties (strip trailing commas)"],"tags":["cli","init","config","validation"],"backgroundTag":"invalid-config-profile","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"}