{"record":{"id":"2686a55f0b9f8c5a","repo":"ipfs/kubo","slug":"record-exceeds-maximum-size-of-d-bytes-use-for","errorCode":null,"errorMessage":"record exceeds maximum size of %d bytes, use --force to skip size check","messagePattern":"record exceeds maximum size of (.+?) bytes, use --force to skip size check","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/name/name.go","lineNumber":496,"sourceCode":"\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\tdefer file.Close()\n\n\t\t// Read record data (limit to 1 MiB for memory safety)\n\t\tdata, err := io.ReadAll(io.LimitReader(file, 1<<20))\n\t\tif err != nil {\n\t\t\treturn fmt.Errorf(\"failed to read record: %w\", err)\n\t\t}\n\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) {","sourceCodeStart":478,"sourceCodeEnd":514,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/name/name.go#L478-L514","documentation":"Size-limit validation in `ipfs name publish --file`: the supplied raw IPNS record is larger than maxIPNSRecordSize, the maximum allowed by the IPNS record spec. The check runs unless --force is given, protecting nodes from oversized records that peers will reject anyway; --force skips only this size check, not signature validation.","triggerScenarios":"Thrown at core/commands/name/name.go:496 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Trim the record's value or V1Signature/V2Signature payload to fit the limit","Re-generate the record for a smaller path/value","Use --force to publish anyway, accepting that compliant peers may reject the record"],"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"}