nodejs/node · error
gencmn: udata_finish() failed - %s\n
Error message
gencmn: udata_finish() failed - %s\n
What it means
After writing all data and padding, udata_finish(out, &errorCode) reported U_FAILURE. gencmn prints udata_finish() failed with u_errorName and exit(errorCode), indicating the output container could not be finalized/flushed.
Source
Thrown at deps/icu-small/source/tools/toolutil/pkg_gencmn.cpp:306
T_FileStream_close(file);
length=files[i].fileSize;
if (nread != files[i].fileSize) {
fprintf(stderr, "gencmn: unable to read %s properly (got %ld/%ld byte%s)\n", files[i].pathname, (long)nread, (long)files[i].fileSize, files[i].fileSize == 1 ? "" : "s");
exit(U_FILE_ACCESS_ERROR);
}
}
/* pad to 16-align the last file (cleaner, avoids growing .dat files in icuswap) */
length&=0xf;
if(length!=0) {
udata_writePadding(out, 16-length);
}
/* finish */
udata_finish(out, &errorCode);
if(U_FAILURE(errorCode)) {
fprintf(stderr, "gencmn: udata_finish() failed - %s\n", u_errorName(errorCode));
exit(errorCode);
}
} else {
/* write a .c source file with the table of contents */
char *filename;
FileStream *out;
/* create the output filename */
filename=s=buffer;
uprv_strcpy(filename, destDir);
s=filename+uprv_strlen(filename);
if(s>filename && *(s-1)!=U_FILE_SEP_CHAR) {
*s++=U_FILE_SEP_CHAR;
}
uprv_strcpy(s, name);
if(*(type)!=0) {
s+=uprv_strlen(s);
*s++='_';View on GitHub (pinned to 1b2de5e052)
Solutions
- Free space on the output volume and re-run (this is usually the cause of a finish/close failure).
- Run the build on a local disk instead of a network mount.
- Remove the partial output .dat so gencmn starts fresh: `rm -f "$DEST/$NAME.$TYPE"`.
- Check dmesg/system logs for I/O errors on the target device.
Example fix
# before: output on a near-full network mount gencmn -d /mnt/nfs/out ... # after df -h ./out && gencmn -d ./out ... # local, enough free space
Defensive patterns
Strategy: validation
Validate before calling
# check free space on the destination volume before running
df -k "$DEST" | awk 'NR==2 && $4 < 1048576 { exit 1 }' || { echo "low disk on $DEST" >&2; exit 1; } Prevention
- Ensure adequate free space (>= 2x expected .dat size) before building.
- Build on local disk; network mounts can drop at close.
- Check gencmn exit code and remove any partial .dat on failure.
- Watch dmesg for I/O errors if this recurs.
When it happens
Trigger: A write/flush error while finalizing the .dat header or closing the file: disk full at the very end, I/O error on the output device, or an internal udata accounting failure. The check is `if(U_FAILURE(errorCode))` immediately after udata_finish.
Common situations: Disk fills up during the write so the final flush/header rewrite fails; output on a network volume that drops at close; an interrupted build leaving a partial .dat.
Related errors
- gencmn: udata_create(-d %s -n %s -t %s) failed - %s\n
- U_FILE_ACCESS_ERROR
- gencmn: no files listed in %s\n
- U_ILLEGAL_ARGUMENT_ERROR
- error in command line argument "%s"\n
AI-assisted analysis of nodejs/node@1b2de5e052 (2026-08-13).
Data as JSON: /api/errors/7242baa2f385adde.
Report an issue: GitHub.