{"record":{"id":"6410911da94d4924","repo":"nodejs/node","slug":"ures-swap-pool-bundle-s-failed-s","errorCode":null,"errorMessage":"ures_swap(pool bundle %s) failed: %s","messagePattern":"ures_swap\\(pool bundle (.+?)\\) failed: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":410,"sourceCode":"            fprintf(stderr, \"unable to read the pool bundle file %s\\n\", poolFileName.data());\n            return 1;\n        }\n        /*\n         * Swap the pool bundle so that a single checked-in file can be used.\n         * The swapper functions also test that the data looks like\n         * 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];","sourceCodeStart":392,"sourceCodeEnd":428,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L392-L428","documentation":"After the swapper was created successfully, ures_swap() failed while byte-swapping the pool bundle in place. ures_swap also validates that the data looks like a well-formed .res file, so a failure here means the structure (bundle indexes, resource offsets) is internally inconsistent even though the outer header parsed. The error code is printed via u_errorName.","triggerScenarios":"pool.res that has a valid DataHeader but corrupt .res internals; a partially-written pool.res from a crashed --writePoolBundle run; an endianness mismatch that the swapper cannot reconcile.","commonSituations":"Interrupted builds leaving a half-written pool.res; filesystem corruption; version skew between the tool that wrote pool.res and the one consuming it.","solutions":["Regenerate pool.res cleanly with `genrb --writePoolBundle <dir> ...` and rerun.","Compare ICU versions of the writer and reader binaries (`genrb --version`).","If the error persists, inspect pool.res with `icupkg -l` to validate its structure."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"command -v icupkg >/dev/null 2>&1 && icupkg -l \"$POOL_DIR/pool.res\" >/dev/null 2>&1 || {\n  echo \"ERROR: pool.res failed icupkg structural check; regenerate it\" >&2; exit 2; }","typeGuard":null,"tryCatchPattern":"genrb --usePoolBundle \"$POOL_DIR\" \"$@\" 2>err.log || {\n  grep -q 'ures_swap(pool bundle' err.log && \\\n    echo \"pool.res failed structural swap; rerun --writePoolBundle\" >&2\n  exit 1\n}","preventionTips":["Treat pool.res as ephemeral; regenerate on every clean build.","Delete pool.res if its producer build was interrupted."],"tags":["icu","genrb","pool-bundle","data-swap","corrupt-file"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}