{"record":{"id":"f46bc40b1879adb5","repo":"ipfs/kubo","slug":"failed-to-read-config-w","errorCode":null,"errorMessage":"failed to read config: %w","messagePattern":"failed to read config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/name/name.go","lineNumber":454,"sourceCode":"\t\t\treturn err\n\t\t}\n\n\t\t// Parse options\n\t\tforce, _ := req.Options[forceOptionName].(bool)\n\t\tallowOffline, _ := req.Options[putAllowOfflineOption].(bool)\n\t\tallowDelegated, _ := req.Options[allowDelegatedOption].(bool)\n\n\t\t// Validate flag combinations\n\t\tif allowOffline && allowDelegated {\n\t\t\treturn errors.New(\"cannot use both --allow-offline and --allow-delegated flags\")\n\t\t}\n\n\t\t// Handle different publishing modes\n\t\tif allowDelegated {\n\t\t\t// AllowDelegated mode: check if delegated publishers are configured\n\t\t\tcfg, err := nd.Repo.Config()\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"failed to read config: %w\", err)\n\t\t\t}\n\t\t\tdelegatedPublishers := cfg.DelegatedPublishersWithAutoConf()\n\t\t\tif len(delegatedPublishers) == 0 {\n\t\t\t\treturn errors.New(\"no delegated publishers configured: add Ipns.DelegatedPublishers or use --allow-offline for local-only publishing\")\n\t\t\t}\n\t\t\t// For allow-delegated mode, we proceed even if offline\n\t\t\t// since we're using HTTP publishing via delegated publishers\n\t\t}\n\n\t\t// Parse the IPNS name argument\n\t\tnameArg := req.Arguments[0]\n\t\tif !strings.HasPrefix(nameArg, \"/ipns/\") {\n\t\t\tnameArg = \"/ipns/\" + nameArg\n\t\t}\n\t\t// Extract the name part after /ipns/\n\t\tnamePart := strings.TrimPrefix(nameArg, \"/ipns/\")\n\t\tname, err := ipns.NameFromString(namePart)\n\t\tif err != nil {","sourceCodeStart":436,"sourceCodeEnd":472,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/name/name.go#L436-L472","documentation":"Returned when `ipfs ipns put --allow-delegated` cannot read the node configuration (nd.Repo.Config() failed) while checking whether delegated publishers are set up. Wraps the underlying repo/config read error.","triggerScenarios":"`ipfs ipns put --allow-delegated` executed against a node whose repo config cannot be read — corrupted config file, permission denied on the config file, repo lock/unavailable state.","commonSituations":"Running the command as a different user than the daemon (permission mismatch on IPFS_PATH), malformed JSON in the config after manual edits, or read-only filesystem.","solutions":["Check permissions on $IPFS_PATH/config and that the command runs as the repo owner","Validate the config JSON: `ipfs config show` and fix syntax errors from manual edits","Restart the daemon/repo access and retry"],"exampleFix":"// before (config unreadable, e.g. owned by root)\nipfs ipns put --allow-delegated --key=self record.bin\n// error: failed to read config: permission denied\n// after\nsudo chown $USER:$USER $IPFS_PATH/config\nipfs ipns put --allow-delegated --key=self record.bin","handlingStrategy":"try-catch","validationCode":"// pre-check config readability\nf, err := os.Open(filepath.Join(ipfsPath, \"config\"))\nif err != nil { /* fix permissions first */ }","typeGuard":null,"tryCatchPattern":"cfg, err := node.Repo.Config()\nif err != nil {\n    return fmt.Errorf(\"failed to read config: %w\", err)\n}","preventionTips":["Run CLI commands as the same user that owns IPFS_PATH","Validate config JSON after manual edits (ipfs config show)"],"tags":["ipns","config","io"],"backgroundTag":"config-read-failed","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"}