{"record":{"id":"940db97dba320992","repo":"ipfs/kubo","slug":"existing-ipns-record-has-sequence-d-new-record","errorCode":null,"errorMessage":"existing IPNS record has sequence %d >= new record sequence %d, use 'ipfs name put --force' to skip this check","messagePattern":"existing IPNS record has sequence (.+?) >= new record sequence (.+?), use 'ipfs name put --force' to skip this check","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/name/name.go","lineNumber":520,"sourceCode":"\n\t\t\t// Validate signature against provided name\n\t\t\terr = ipns.ValidateWithName(rec, name)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"record validation failed: %w\", err)\n\t\t\t}\n\n\t\t\t// Check for sequence conflicts with existing record\n\t\t\texistingData, err := api.Routing().Get(req.Context, nameArg)\n\t\t\tif err == nil {\n\t\t\t\t// Allow republishing the exact same record (common use case:\n\t\t\t\t// get a third-party record and put it back to refresh DHT)\n\t\t\t\tif !bytes.Equal(existingData, data) {\n\t\t\t\t\texistingRec, parseErr := ipns.UnmarshalRecord(existingData)\n\t\t\t\t\tif parseErr == nil {\n\t\t\t\t\t\texistingSeq, seqErr := existingRec.Sequence()\n\t\t\t\t\t\tnewSeq, newSeqErr := rec.Sequence()\n\t\t\t\t\t\tif seqErr == nil && newSeqErr == nil && existingSeq >= newSeq {\n\t\t\t\t\t\t\treturn fmt.Errorf(\"existing IPNS record has sequence %d >= new record sequence %d, use 'ipfs name put --force' to skip this check\", existingSeq, newSeq)\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t// If Get fails (no existing record), that's fine - proceed with put\n\t\t}\n\n\t\t// Publish the original bytes as-is\n\t\t// When allowDelegated is true, we set allowOffline to allow the operation\n\t\t// even without DHT connectivity (delegated publishers use HTTP)\n\t\topts := []options.RoutingPutOption{\n\t\t\toptions.Routing.AllowOffline(allowOffline || allowDelegated),\n\t\t}\n\n\t\terr = api.Routing().Put(req.Context, nameArg, data, opts...)\n\t\tif err != nil {\n\t\t\tif err.Error() == \"can't put while offline\" {\n\t\t\t\treturn errPutAllowOffline","sourceCodeStart":502,"sourceCodeEnd":538,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/name/name.go#L502-L538","documentation":"Routing already holds a record for this name whose sequence number is greater than or equal to the one being published. Republishing the byte-identical record is allowed (DHT refresh use case); any different record with a non-increasing sequence is rejected to prevent rolling back a name.","triggerScenarios":"Thrown at core/commands/name/name.go:520 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Publish a record with a higher sequence number (--sequence) so it supersedes the existing one","If you are intentionally re-publishing older content (e.g. reverting a name), pass --force to skip the sequence check","If you only meant to refresh the DHT entry, publish the exact same record bytes, which is permitted"],"exampleFix":null,"handlingStrategy":"validation","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"}