{"record":{"id":"d2d997c8de8e28aa","repo":"aeron-io/aeron","slug":"invalid-errorbufferlength-errorbufferlength","errorCode":null,"errorMessage":"invalid errorBufferLength=${errorBufferLength}","messagePattern":"invalid errorBufferLength=(.+?)","errorType":"validation","errorClass":"ConfigurationException","httpStatus":null,"severity":"error","filePath":"aeron-archive/src/main/java/io/aeron/archive/Archive.java","lineNumber":1320,"sourceCode":"\n            if (null == nanoClock)\n            {\n                nanoClock = SystemNanoClock.INSTANCE;\n            }\n\n            if (null != aeron)\n            {\n                aeronDirectoryName = aeron.context().aeronDirectoryName();\n            }\n\n            concludeArchiveId();\n\n            if (null == markFile)\n            {\n                if (errorBufferLength < ERROR_BUFFER_LENGTH_DEFAULT ||\n                    errorBufferLength > Integer.MAX_VALUE - ArchiveMarkFile.HEADER_LENGTH)\n                {\n                    throw new ConfigurationException(\"invalid errorBufferLength=\" + errorBufferLength);\n                }\n\n                markFile = new ArchiveMarkFile(this);\n            }\n\n            MarkFile.ensureMarkFileLink(\n                archiveDir,\n                new File(markFile.parentDirectory(), ArchiveMarkFile.FILENAME),\n                ArchiveMarkFile.LINK_FILENAME);\n\n            errorHandler = CommonContext.setupErrorHandler(\n                errorHandler, new DistinctErrorLog(markFile.errorBuffer(), epochClock, US_ASCII));\n\n            final ExpandableArrayBuffer tempBuffer = new ExpandableArrayBuffer();\n\n            final String clientName = \"archive archiveId=\" + archiveId;\n            if (null == aeron)\n            {","sourceCodeStart":1302,"sourceCodeEnd":1338,"githubUrl":"https://github.com/aeron-io/aeron/blob/6d60124e15e35c11b49ba2e3c2c2858a09a18803/aeron-archive/src/main/java/io/aeron/archive/Archive.java#L1302-L1338","documentation":"errorBufferLength sizes the in-memory error buffer written into the ArchiveMarkFile header. When no pre-built markFile is supplied, conclude() requires ERROR_BUFFER_LENGTH_DEFAULT <= errorBufferLength <= Integer.MAX_VALUE - ArchiveMarkFile.HEADER_LENGTH so the buffer fits in the mark file header; otherwise this ConfigurationException is thrown.","triggerScenarios":"Setting aeron.archive.mark.file.error.buffer.length (or ctx.errorBufferLength(...)) to a negative value, zero, a value below the default (1024), or a value so large it overflows when the mark-file header length is added.","commonSituations":"Trying to enlarge the error buffer to capture many errors with an over-large value; typos producing tiny/negative sizes; copying a driver-level error buffer length that exceeds the archive mark-file limit.","solutions":["Set errorBufferLength to the default 1024 or a modest larger value (e.g. 4096) within the valid range","Compute an upper bound: value must be <= Integer.MAX_VALUE - ArchiveMarkFile.HEADER_LENGTH","Remove the override to use Archive.Configuration.ERROR_BUFFER_LENGTH_DEFAULT"],"exampleFix":"// before\nctx.errorBufferLength(Integer.MAX_VALUE); // overflows with header length\n// after\nctx.errorBufferLength(1024);","handlingStrategy":"validation","validationCode":"int v = ctx.errorBufferLength();\nif (v < 1024 || v > Integer.MAX_VALUE - ArchiveMarkFile.HEADER_LENGTH) {\n    throw new IllegalArgumentException(\"errorBufferLength out of range\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep errorBufferLength at the default 1024 unless you need larger error capture","Cap any computed size at Integer.MAX_VALUE - ArchiveMarkFile.HEADER_LENGTH","Do not reuse driver error buffer sizes for the archive mark file"],"tags":["configuration","aeron-archive","mark-file","value-out-of-range"],"backgroundTag":"value-out-of-range","analyzedSha":"6d60124e15e35c11b49ba2e3c2c2858a09a18803","analyzedAt":"2026-09-12T11:17:07.683Z","contentChangedAt":"2026-09-12T11:17:07.683Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}