nodejs/node · info

reason: truncated input\n

Error message

reason: truncated input\n

What it means

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.

Source

Thrown at deps/brotli/c/tools/brotli.c:1244

  }

  InitializeBuffers(context);
  for (;;) {
    /* Early check */
    if (context->comment_state == COMMENT_BAD) {
      fprintf(stderr, "corrupt input [%s]\n",
              PrintablePath(context->current_input_path));
      if (context->verbosity > 0) {
        fprintf(stderr, "reason: comment mismatch\n");
      }
      return BROTLI_FALSE;
    }
    if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT) {
      if (!HasMoreInput(context)) {
        fprintf(stderr, "corrupt input [%s]\n",
                PrintablePath(context->current_input_path));
        if (context->verbosity > 0) {
          fprintf(stderr, "reason: truncated input\n");
        }
        return BROTLI_FALSE;
      }
      if (!ProvideInput(context)) return BROTLI_FALSE;
    } else if (result == BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT) {
      if (!ProvideOutput(context)) return BROTLI_FALSE;
    } else if (result == BROTLI_DECODER_RESULT_SUCCESS) {
      if (!FlushOutput(context)) return BROTLI_FALSE;
      BROTLI_BOOL has_more_input = (context->available_in != 0);
      int extra_char = EOF;
      if (!has_more_input) {
        extra_char = fgetc(context->fin);
        if (extra_char != EOF) {
          has_more_input = BROTLI_TRUE;
          context->input[0] = (uint8_t)extra_char;
          context->next_in = context->input;
          context->available_in = 1;
        }

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Use the confirmed truncation diagnosis to trace where the file was cut short (network, disk, proxy).
  2. Re-acquire the complete file from the original source.
  3. If you generated the file yourself, ensure the compression process completed without error and check available disk space.
  4. For automated pipelines, add a post-transfer size or checksum validation step before attempting decompression.
Defensive patterns

Strategy: validation

Validate before calling

// This verbose message confirms truncation; the actionable validation
// is the same as error 722: check file size/checksum before decompression.

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/937cc92d578cba6c. Report an issue: GitHub.