nodejs/node · error

Unable to open or read \"%s\" option file. status = %s\n

Error message

Unable to open or read \"%s\" option file. status = %s\n

What it means

parseFlagsFile() returned a UErrorCode that is a failure other than U_BUFFER_OVERFLOW_ERROR. The options file path (o->options) could not be opened or parsed. The error name from u_errorName(status) is printed, indicating the specific ICU error code.

Source

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

        }

#if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
        /* Read in options file. */
        if(o->verbose) {
          fprintf(stdout, "# Reading options file %s\n", o->options);
        }
        status = U_ZERO_ERROR;
        tmpResult = parseFlagsFile(o->options, pkgDataFlags, currentBufferSize, FLAG_NAMES, static_cast<int32_t>(PKGDATA_FLAGS_SIZE), &status);
        if (status == U_BUFFER_OVERFLOW_ERROR) {
            for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) {
                if (pkgDataFlags[i]) {
                    uprv_free(pkgDataFlags[i]);
                    pkgDataFlags[i] = nullptr;
                }
            }
            currentBufferSize = tmpResult;
        } else if (U_FAILURE(status)) {
            fprintf(stderr,"Unable to open or read \"%s\" option file. status = %s\n", o->options, u_errorName(status));
            return -1;
        }
#endif
        if(o->verbose) {
            fprintf(stdout, "# pkgDataFlags=\n");
            for(int32_t i=0;i<PKGDATA_FLAGS_SIZE;i++) {
                fprintf(stdout, "  [%d] %s:  %s\n", i, FLAG_NAMES[i], pkgDataFlags[i]);
            }
            fprintf(stdout, "\n");
        }
#if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)
    } while (status == U_BUFFER_OVERFLOW_ERROR);
#endif

    return result;
}

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Verify the options file exists and is readable: 'ls -la' on the path printed in the error.
  2. Ensure configure has been run to generate the options file.
  3. Check the file content for malformed entries (each line should be NAME=VALUE format).
  4. Look up the specific u_errorName value printed (e.g. U_FILE_ACCESS_ERROR means file not found).
Defensive patterns

Strategy: validation

Validate before calling

// Before running pkgdata, verify the options file exists and is readable
#include <unistd.h>
#include <fcntl.h>

bool checkOptionsFile(const char* path) {
    if (access(path, R_OK) != 0) return false;
    int fd = open(path, O_RDONLY);
    if (fd < 0) return false;
    close(fd);
    return true;
}

Prevention

When it happens

Trigger: The options file specified by o->options (typically a Makefile.generated or pkgdatain file) doesn't exist, isn't readable, contains malformed flag entries, or parseFlagsFile encountered a parse error. Buffer overflow is handled separately (triggers a retry with larger buffer); this catch is for all other failures.

Common situations: Options file path is wrong or the file was deleted; file permissions prevent reading; the file has syntax errors in flag=value lines; running pkgdata before running configure which generates the options file.

Related errors


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