{"record":{"id":"9fde8ddd564e80b1","repo":"nodejs/node","slug":"couldn-t-open-file-s-9fde8d","errorCode":null,"errorMessage":"couldn't open file %s","messagePattern":"couldn't open file (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/parse.cpp","lineNumber":763,"sourceCode":"             * user should use\n             * genrb -s. icu/data  --- start from CWD and look in icu/data dir\n             */\n            openFileName.append(inputDir, dirlen, errorCode);\n            if(inputDir[dirlen-1] != U_FILE_SEP_CHAR) {\n                openFileName.append(U_FILE_SEP_CHAR, errorCode);\n            }\n        }\n    }\n    openFileName.append(filename, errorCode);\n    if(U_FAILURE(errorCode)) {\n        return;\n    }\n    // printf(\"GenrbImporter::getRules(%s, %s) reads %s\\n\", localeID, collationType, openFileName.data());\n    const char* cp = \"\";\n    LocalUCHARBUFPointer ucbuf(\n            ucbuf_open(openFileName.data(), &cp, getShowWarning(), true, &errorCode));\n    if(errorCode == U_FILE_ACCESS_ERROR) {\n        fprintf(stderr, \"couldn't open file %s\\n\", openFileName.data());\n        return;\n    }\n    if (ucbuf.isNull() || U_FAILURE(errorCode)) {\n        fprintf(stderr, \"An error occurred processing file %s. Error: %s\\n\", openFileName.data(), u_errorName(errorCode));\n        return;\n    }\n\n    /* Parse the data into an SRBRoot */\n    LocalPointer<SRBRoot> data(\n            parse(ucbuf.getAlias(), inputDir, outputDir, filename.data(), false, false, false, &errorCode));\n    if (U_FAILURE(errorCode)) {\n        return;\n    }\n\n    struct SResource *root = data->fRoot;\n    struct SResource *collations = resLookup(root, \"collations\");\n    if (collations != nullptr) {\n      struct SResource *collation = resLookup(collations, collationType);","sourceCodeStart":745,"sourceCodeEnd":781,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/parse.cpp#L745-L781","documentation":"During collation rule import (GenrbImporter::getRules path), genrb attempts to open a referenced resource file via ucbuf_open and receives U_FILE_ACCESS_ERROR. This specific path handles importing collation tailoring rules from external files. The file could not be opened or read at all — it does not exist or is inaccessible.","triggerScenarios":"A collation import directive in a resource bundle references a file path that does not exist; the referenced file is in a different directory than expected (inputDir mismatch); the file exists but has restrictive permissions; or the path contains incorrect separators. This occurs in the parse.cpp getRules path, not the main genrb.cpp file-open path.","commonSituations":"Moving resource bundle files without updating import paths; using relative paths that break when genrb runs from a different working directory; case-sensitivity mismatch on Linux (e.g. 'en_US.txt' vs 'en_US.TXT'); missing collation data files in a custom ICU data build.","solutions":["Verify the imported file exists at the exact path shown in the error message: `ls -la <path>`","Check file permissions: the file must be readable by the genrb process","Ensure the -s (source/input directory) option matches where the imported files reside","On case-sensitive filesystems (Linux), verify the exact filename casing matches","If the file was recently added, ensure it is included in the build system's file list (e.g. Makefile, BUILD file)"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Verify all imported collation files exist before running genrb\nINPUT_DIR=\"./data\"\n# Find all import references in resource bundles and check their targets\nfor f in \"$INPUT_DIR\"/*.txt; do\n    while IFS= read -r line; do\n        ref=$(echo \"$line\" | grep -oP 'import\\s*\"\\K[^\"]+')\n        [ -n \"$ref\" ] && [ ! -f \"$INPUT_DIR/$ref.txt\" ] && echo \"MISSING: $INPUT_DIR/$ref.txt (referenced in $f)\"\n    done < \"$f\"\ndone","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Verify all import paths in resource bundles resolve before running genrb","Use the -s option consistently so relative import paths resolve correctly","On case-sensitive filesystems, ensure filename casing exactly matches references","Include all referenced files in the build system's file list"],"tags":["icu","genrb","collation","file-access","import"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}