{"record":{"id":"46d32b20fa03318d","repo":"ipfs/kubo","slug":"record-validation-failed-w","errorCode":null,"errorMessage":"record validation failed: %w","messagePattern":"record validation failed: %w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/name/name.go","lineNumber":506,"sourceCode":"\t\tif len(data) == 0 {\n\t\t\treturn errors.New(\"record is empty\")\n\t\t}\n\n\t\t// Validate unless --force\n\t\tif !force {\n\t\t\t// Check size limit per IPNS spec\n\t\t\tif len(data) > maxIPNSRecordSize {\n\t\t\t\treturn fmt.Errorf(\"record exceeds maximum size of %d bytes, use --force to skip size check\", maxIPNSRecordSize)\n\t\t\t}\n\t\t\trec, err := ipns.UnmarshalRecord(data)\n\t\t\tif err != nil {\n\t\t\t\treturn fmt.Errorf(\"invalid IPNS record: %w\", err)\n\t\t\t}\n\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}","sourceCodeStart":488,"sourceCodeEnd":524,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/name/name.go#L488-L524","documentation":"The record unmarshalled fine but ipns.ValidateWithName rejected it against the provided IPNS name: the record's signature does not match the named key, or the record is expired/otherwise invalid per the IPNS spec. Skipped by --force.","triggerScenarios":"Thrown at core/commands/name/name.go:506 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the record was really created by the key matching the --name argument (a record signed by a different key will always fail)","Check the record has not expired (records carry a validity window); re-sign or re-export a fresh record if it has","Pass --force to store the record without signature validation"],"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"}