{"record":{"id":"adc5d55ca293033c","repo":"ipfs/kubo","slug":"inline-limit-d-exceeds-maximum-allowed-size-of-d","errorCode":null,"errorMessage":"inline-limit %d exceeds maximum allowed size of %d bytes","messagePattern":"inline-limit (.+?) exceeds maximum allowed size of (.+?) bytes","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/add.go","lineNumber":347,"sourceCode":"\t\tsilent, _ := req.Options[silentOptionName].(bool)\n\t\tchunker, _ := req.Options[chunkerOptionName].(string)\n\t\tdopin, _ := req.Options[pinOptionName].(bool)\n\t\tpinName, pinNameSet := req.Options[pinNameOptionName].(string)\n\t\trawblks, rbset := req.Options[rawLeavesOptionName].(bool)\n\t\tmaxFileLinks, maxFileLinksSet := req.Options[maxFileLinksOptionName].(int)\n\t\tmaxDirectoryLinks, maxDirectoryLinksSet := req.Options[maxDirectoryLinksOptionName].(int)\n\t\tmaxHAMTFanout, maxHAMTFanoutSet := req.Options[maxHAMTFanoutOptionName].(int)\n\t\tvar sizeEstimationMode uio.SizeEstimationMode\n\t\tnocopy, _ := req.Options[noCopyOptionName].(bool)\n\t\tfscache, _ := req.Options[fstoreCacheOptionName].(bool)\n\t\tcidVer, cidVerSet := req.Options[cidVersionOptionName].(int)\n\t\thashFunStr, _ := req.Options[hashOptionName].(string)\n\t\tinline, _ := req.Options[inlineOptionName].(bool)\n\t\tinlineLimit, _ := req.Options[inlineLimitOptionName].(int)\n\n\t\t// Validate inline-limit doesn't exceed the maximum identity digest size\n\t\tif inline && inlineLimit > verifcid.DefaultMaxIdentityDigestSize {\n\t\t\treturn fmt.Errorf(\"inline-limit %d exceeds maximum allowed size of %d bytes\", inlineLimit, verifcid.DefaultMaxIdentityDigestSize)\n\t\t}\n\n\t\t// Validate pin name\n\t\tif pinNameSet {\n\t\t\tif err := cmdutils.ValidatePinName(pinName); err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t}\n\n\t\ttoFilesStr, toFilesSet := req.Options[toFilesOptionName].(string)\n\t\tpreserveMode, _ := req.Options[preserveModeOptionName].(bool)\n\t\tpreserveMtime, _ := req.Options[preserveMtimeOptionName].(bool)\n\t\tmode, _ := req.Options[modeOptionName].(uint)\n\t\tmtime, _ := req.Options[mtimeOptionName].(int64)\n\t\tmtimeNsecs, _ := req.Options[mtimeNsecsOptionName].(uint)\n\t\tfastProvideRoot, fastProvideRootSet := req.Options[fastProvideRootOptionName].(bool)\n\t\tfastProvideDAG, fastProvideDAGSet := req.Options[fastProvideDAGOptionName].(bool)\n\t\tfastProvideWait, fastProvideWaitSet := req.Options[fastProvideWaitOptionName].(bool)","sourceCodeStart":329,"sourceCodeEnd":365,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/add.go#L329-L365","documentation":"`ipfs add --inline` embeds small files directly into the CID as an identity multihash; `--inline-limit` caps how many bytes may be inlined. Kubo rejects a limit above verifcid.DefaultMaxIdentityDigestSize (128 bytes) because oversized identity multihashes are forbidden by the verifcid safety rules and break CID verification and interop.","triggerScenarios":"Running `ipfs add --inline --inline-limit=N` (or RPC add with Inline=true, InlineLimit=N) where N > 128. Only fires when --inline is set; a large --inline-limit without --inline passes this check.","commonSituations":"Copying inline-limit values from pre-cap go-ipfs examples; setting a huge limit to try to inline whole small files; scripts computing the limit from input size.","solutions":["Lower --inline-limit to <= 128 (default is 32)","Pass --inline-limit only together with --inline and keep it within the cap","Don't use inline CIDs for bigger payloads; add normally and reference the CID"],"exampleFix":"// before\nipfs add --inline --inline-limit=256 file.txt\n// after\nipfs add --inline --inline-limit=32 file.txt","handlingStrategy":"validation","validationCode":"const maxInline = 128\nif inline && (inlineLimit <= 0 || inlineLimit > maxInline) {\n  return fmt.Errorf(\"--inline-limit must be between 1 and %d\", maxInline)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Cap --inline-limit at 128 in wrapper scripts","Only pass --inline-limit alongside --inline","Rely on the default (32) unless there is a concrete reason to raise it"],"tags":["cli","validation","cid","inline"],"backgroundTag":"inline-limit-exceeds-max","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"}