{"record":{"id":"b7ae6782678fd195","repo":"nodejs/node","slug":"failed-to-open-s-s-n","errorCode":null,"errorMessage":"Failed to open %s: %s\\n","messagePattern":"Failed to open (.+?): (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"deps/icu-small/source/tools/escapesrc/tblgen.cpp","lineNumber":23,"sourceCode":"#include \"unicode/ucnv.h\"\n#include \"unicode/uniset.h\"\n#include <stdio.h>\n\nusing icu::LocalUConverterPointer;\nusing icu::UnicodeSet;\n\nstatic const char *kConverter = \"ibm-1047\";\n\nint main(int argc, const char *argv[]) {\n  printf(\"// %s\\n\", U_COPYRIGHT_STRING);\n  printf(\"// generated by tblgen. You weren't going to edit it by hand, were you?\\n\");\n  printf(\"\\n\");\n\n  UErrorCode status = U_ZERO_ERROR;\n  LocalUConverterPointer cnv(ucnv_open(kConverter, &status));\n\n  if(U_FAILURE(status)) {\n    fprintf(stderr, \"Failed to open %s: %s\\n\", kConverter, u_errorName(status));\n    return 1;\n  }\n\n  printf(\"static const char cp1047_8859_1[256] = { \\n\");\n  for(int i=0x00; i<0x100; i++) {\n    char cp1047[1];\n    cp1047[0] = i;\n    char16_t u[1];\n    char16_t *target = u;\n    const char *source = cp1047;\n    ucnv_toUnicode(cnv.getAlias(), &target, u+1, &source, cp1047+1, nullptr, true, &status);\n    if(U_FAILURE(status)) {\n      fprintf(stderr, \"Conversion failure at #%X: %s\\n\", i, u_errorName(status));\n      return 2;\n    }\n    printf(\" (char)0x%02X, /* %02X */\\n\", u[0], i);\n  }\n  printf(\"};\\n\\n\");","sourceCodeStart":5,"sourceCodeEnd":41,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/escapesrc/tblgen.cpp#L5-L41","documentation":"tblgen opens the ICU converter for \"ibm-1047\" (EBCDIC) via ucnv_open. If opening fails (U_FAILURE(status)), the converter is unavailable — typically because the ICU data library was built without this converter or ICU's converter data is missing/misconfigured. Without the converter tblgen cannot produce the cp1047_8859_1 table, so it exits 1.","triggerScenarios":"ucnv_open(\"ibm-1047\", &status) returns a failing UErrorCode: U_MISSING_RESOURCE_ERROR (ICU data not loaded), U_FILE_ACCESS_ERROR (icudt not found), or U_ILLEGAL_ARGUMENT_ERROR/U_UNSUPPORTED_ERROR if the alias is unknown to this build.","commonSituations":"Building ICU without the standard converter set (e.g. a stripped-down icu-small or a custom data export that omitted ibm-1047); ICU_DATA path not set so icudt*.dat is unreachable; version mismatch between ICU headers and the data library; cross-compile where the host ICU has different data than the target.","solutions":["Ensure ICU is built/configured with the ibm-1047 (EBCDIC) converter included in the data export.","Set ICU_DATA (or run from the build dir) so ucnv_open can locate icudt*.dat; verify with the `icuinfo` tool.","Rebuild the ICU data package with the full converter set (`--with-data-packaging=archive` or the standard cnvalias.icu)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// verify the ibm-1047 converter is available before running tblgen\n#include <unicode/ucnv.h>\nUErrorCode s = U_ZERO_ERROR;\nUConverter* c = ucnv_open(\"ibm-1047\", &s);\nif (U_FAILURE(s)) { fprintf(stderr, \"ibm-1047 unavailable: %s\\n\", u_errorName(s)); return 1; }\nucnv_close(c);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Build ICU with the full converter set when generating EBCDIC-related tables.","Pin ICU_DATA and verify it loads (icuinfo) in the build environment before tblgen runs."],"tags":["icu","tblgen","converter","ebcdic","icu-data"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}