nodejs/node · error

couldn't write bundle %s. Error:%s

Error message

couldn't write bundle %s. Error:%s

What it means

After genrb constructs the output filename and attempts to write the bundle (as binary .res, Java source, or XLIFF XML), the write operation returned a UErrorCode failure. This is genrb's final output write-failure exit point — the resource bundle was parsed and assembled successfully, but could not be serialized to disk.

Source

Thrown at deps/icu-small/source/tools/genrb/genrb.cpp:764

    if(U_FAILURE(status)) {
        fprintf(stderr, "couldn't make the res fileName for  bundle %s. Error:%s\n",
                filename, u_errorName(status));
        return;
    }
    if(write_java== true){
        bundle_write_java(data.getAlias(), outputDir, outputEnc,
                          outputFileName, sizeof(outputFileName),
                          options[JAVA_PACKAGE].value, options[BUNDLE_NAME].value, &status);
    }else if(write_xliff ==true){
        bundle_write_xml(data.getAlias(), outputDir, outputEnc,
                         filename, outputFileName, sizeof(outputFileName),
                         language, xliffOutputFileName, &status);
    }else{
        /* Write the data to the file */
        data->write(outputDir, packageName, outputFileName, sizeof(outputFileName), status);
    }
    if (U_FAILURE(status)) {
        fprintf(stderr, "couldn't write bundle %s. Error:%s\n", outputFileName, u_errorName(status));
    }
}

/* Generate the target .res file name from the input file name */
static char*
make_res_filename(const char *filename,
                  const char *outputDir,
                  const char *packageName,
                  UErrorCode &status) {
    char *basename;
    char *dirname;
    char *resName;

    int32_t pkgLen = 0; /* length of package prefix */


    if (U_FAILURE(status)) {
        return nullptr;

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Check that the output directory exists and has write permissions: `mkdir -p <outputDir> && chmod u+w <outputDir>`
  2. Verify available disk space: `df -h <outputDir>`
  3. Check the u_errorName code — U_FILE_ACCESS_ERROR means permission/path, U_BUFFER_OVERFLOW_ERROR means internal write buffer
  4. Ensure no other process holds a lock on the output file
  5. If writing Java or XLIFF, verify the output encoding (-e option) is valid
Defensive patterns

Strategy: validation

Validate before calling

# Pre-flight check before genrb write phase
OUTPUT_DIR="./output"
mkdir -p "$OUTPUT_DIR"
[ -w "$OUTPUT_DIR" ] || { echo "Cannot write to $OUTPUT_DIR"; exit 1; }
# Check available disk space (need at least 10MB for typical locale builds)
avail_kb=$(df -P "$OUTPUT_DIR" | awk 'NR==2 {print $4}')
[ "$avail_kb" -gt 10240 ] || { echo "Insufficient disk space on $OUTPUT_DIR"; exit 1; }

Prevention

When it happens

Trigger: data->write() fails due to disk full, permission denied, or the output directory not existing. bundle_write_java() or bundle_write_xml() can fail similarly for their respective output formats. The specific failing function depends on the --write-java and --write-xliff options.

Common situations: Output directory was deleted between genrb startup and write time; disk full during a large locale data build; file system permissions changed; network filesystem timeout on the output path; concurrent builds writing to the same output directory.

Related errors


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