{"record":{"id":"937cc92d578cba6c","repo":"nodejs/node","slug":"reason-truncated-input-n","errorCode":null,"errorMessage":"reason: truncated input\\n","messagePattern":"reason: truncated input\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"info","filePath":"deps/brotli/c/tools/brotli.c","lineNumber":1244,"sourceCode":"  }\n\n  InitializeBuffers(context);\n  for (;;) {\n    /* Early check */\n    if (context->comment_state == COMMENT_BAD) {\n      fprintf(stderr, \"corrupt input [%s]\\n\",\n              PrintablePath(context->current_input_path));\n      if (context->verbosity > 0) {\n        fprintf(stderr, \"reason: comment mismatch\\n\");\n      }\n      return BROTLI_FALSE;\n    }\n    if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) {\n      if (!HasMoreInput(context)) {\n        fprintf(stderr, \"corrupt input [%s]\\n\",\n                PrintablePath(context->current_input_path));\n        if (context->verbosity > 0) {\n          fprintf(stderr, \"reason: truncated input\\n\");\n        }\n        return BROTLI_FALSE;\n      }\n      if (!ProvideInput(context)) return BROTLI_FALSE;\n    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {\n      if (!ProvideOutput(context)) return BROTLI_FALSE;\n    } else if (result == BROTLI_DECODER_RESULT_SUCCESS) {\n      if (!FlushOutput(context)) return BROTLI_FALSE;\n      BROTLI_BOOL has_more_input = (context->available_in != 0);\n      int extra_char = EOF;\n      if (!has_more_input) {\n        extra_char = fgetc(context->fin);\n        if (extra_char != EOF) {\n          has_more_input = BROTLI_TRUE;\n          context->input[0] = (uint8_t)extra_char;\n          context->next_in = context->input;\n          context->available_in = 1;\n        }","sourceCodeStart":1226,"sourceCodeEnd":1262,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/brotli/c/tools/brotli.c#L1226-L1262","documentation":"Verbose diagnostic at brotli.c:1244, printed only when verbosity > 0, right after the 'corrupt input' message at line 1241. It tells the developer that the abort was specifically because the brotli bitstream ended prematurely (truncated input) as opposed to a comment mismatch or decoder format error. The actual failure return is at line 1246.","triggerScenarios":"Same condition as error 722: the decoder requested more input but the file is fully read. This message is emitted only when the user ran the brotli tool with -v (verbosity > 0), making it a diagnostic confirmation of the truncation root cause.","commonSituations":"A developer runs 'brotli -d -v truncated.br' to diagnose why decompression fails. The file was truncated due to an interrupted download, disk-full condition during compression, or an upstream proxy cutting the transfer.","solutions":["Use the confirmed truncation diagnosis to trace where the file was cut short (network, disk, proxy).","Re-acquire the complete file from the original source.","If you generated the file yourself, ensure the compression process completed without error and check available disk space.","For automated pipelines, add a post-transfer size or checksum validation step before attempting decompression."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// This verbose message confirms truncation; the actionable validation\n// is the same as error 722: check file size/checksum before decompression.","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run without -v in production to suppress diagnostic noise.","Add post-transfer integrity checks (size, hash) in automated pipelines.","Monitor compression process exit codes to catch incomplete output files."],"tags":["brotli","decompression","verbose","truncated","diagnostic"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}