{"record":{"id":"edcbbfa697e46246","repo":"nodejs/node","slug":"unable-to-open-or-read-s-option-file-status","errorCode":null,"errorMessage":"Unable to open or read \\\"%s\\\" option file. status = %s\\n","messagePattern":"Unable to open or read \\\\\"(.+?)\\\\\" option file\\. status = (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/pkgdata/pkgdata.cpp","lineNumber":905,"sourceCode":"        }\n\n#if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)\n        /* Read in options file. */\n        if(o->verbose) {\n          fprintf(stdout, \"# Reading options file %s\\n\", o->options);\n        }\n        status = U_ZERO_ERROR;\n        tmpResult = parseFlagsFile(o->options, pkgDataFlags, currentBufferSize, FLAG_NAMES, static_cast<int32_t>(PKGDATA_FLAGS_SIZE), &status);\n        if (status == U_BUFFER_OVERFLOW_ERROR) {\n            for (int32_t i = 0; i < PKGDATA_FLAGS_SIZE; i++) {\n                if (pkgDataFlags[i]) {\n                    uprv_free(pkgDataFlags[i]);\n                    pkgDataFlags[i] = nullptr;\n                }\n            }\n            currentBufferSize = tmpResult;\n        } else if (U_FAILURE(status)) {\n            fprintf(stderr,\"Unable to open or read \\\"%s\\\" option file. status = %s\\n\", o->options, u_errorName(status));\n            return -1;\n        }\n#endif\n        if(o->verbose) {\n            fprintf(stdout, \"# pkgDataFlags=\\n\");\n            for(int32_t i=0;i<PKGDATA_FLAGS_SIZE;i++) {\n                fprintf(stdout, \"  [%d] %s:  %s\\n\", i, FLAG_NAMES[i], pkgDataFlags[i]);\n            }\n            fprintf(stdout, \"\\n\");\n        }\n#if !defined(WINDOWS_WITH_MSVC) || defined(USING_CYGWIN)\n    } while (status == U_BUFFER_OVERFLOW_ERROR);\n#endif\n\n    return result;\n}\n\n","sourceCodeStart":887,"sourceCodeEnd":923,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/pkgdata/pkgdata.cpp#L887-L923","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Verify the options file exists and is readable: 'ls -la' on the path printed in the error.","Ensure configure has been run to generate the options file.","Check the file content for malformed entries (each line should be NAME=VALUE format).","Look up the specific u_errorName value printed (e.g. U_FILE_ACCESS_ERROR means file not found)."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before running pkgdata, verify the options file exists and is readable\n#include <unistd.h>\n#include <fcntl.h>\n\nbool checkOptionsFile(const char* path) {\n    if (access(path, R_OK) != 0) return false;\n    int fd = open(path, O_RDONLY);\n    if (fd < 0) return false;\n    close(fd);\n    return true;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run ICU configure before pkgdata to generate the options file.","Verify the options file path is correct and the file exists.","Check file permissions allow reading by the build user."],"tags":["icu","pkgdata","options-file","configuration","file-io","build-tool"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}