nodejs/node · error

unable to write the pool bundle: %s

Error message

unable to write the pool bundle: %s

What it means

At the end of main(), if everything else succeeded and --writePoolBundle was requested, genrb calls newPoolBundle->write(...) to emit pool.res into the configured directory. If that write fails (U_FAILURE(status)), the human-readable code is printed. Unlike earlier fatal paths this one does not return immediately; execution continues to u_cleanup() and then returns status, so warnings are still filtered out at the very end.

Source

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

        }
        processFile(arg, encoding, inputDir, outputDir, filterDir, nullptr,
                    newPoolBundle.getAlias(),
                    options[NO_BINARY_COLLATION].doesOccur, status);
    }

    poolBundle.close();

    if(U_SUCCESS(status) && options[WRITE_POOL_BUNDLE].doesOccur) {
        const char* writePoolDir;
        if (options[WRITE_POOL_BUNDLE].value!=nullptr) {
            writePoolDir = options[WRITE_POOL_BUNDLE].value;
        } else {
            writePoolDir = outputDir;
        }
        char outputFileName[256];
        newPoolBundle->write(writePoolDir, nullptr, outputFileName, sizeof(outputFileName), status);
        if(U_FAILURE(status)) {
            fprintf(stderr, "unable to write the pool bundle: %s\n", u_errorName(status));
        }
    }

    u_cleanup();

    /* Don't return warnings as a failure */
    if (U_SUCCESS(status)) {
        return 0;
    }

    return status;
}

/* Process a file */
void
processFile(const char *filename, const char *cp,
            const char *inputDir, const char *outputDir, const char *filterDir,
            const char *packageName,

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Create and verify write permission on the output directory before running genrb (`mkdir -p <dir> && [ -w <dir> ]`).
  2. Free disk space on the target volume.
  3. Close any process holding pool.res open (AV, indexer, other genrb) and retry.

Example fix

// before
genrb --writePoolBundle /nonexistent root.txt
// after
mkdir -p out && genrb --writePoolBundle out root.txt
Defensive patterns

Strategy: validation

Validate before calling

out_dir="${WRITE_POOL_BUNDLE:-$OUTPUT_DIR}"
if [ ! -d "$out_dir" ] || [ ! -w "$out_dir" ]; then
  echo "ERROR: pool bundle output dir '$out_dir' missing or not writable" >&2; exit 2
fi
# also check free space on the target volume
df -Pk "$out_dir" | awk 'NR==2 && $4 < 1024 { print "ERROR: <1MB free on output volume"; exit 2 }'

Try / catch

genrb --writePoolBundle "$out_dir" "$@" 2>err.log || {
  grep -q 'unable to write the pool bundle' err.log && \
    echo "pool.res write failed; check dir writability and disk space" >&2
  exit 1
}

Prevention

When it happens

Trigger: The output directory passed to --writePoolBundle does not exist or is not writable; the destination filesystem is full; a pool.res at the target path is locked by another process.

Common situations: Forgetting to mkdir the output directory; CI runners with small temp disks; antivirus locking the file on Windows.

Related errors


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