nodejs/node · critical

Failed to open %s: %s\n

Error message

Failed to open %s: %s\n

What it means

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.

Source

Thrown at deps/icu-small/source/tools/escapesrc/tblgen.cpp:23

#include "unicode/ucnv.h"
#include "unicode/uniset.h"
#include <stdio.h>

using icu::LocalUConverterPointer;
using icu::UnicodeSet;

static const char *kConverter = "ibm-1047";

int main(int argc, const char *argv[]) {
  printf("// %s\n", U_COPYRIGHT_STRING);
  printf("// generated by tblgen. You weren't going to edit it by hand, were you?\n");
  printf("\n");

  UErrorCode status = U_ZERO_ERROR;
  LocalUConverterPointer cnv(ucnv_open(kConverter, &status));

  if(U_FAILURE(status)) {
    fprintf(stderr, "Failed to open %s: %s\n", kConverter, u_errorName(status));
    return 1;
  }

  printf("static const char cp1047_8859_1[256] = { \n");
  for(int i=0x00; i<0x100; i++) {
    char cp1047[1];
    cp1047[0] = i;
    char16_t u[1];
    char16_t *target = u;
    const char *source = cp1047;
    ucnv_toUnicode(cnv.getAlias(), &target, u+1, &source, cp1047+1, nullptr, true, &status);
    if(U_FAILURE(status)) {
      fprintf(stderr, "Conversion failure at #%X: %s\n", i, u_errorName(status));
      return 2;
    }
    printf(" (char)0x%02X, /* %02X */\n", u[0], i);
  }
  printf("};\n\n");

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Ensure ICU is built/configured with the ibm-1047 (EBCDIC) converter included in the data export.
  2. Set ICU_DATA (or run from the build dir) so ucnv_open can locate icudt*.dat; verify with the `icuinfo` tool.
  3. Rebuild the ICU data package with the full converter set (`--with-data-packaging=archive` or the standard cnvalias.icu).
Defensive patterns

Strategy: validation

Validate before calling

// verify the ibm-1047 converter is available before running tblgen
#include <unicode/ucnv.h>
UErrorCode s = U_ZERO_ERROR;
UConverter* c = ucnv_open("ibm-1047", &s);
if (U_FAILURE(s)) { fprintf(stderr, "ibm-1047 unavailable: %s\n", u_errorName(s)); return 1; }
ucnv_close(c);

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13). Data as JSON: /api/errors/b7ae6782678fd195. Report an issue: GitHub.