{"record":{"id":"49839114310640ae","repo":"ipfs/kubo","slug":"can-t-publish-while-offline-pass-allow-offline","errorCode":null,"errorMessage":"can't publish while offline: pass `--allow-offline` to override or `--allow-delegated` if Ipns.DelegatedPublishers are set up","messagePattern":"can't publish while offline: pass `--allow-offline` to override or `--allow-delegated` if Ipns\\.DelegatedPublishers are set up","errorType":"exception","errorClass":"errAllowOffline","httpStatus":null,"severity":"error","filePath":"core/commands/name/publish.go","lineNumber":19,"sourceCode":"package name\n\nimport (\n\t\"errors\"\n\t\"fmt\"\n\t\"io\"\n\t\"time\"\n\n\tcmdenv \"github.com/ipfs/kubo/core/commands/cmdenv\"\n\t\"github.com/ipfs/kubo/core/commands/cmdutils\"\n\n\tipns \"github.com/ipfs/boxo/ipns\"\n\tcmds \"github.com/ipfs/go-ipfs-cmds\"\n\tke \"github.com/ipfs/kubo/core/commands/keyencode\"\n\tiface \"github.com/ipfs/kubo/core/coreiface\"\n\toptions \"github.com/ipfs/kubo/core/coreiface/options\"\n)\n\nvar errAllowOffline = errors.New(\"can't publish while offline: pass `--allow-offline` to override or `--allow-delegated` if Ipns.DelegatedPublishers are set up\")\n\nconst (\n\tipfsPathOptionName       = \"ipfs-path\"\n\tresolveOptionName        = \"resolve\"\n\tallowOfflineOptionName   = \"allow-offline\"\n\tallowDelegatedOptionName = \"allow-delegated\"\n\tlifeTimeOptionName       = \"lifetime\"\n\tttlOptionName            = \"ttl\"\n\tkeyOptionName            = \"key\"\n\tquieterOptionName        = \"quieter\"\n\tv1compatOptionName       = \"v1compat\"\n\tsequenceOptionName       = \"sequence\"\n)\n\nvar PublishCmd = &cmds.Command{\n\tHelptext: cmds.HelpText{\n\t\tTagline: \"Publish IPNS names.\",\n\t\tShortDescription: `","sourceCodeStart":1,"sourceCodeEnd":37,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/name/publish.go#L1-L37","documentation":"Sentinel error substituted for iface.ErrOffline when 'ipfs name publish' runs while the node is offline: publishing to the DHT needs network connectivity. It tells the user the two supported offline escape hatches (--allow-offline for local-only publish, --allow-delegated when Ipns.DelegatedPublishers are configured).","triggerScenarios":"Thrown at core/commands/name/publish.go:19 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Bring the daemon online (wait for DHT connectivity) and retry the publish","Pass --allow-offline to publish only to the local datastore without network","If Ipns.DelegatedPublishers are set up, pass --allow-delegated to publish via the HTTP delegated publishers"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}