{"record":{"id":"83bebf0eaa91b4b4","repo":"ipfs/kubo","slug":"config-setting-ipns-recordlifetime-s-must-be","errorCode":null,"errorMessage":"config setting IPNS.RecordLifetime (%s) must be >= IPNS.RepublishPeriod (%s), otherwise records expire before they are republished","messagePattern":"config setting IPNS\\.RecordLifetime \\((.+?)\\) must be >= IPNS\\.RepublishPeriod \\((.+?)\\), otherwise records expire before they are republished","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/node/ipns.go","lineNumber":65,"sourceCode":"// IpnsRepublisher runs new IPNS republisher service\nfunc IpnsRepublisher(repubPeriod time.Duration, recordLifetime time.Duration) func(lcStartStop, namesys.NameSystem, repo.Repo, crypto.PrivKey) error {\n\treturn func(lc lcStartStop, namesys namesys.NameSystem, repo repo.Repo, privKey crypto.PrivKey) error {\n\t\trepub := republisher.NewRepublisher(namesys, repo.Datastore(), privKey, repo.Keystore())\n\n\t\tif repubPeriod != 0 {\n\t\t\tif !util.Debug && (repubPeriod < time.Minute || repubPeriod > (time.Hour*24)) {\n\t\t\t\treturn fmt.Errorf(\"config setting IPNS.RepublishPeriod is not between 1min and 1day: %s\", repubPeriod)\n\t\t\t}\n\n\t\t\trepub.Interval = repubPeriod\n\t\t}\n\n\t\tif recordLifetime != 0 {\n\t\t\trepub.RecordLifetime = recordLifetime\n\t\t}\n\n\t\tif repub.RecordLifetime < repub.Interval {\n\t\t\treturn fmt.Errorf(\"config setting IPNS.RecordLifetime (%s) must be >= IPNS.RepublishPeriod (%s), otherwise records expire before they are republished\", repub.RecordLifetime, repub.Interval)\n\t\t}\n\n\t\tlc.Append(repub.Run)\n\t\treturn nil\n\t}\n}\n","sourceCodeStart":47,"sourceCodeEnd":72,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/node/ipns.go#L47-L72","documentation":"Before starting the IPNS republisher, Kubo checks that the record lifetime is at least as long as the republish interval. If records expire sooner than they are republished, published names would silently go stale, so startup fails with this error instead.","triggerScenarios":"Configuring IPNS.RecordLifetime shorter than IPNS.RepublishPeriod (e.g. RepublishPeriod=4h, RecordLifetime=1h) and starting the daemon; both values default in and only the explicit combination triggers it.","commonSituations":"Users setting a short RecordLifetime to \"expire names quickly\" without realizing it must still exceed the republish interval; mixed defaults where only RecordLifetime was customized while a large RepublishPeriod remained.","solutions":["Raise RecordLifetime to be >= RepublishPeriod: `ipfs config Ipns.RecordLifetime 8h` (if RepublishPeriod is 4h)","Or lower RepublishPeriod so it fits under RecordLifetime: `ipfs config Ipns.RepublishPeriod 30m`","Clear one or both settings (`ipfs config --json Ipns.RecordLifetime \"\"`) to return to defaults where the invariant holds"],"exampleFix":"// before (config.json)\n\"Ipns\": { \"RepublishPeriod\": \"4h\", \"RecordLifetime\": \"1h\" }\n// after\n\"Ipns\": { \"RepublishPeriod\": \"4h\", \"RecordLifetime\": \"8h\" }","handlingStrategy":"validation","validationCode":"if recordLifetime != 0 && recordLifetime < repubPeriod {\n    return fmt.Errorf(\"RecordLifetime (%s) must be >= RepublishPeriod (%s)\", recordLifetime, repubPeriod)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always set RecordLifetime >= RepublishPeriod when overriding either","When changing one IPNS timing option, review both RepublishPeriod and RecordLifetime together"],"tags":["ipns","config","validation"],"backgroundTag":"config-value-out-of-range","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"}