nodejs/node · error
U_FILE_ACCESS_ERROR
U_FILE_ACCESS_ERROR
Error message
icupkg: unable to create tree directory \"%s\"\n
What it means
Thrown by makeFullFilenameAndDirs() when uprv_mkdir() fails with a U_FAILURE error code while trying to create intermediate tree directories for a package item's output path. The tool walks the filename's path components, temporarily truncating at each separator to mkdir each level.
Source
Thrown at deps/icu-small/source/tools/toolutil/package.cpp:297
}
static void
makeFullFilenameAndDirs(const char *path, const char *name,
char *filename, int32_t capacity) {
char *sep;
UErrorCode errorCode;
makeFullFilename(path, name, filename, capacity);
// make tree directories
errorCode=U_ZERO_ERROR;
sep=strchr(filename, 0)-strlen(name);
while((sep=strchr(sep, U_FILE_SEP_CHAR))!=nullptr) {
if(sep!=filename) {
*sep=0; // truncate temporarily
uprv_mkdir(filename, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "icupkg: unable to create tree directory \"%s\"\n", filename);
exit(U_FILE_ACCESS_ERROR);
}
}
*sep++=U_FILE_SEP_CHAR; // restore file separator character
}
}
static uint8_t *
readFile(const char *path, const char *name, int32_t &length, char &type) {
char filename[1024];
FILE *file;
UErrorCode errorCode;
int32_t fileLength, typeEnum;
makeFullFilename(path, name, filename, static_cast<int32_t>(sizeof(filename)));
/* open the input file, get its length, allocate memory for it, read the file */
file=fopen(filename, "rb");View on GitHub (pinned to 1b2de5e052)
Solutions
- Verify write permissions on the output directory: ls -ld <dir> and touch <dir>/test.
- Check for disk space: df -h <dir>.
- Remove any file that conflicts with a needed directory name.
- Create the directory tree manually before running icupkg: mkdir -p <dir>.
Defensive patterns
Strategy: validation
Validate before calling
// Pre-create directories and verify writability before running icupkg
#include <sys/stat.h>
#include <sys/types.h>
bool ensureDirWritable(const char* dir) {
if (mkdir(dir, 0755) != 0) {
struct stat st;
if (stat(dir, &st) != 0 || !S_ISDIR(st.st_mode)) return false;
}
return access(dir, W_OK | X_OK) == 0;
} Prevention
- Run mkdir -p on the output directory before invoking icupkg.
- Verify write permissions on the target directory tree.
- Check disk space with df -h before large package operations.
- Remove conflicting files that occupy names needed for directories.
When it happens
Trigger: Calling writePackage() or any code path that writes package items to a tree directory structure where one of the intermediate directory segments cannot be created. uprv_mkdir() returns a non-zero UErrorCode for permission denied, read-only filesystem, disk quota exceeded, or path-component conflicts (e.g. a file exists where a directory is expected).
Common situations: Output directory is read-only or on a mounted filesystem with insufficient permissions; disk full; an existing file occupies a name where a directory is needed; SELinux/AppArmor denies directory creation; CI runners with restricted /tmp or build directories.
Related errors
- Error creating installation directory: %s\n
- Error creating symbolic links of the data library file.
- Unable to create map file: %s.\n
- T_FileStream_open failed to open %s for writing\n
- Unable to open directory: %s\n
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/11d1081e66eac16a.
Report an issue: GitHub.