nodejs/node · error

U_FILE_ACCESS_ERROR

U_FILE_ACCESS_ERROR

Error message

Error opening <%s>.\n

What it means

While reading the list of input resource files (the file list passed to pkgdata), T_FileStream_open(l->str,"r") failed for one of the listed files. The function sets *status = U_FILE_ACCESS_ERROR and returns immediately, so no resources from any subsequent list files are collected. The name printed is the literal path string from the fileListFiles linked list.

Source

Thrown at deps/icu-small/source/tools/pkgdata/pkgdata.cpp:2057

    CharList   *l, *tail = nullptr, *tail2 = nullptr;
    FileStream *in;
    char        line[16384];
    char       *linePtr, *lineNext;
    const uint32_t   lineMax = 16300;
    char       *tmp;
    int32_t     tmpLength = 0;
    char       *s;
    int32_t     ln=0; /* line number */

    for(l = o->fileListFiles; l; l = l->next) {
        if(o->verbose) {
            fprintf(stdout, "# pkgdata: Reading %s..\n", l->str);
        }
        /* TODO: stdin */
        in = T_FileStream_open(l->str, "r"); /* open files list */

        if(!in) {
            fprintf(stderr, "Error opening <%s>.\n", l->str);
            *status = U_FILE_ACCESS_ERROR;
            return;
        }

        while(T_FileStream_readLine(in, line, sizeof(line))!=nullptr) { /* for each line */
            ln++;
            if(uprv_strlen(line)>lineMax) {
                fprintf(stderr, "%s:%d - line too long (over %d chars)\n", l->str, static_cast<int>(ln), static_cast<int>(lineMax));
                exit(1);
            }
            /* remove spaces at the beginning */
            linePtr = line;
            /* On z/OS, disable call to isspace (#9996).  Investigate using uprv_isspace instead (#9999) */
#if U_PLATFORM != U_PF_OS390
            while(isspace(*linePtr)) {
                linePtr++;
            }
#endif

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Run pkgdata from the directory the file list paths are relative to.
  2. Inspect the file list (the -F argument) and confirm every path exists and is readable.
  3. Re-run the upstream generator (genrb/make) that should have produced the missing .res files.
  4. Check read permissions on the listed files: ls -l <path>.

Example fix

# before: pkgdata invoked from wrong dir
pkgdata -F reslist.txt -p mypkg

# after: cd into the dir the list is relative to
cd $OUTDIR && pkgdata -F reslist.txt -p mypkg
Defensive patterns

Strategy: validation

Validate before calling

// Pre-flight: every path in the file list must exist and be readable.
#include <unistd.h>
#include <stdio.h>

bool fileListAllReadable(const char *listFile) {
    FILE *f = fopen(listFile, "r");
    if (!f) return false;
    char line[4096];
    bool ok = true;
    while (fgets(line, sizeof(line), f)) {
        line[strcspn(line, "\r\n")] = 0;
        if (line[0] && access(line, R_OK) != 0) { ok = false; break; }
    }
    fclose(f);
    return ok;
}

Prevention

When it happens

Trigger: The file list entry l->str points at a path that does not exist, is not readable by the build user, or is a directory rather than a file. Also triggered by a stale file list referencing files deleted after the list was generated.

Common situations: An ICU data build where the file list (e.g. tmpdata.res or the -F file) lists a .res that a prior gencnval/genrb step failed to emit; running pkgdata from the wrong CWD so relative paths in the list miss; file permissions stripped by a packaging step.

Related errors


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