{"record":{"id":"c71853e68fc160a1","repo":"nodejs/node","slug":"bundle-compactkeys-s-or-bundle-getkeybytes-fai","errorCode":null,"errorMessage":"bundle_compactKeys(%s) or bundle_getKeyBytes() failed: %s","messagePattern":"bundle_compactKeys\\((.+?)\\) or bundle_getKeyBytes\\(\\) failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":728,"sourceCode":"        }\n\n        if (isVerbose()) {\n            filter.print(std::cout);\n        }\n\n        // Apply the filter to the data\n        ResKeyPath path;\n        data->fRoot->applyFilter(filter, path, data.getAlias());\n    }\n\n    if(options[WRITE_POOL_BUNDLE].doesOccur) {\n        data->fWritePoolBundle = newPoolBundle;\n        data->compactKeys(status);\n        int32_t newKeysLength;\n        const char *newKeys = data->getKeyBytes(&newKeysLength);\n        newPoolBundle->addKeyBytes(newKeys, newKeysLength, status);\n        if(U_FAILURE(status)) {\n            fprintf(stderr, \"bundle_compactKeys(%s) or bundle_getKeyBytes() failed: %s\\n\",\n                    filename, u_errorName(status));\n            return;\n        }\n        /* count the number of just-added key strings */\n        for(const char *newKeysLimit = newKeys + newKeysLength; newKeys < newKeysLimit; ++newKeys) {\n            if(*newKeys == 0) {\n                ++newPoolBundle->fKeysCount;\n            }\n        }\n    }\n\n    if(options[USE_POOL_BUNDLE].doesOccur) {\n        data->fUsePoolBundle = &poolBundle;\n    }\n\n    /* Determine the target rb filename */\n    uprv_free(make_res_filename(filename, outputDir, packageName, status));\n    if(U_FAILURE(status)) {","sourceCodeStart":710,"sourceCodeEnd":746,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L710-L746","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Before building with --write-pool-bundle, check available memory and key count\nfree -h\n# Estimate unique keys across all locale bundles that will be pooled\ngrep -ohP '^\\s*\\w+\\s*\\{' all_locales/*.txt | sort -u | wc -l","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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"],"tags":["icu","genrb","pool-bundle","key-compaction","memory"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}