nodejs/node · error
bundle_compactKeys(%s) or bundle_getKeyBytes() failed: %s
Error message
bundle_compactKeys(%s) or bundle_getKeyBytes() failed: %s
What it means
During pool bundle generation (--write-pool-bundle mode), genrb calls compactKeys() to deduplicate key strings and getKeyBytes() to retrieve the compacted key bytes. If either call sets a UErrorCode failure, the pool bundle cannot be assembled. Pool bundles are a shared-key optimization that reduces total .res file size across a locale set.
Source
Thrown at deps/icu-small/source/tools/genrb/genrb.cpp:728
}
if (isVerbose()) {
filter.print(std::cout);
}
// Apply the filter to the data
ResKeyPath path;
data->fRoot->applyFilter(filter, path, data.getAlias());
}
if(options[WRITE_POOL_BUNDLE].doesOccur) {
data->fWritePoolBundle = newPoolBundle;
data->compactKeys(status);
int32_t newKeysLength;
const char *newKeys = data->getKeyBytes(&newKeysLength);
newPoolBundle->addKeyBytes(newKeys, newKeysLength, status);
if(U_FAILURE(status)) {
fprintf(stderr, "bundle_compactKeys(%s) or bundle_getKeyBytes() failed: %s\n",
filename, u_errorName(status));
return;
}
/* count the number of just-added key strings */
for(const char *newKeysLimit = newKeys + newKeysLength; newKeys < newKeysLimit; ++newKeys) {
if(*newKeys == 0) {
++newPoolBundle->fKeysCount;
}
}
}
if(options[USE_POOL_BUNDLE].doesOccur) {
data->fUsePoolBundle = &poolBundle;
}
/* Determine the target rb filename */
uprv_free(make_res_filename(filename, outputDir, packageName, status));
if(U_FAILURE(status)) {View on GitHub (pinned to 1b2de5e052)
Solutions
- Check the u_errorName code in the message — U_MEMORY_ALLOCATION_ERROR indicates memory pressure, U_BUFFER_OVERFLOW_ERROR indicates too many keys
- Reduce the number of unique top-level keys in the resource bundles fed to the pool bundle build
- Build with fewer simultaneous parallel genrb processes to reduce memory pressure
- If the issue is a key table size limit, split the locale data into multiple pool bundles
- Disable pool bundle mode (--write-pool-bundle) if the optimization is not critical for your use case
Defensive patterns
Strategy: validation
Validate before calling
# Before building with --write-pool-bundle, check available memory and key count
free -h
# Estimate unique keys across all locale bundles that will be pooled
grep -ohP '^\s*\w+\s*\{' all_locales/*.txt | sort -u | wc -l Prevention
- Monitor memory usage during pool bundle builds and set appropriate parallelism limits
- Keep the number of unique keys per locale set reasonable to stay within pool bundle limits
- Build pool bundles separately from regular locale builds to isolate failures
- Check the ICU documentation for pool bundle key limits for your ICU version
When it happens
Trigger: Running genrb with the --write-pool-bundle option on a resource bundle whose key set causes compactKeys() to fail — typically due to an internal key table overflow, hash collision limit, or memory exhaustion during key compaction. The newPoolBundle->addKeyBytes() call can also trigger this if the key byte buffer exceeds capacity.
Common situations: Building ICU data with pool bundle optimization enabled on a very large locale set; using a custom resource bundle with an unusually high number of unique keys; memory pressure during a parallel build of many locales.
Related errors
- unable to create an empty bundle for the pool keys: %s
- U_MEMORY_ALLOCATION_ERROR
- %s: cannot combine --writePoolBundle and --usePoolBundle\n
- %s: cannot combine --formatVersion 1 with --writePoolBundle
- udata_openSwapperForInputData(pool bundle %s) failed: %s
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/c71853e68fc160a1.
Report an issue: GitHub.