{"record":{"id":"c494c75548eebcc8","repo":"nodejs/node","slug":"u-invalid-format-error","errorCode":"U_INVALID_FORMAT_ERROR","errorMessage":"invalid format of pool bundle file %s","messagePattern":"invalid format of pool bundle file (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":416,"sourceCode":"         * a well-formed .res file.\n         */\n        ds = udata_openSwapperForInputData(poolBundle.fBytes, bytesRead,\n                                           U_IS_BIG_ENDIAN, U_CHARSET_FAMILY, &status);\n        if (U_FAILURE(status)) {\n            fprintf(stderr, \"udata_openSwapperForInputData(pool bundle %s) failed: %s\\n\",\n                    poolFileName.data(), u_errorName(status));\n            return status;\n        }\n        ures_swap(ds, poolBundle.fBytes, bytesRead, poolBundle.fBytes, &status);\n        udata_closeSwapper(ds);\n        if (U_FAILURE(status)) {\n            fprintf(stderr, \"ures_swap(pool bundle %s) failed: %s\\n\",\n                    poolFileName.data(), u_errorName(status));\n            return status;\n        }\n        header = reinterpret_cast<const DataHeader*>(poolBundle.fBytes);\n        if (header->info.formatVersion[0] < 2) {\n            fprintf(stderr, \"invalid format of pool bundle file %s\\n\", poolFileName.data());\n            return U_INVALID_FORMAT_ERROR;\n        }\n        const int32_t* pRoot = reinterpret_cast<const int32_t*>(\n                reinterpret_cast<const char*>(header) + header->dataHeader.headerSize);\n        poolBundle.fIndexes = pRoot + 1;\n        indexLength = poolBundle.fIndexes[URES_INDEX_LENGTH] & 0xff;\n        if (indexLength <= URES_INDEX_POOL_CHECKSUM) {\n            fprintf(stderr, \"insufficient indexes[] in pool bundle file %s\\n\", poolFileName.data());\n            return U_INVALID_FORMAT_ERROR;\n        }\n        int32_t keysBottom = 1 + indexLength;\n        int32_t keysTop = poolBundle.fIndexes[URES_INDEX_KEYS_TOP];\n        poolBundle.fKeys = reinterpret_cast<const char*>(pRoot + keysBottom);\n        poolBundle.fKeysLength = (keysTop - keysBottom) * 4;\n        poolBundle.fChecksum = poolBundle.fIndexes[URES_INDEX_POOL_CHECKSUM];\n\n        for (i = 0; i < poolBundle.fKeysLength; ++i) {\n            if (poolBundle.fKeys[i] == 0) {","sourceCodeStart":398,"sourceCodeEnd":434,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L398-L434","documentation":"After swapping, genrb casts the buffer to a DataHeader and checks header->info.formatVersion[0]. Pool bundles require formatVersion >= 2 because the pool keys/indexes layout was introduced with formatVersion 2. A pool.res with formatVersion[0] < 2 is rejected with U_INVALID_FORMAT_ERROR. This is a stricter, structural follow-up to the format checks done on the command line.","triggerScenarios":"Using a pool.res that was generated with --formatVersion 1 (or by an old genrb that only wrote formatVersion 1). The command-line guard (error 761) prevents producing such a combination, but a hand-carried or legacy pool.res can still hit this.","commonSituations":"Reusing a checked-in pool.res from an older ICU; cross-version data sharing; manually editing or down-converting pool.res.","solutions":["Regenerate pool.res with a current genrb at formatVersion 2 or 3 (the default).","Discard legacy pool.res files when upgrading ICU major versions.","Run `icupkg -l pool.res` to inspect its formatVersion before use."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Reject a legacy formatVersion-1 pool.res up front\n# (icupkg -l output or a small od inspection can reveal the formatVersion byte)\nfv_byte=$(od -An -tu1 -j \"$((0x18))\" -N1 \"$POOL_DIR/pool.res\" 2>/dev/null | tr -d ' ')\nif [ -n \"$fv_byte\" ] && [ \"$fv_byte\" -lt 2 ]; then\n  echo \"ERROR: pool.res formatVersion=$fv_byte, need >= 2\" >&2; exit 2\nfi","typeGuard":null,"tryCatchPattern":"genrb --usePoolBundle \"$POOL_DIR\" \"$@\" 2>err.log || {\n  grep -q 'invalid format of pool bundle file' err.log && \\\n    echo \"pool.res too old; regenerate with current genrb\" >&2\n  exit 1\n}","preventionTips":["On ICU upgrades, delete all generated pool.res files rather than carrying them forward."],"tags":["icu","genrb","pool-bundle","format-version","invalid-format"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}