{"record":{"id":"fe2d6a178836e014","repo":"nodejs/node","slug":"1","errorCode":"1","errorMessage":"%s: can not initialize ICU.  status = %s","messagePattern":"(.+?): can not initialize ICU\\.  status = (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":297,"sourceCode":"    if (options[FILTERDIR].doesOccur) {\n        filterDir = options[FILTERDIR].value;\n    }\n\n    if(options[ENCODING].doesOccur) {\n        encoding = options[ENCODING].value;\n    }\n\n    if(options[ICUDATADIR].doesOccur) {\n        u_setDataDirectory(options[ICUDATADIR].value);\n    }\n    /* Initialize ICU */\n    u_init(&status);\n    if (U_FAILURE(status) && status != U_FILE_ACCESS_ERROR) {\n        /* Note: u_init() will try to open ICU property data.\n         *       failures here are expected when building ICU from scratch.\n         *       ignore them.\n        */\n        fprintf(stderr, \"%s: can not initialize ICU.  status = %s\\n\",\n            argv[0], u_errorName(status));\n        exit(1);\n    }\n    status = U_ZERO_ERROR;\n    if(options[WRITE_JAVA].doesOccur) {\n        write_java = true;\n        outputEnc = options[WRITE_JAVA].value;\n    }\n\n    if(options[WRITE_XLIFF].doesOccur) {\n        write_xliff = true;\n        if(options[WRITE_XLIFF].value != nullptr){\n            xliffOutputFileName = options[WRITE_XLIFF].value;\n        }\n    }\n\n    if (options[UCADATA].doesOccur) {\n#if !UCONFIG_NO_COLLATION","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L279-L315","documentation":"u_init() failed while opening ICU's core property data, and the failure was anything other than U_FILE_ACCESS_ERROR (which is intentionally ignored because it is expected when bootstrapping ICU from scratch). The actual ICU error code is appended via u_errorName(status). This is the only path in genrb that calls exit(1) immediately, so it bypasses the normal cleanup at the end of main().","triggerScenarios":"Running genrb against an ICU build whose data directory points at missing or corrupt icudt*.dat, mixing genrb from one ICU major version with the data tree of another, or a corrupted installation. The diagnostic from u_errorName(status) distinguishes causes (e.g. U_INVALID_FORMAT_ERROR vs U_BUFFER_OVERFLOW_ERROR).","commonSituations":"Building ICU from source and running genrb before the data .dat package is assembled; installing ICU via a package manager whose data package was split off and not installed; pointing ICU_DATA at a stale directory left by a previous ICU version.","solutions":["Install or rebuild the ICU data package so u_init() can locate icudt<ver>.dat.","Verify ICU_DATA / the directory passed via --icudatadir matches the ICU version of the genrb binary (`genrb --version`).","If building ICU from scratch and this error appears with a non-file-access code, finish the data build step before invoking genrb.","When embedding genrb, check u_init()'s status yourself and skip genrb on U_FILE_ACCESS_ERROR to mirror the tool's own bootstrap tolerance."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"# Verify ICU data is locatable before running genrb\nif ! command -v genrb >/dev/null 2>&1; then echo \"genrb not on PATH\" >&2; exit 2; fi\ngenrb --version\n# If ICU_DATA is set, confirm icudt*.dat is reachable\nif [ -n \"${ICU_DATA:-}\" ] && ! ls \"$ICU_DATA\"/icudt*.dat >/dev/null 2>&1; then\n  echo \"ERROR: ICU_DATA=$ICU_DATA has no icudt*.dat\" >&2; exit 2\nfi","typeGuard":null,"tryCatchPattern":"# Run genrb, capture exit code, and surface u_init failures distinctly\nset +e\ngenrb \"$@\" >genrb.log 2>&1\nrc=$?\nset -e\nif [ $rc -eq 1 ] && grep -q 'can not initialize ICU' genrb.log; then\n  echo \"FATAL: genrb could not initialize ICU - check ICU_DATA / icudt version\" >&2\n  exit $rc\nfi","preventionTips":["Pin the genrb binary and the ICU data package to the same major version.","In containerized builds, install the ICU data package explicitly rather than relying on transitive deps."],"tags":["icu","genrb","initialization","icu-data","exit"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}