{"record":{"id":"ba8620093d97677c","repo":"nodejs/node","slug":"u-file-access-error-ba8620","errorCode":"U_FILE_ACCESS_ERROR","errorMessage":"gencmn: unable to open input file %s\\n","messagePattern":"gencmn: unable to open input file (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/toolutil/pkg_gencmn.cpp","lineNumber":158,"sourceCode":"    if (destDir == nullptr) {\n        destDir = u_getDataDirectory();\n    }\n    if (name == nullptr) {\n        name = COMMON_DATA_NAME;\n    }\n    if (type == nullptr) {\n        type = DATA_TYPE;\n    }\n    if (source == nullptr) {\n        source = \".\";\n    }\n\n    if (dataFile == nullptr) {\n        in = T_FileStream_stdin();\n    } else {\n        in = T_FileStream_open(dataFile, \"r\");\n        if(in == nullptr) {\n            fprintf(stderr, \"gencmn: unable to open input file %s\\n\", dataFile);\n            exit(U_FILE_ACCESS_ERROR);\n        }\n    }\n\n    if (verbose) {\n        if(sourceTOC) {\n            printf(\"generating %s_%s.c (table of contents source file)\\n\", name, type);\n        } else {\n            printf(\"generating %s.%s (common data file with table of contents)\\n\", name, type);\n        }\n    }\n\n    /* read the list of files and get their lengths */\n    while((s != nullptr && *s != 0) || (s=T_FileStream_readLine(in, (line=linePtr),\n                                                             LINE_BUFFER_SIZE))!=nullptr) {\n        /* remove trailing newline characters and parse space separated items */\n        if (s != nullptr && *s != 0) {\n            line=s;","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/pkg_gencmn.cpp#L140-L176","documentation":"gencmn could not open the input list file you passed (the -d/-f input listing the data files to pack). T_FileStream_open(\"r\") on that path returned NULL, so the tool aborts with U_FILE_ACCESS_ERROR. This is a fatal CLI tool error printed to stderr followed by exit(U_FILE_ACCESS_ERROR).","triggerScenarios":"Running `gencmn <listfile>` (or pkgdata invoking gencmn) where <listfile> does not exist, is not readable by the build user, or is a directory. Also when stdin is not a TTY and dataFile is unexpectedly NULL it falls back to stdin instead.","commonSituations":"Building ICU/icudata from a fresh or partial checkout where the generated list file was not produced; running gencmn from the wrong working directory so a relative list path misses; permission/ownership mismatch on build artifacts under deps/icu-small after a sudo build or a `make clean` that removed the list.","solutions":["Confirm the input list file exists and is a regular readable file: `test -r \"$LIST\" || echo missing` before invoking gencmn.","Re-run the upstream make target that generates the list file (e.g. the icudata build step) so the path is materialized before gencmn runs.","Run gencmn from the directory the list path is relative to, or pass an absolute path to the list file.","Fix ownership/permissions: `chmod -R u+r deps/icu-small/source/data/out` and ensure the build user owns the tree."],"exampleFix":"# before\ngencmn ./tmp/missinglist.txt\n# after\ntest -r ./out/icudt_files.txt && gencmn ./out/icudt_files.txt || { echo \"list missing; rebuild data\"; exit 1; }","handlingStrategy":"validation","validationCode":"# before invoking gencmn, ensure the input list exists and is readable\ntest -n \"$LIST\" && test -r \"$LIST\" || { echo \"gencmn: input list '$LIST' missing/unreadable\" >&2; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Treat gencmn as a build step with a file prerequisite: declare the list file as a make target dependency so it exists before gencmn runs.","Always check gencmn's exit code in build scripts: `gencmn ... || exit $?`.","Run from the directory the list path is relative to, or pass an absolute path.","After a sudo/root build, chown the tree back to the build user to avoid permission denials."],"tags":["icu","gencmn","file-io","build-tools"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}