{"record":{"id":"1e1b7e9ed980870e","repo":"ipfs/kubo","slug":"failed-to-read-config-w-1e1b7e","errorCode":null,"errorMessage":"failed to read config: %w","messagePattern":"failed to read config: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/coreapi/name.go","lineNumber":53,"sourceCode":"\toptions, err := caopts.NamePublishOptions(opts...)\n\tif err != nil {\n\t\treturn ipns.Name{}, err\n\t}\n\tspan.SetAttributes(\n\t\tattribute.Bool(\"allowoffline\", options.AllowOffline),\n\t\tattribute.String(\"key\", options.Key),\n\t\tattribute.Float64(\"validtime\", options.ValidTime.Seconds()),\n\t)\n\tif options.TTL != nil {\n\t\tspan.SetAttributes(attribute.Float64(\"ttl\", options.TTL.Seconds()))\n\t}\n\n\t// Handle different publishing modes\n\tif options.AllowDelegated {\n\t\t// AllowDelegated mode: check if delegated publishers are configured\n\t\tcfg, err := api.repo.Config()\n\t\tif err != nil {\n\t\t\treturn ipns.Name{}, fmt.Errorf(\"failed to read config: %w\", err)\n\t\t}\n\t\tdelegatedPublishers := cfg.DelegatedPublishersWithAutoConf()\n\t\tif len(delegatedPublishers) == 0 {\n\t\t\treturn ipns.Name{}, errors.New(\"no delegated publishers configured: add Ipns.DelegatedPublishers or use --allow-offline for local-only publishing\")\n\t\t}\n\t\t// For allow-delegated mode, we only require that we have delegated publishers configured\n\t\t// The node doesn't need P2P connectivity since we're using HTTP publishing\n\t} else {\n\t\t// Normal mode: check online status with allow-offline flag\n\t\terr = api.checkOnline(options.AllowOffline)\n\t\tif err != nil {\n\t\t\treturn ipns.Name{}, err\n\t\t}\n\t}\n\n\tk, err := keylookup(api.privateKey, api.repo.Keystore(), options.Key)\n\tif err != nil {\n\t\treturn ipns.Name{}, err","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/coreapi/name.go#L35-L71","documentation":"KeyAPI(name.go).Publish in AllowDelegated mode reads the node config to find configured delegated IPNS publishers. If repo.Config() fails (config unreadable/corrupt/locked), the error is wrapped with this message.","triggerScenarios":"Publishing with AllowDelegated=true while the repo config cannot be read, e.g. corrupted config file, permission denied, or concurrent repo lock issues.","commonSituations":"Wrong IPFS_PATH pointing at a directory without a config; config file with invalid JSON; running as a user without read permission on the repo.","solutions":["Check the wrapped cause (%w) for the underlying read failure and fix it (permissions, JSON syntax).","Verify IPFS_PATH points at an initialized repo: run `ipfs config show`.","Restore the config from backup or re-run `ipfs init` in a fresh path if the config is unrecoverable."],"exampleFix":"// before\nexport IPFS_PATH=/wrong/path\nipfs name publish --delegated <cid>\n// after\nexport IPFS_PATH=$HOME/.ipfs\nipfs config show >/dev/null && ipfs name publish --delegated <cid>","handlingStrategy":"try-catch","validationCode":"if _, err := cfgRoot.Config(); err != nil {\n    return fmt.Errorf(\"repo config unreadable, fix before publishing: %w\", err)\n}","typeGuard":null,"tryCatchPattern":"n, err := api.Name().Publish(ctx, p, opts.AllowDelegated(true))\nvar perr *fs.PathError\nif errors.As(err, &perr) {\n    // permission/path problem on the config file; fix IPFS_PATH or permissions\n}","preventionTips":["Verify IPFS_PATH points at an initialized repo.","Keep config JSON valid; test with `ipfs config show`.","Run daemons as a user with read access to the repo."],"tags":["config","ipns","publish"],"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"}