nodejs/node · error

gencmn: udata_create(-d %s -n %s -t %s) failed - %s\n

Error message

gencmn: udata_create(-d %s -n %s -t %s) failed - %s\n

What it means

gencmn failed to create the output common-data (.dat) file via udata_create(destDir, type, name, ...). The UErrorCode from udata_create is U_FAILURE, so gencmn prints destDir/name/type plus u_errorName(errorCode) and exit(errorCode).

Source

Thrown at deps/icu-small/source/tools/toolutil/pkg_gencmn.cpp:243

        UNewDataMemory *out;

        /* determine the offsets of all basenames and files in this common one */
        basenameOffset=4+8*fileCount;
        fileOffset=(basenameOffset+(basenameTotal+15))&~0xf;
        for(i=0; i<fileCount; ++i) {
            files[i].fileOffset=fileOffset;
            fileOffset+=(files[i].fileSize+15)&~0xf;
            files[i].basenameOffset=basenameOffset;
            basenameOffset+=files[i].basenameLength;
        }

        /* create the output file */
        out=udata_create(destDir, type, name,
                         &dataInfo,
                         copyRight == nullptr ? U_COPYRIGHT_STRING : copyRight,
                         &errorCode);
        if(U_FAILURE(errorCode)) {
            fprintf(stderr, "gencmn: udata_create(-d %s -n %s -t %s) failed - %s\n",
                destDir, name, type,
                u_errorName(errorCode));
            exit(errorCode);
        }

        /* write the table of contents */
        udata_write32(out, fileCount);
        for(i=0; i<fileCount; ++i) {
            udata_write32(out, files[i].basenameOffset);
            udata_write32(out, files[i].fileOffset);
        }

        /* write the basenames */
        for(i=0; i<fileCount; ++i) {
            udata_writeString(out, files[i].basename, files[i].basenameLength);
        }
        length=4+8*fileCount+basenameTotal;

View on GitHub (pinned to 1b2de5e052)

Solutions

  1. Create and verify the output dir is writable before running: `mkdir -p "$DEST" && test -w "$DEST"`.
  2. Remove stale read-only output: `rm -f "$DEST"/$NAME.$TYPE` and re-run.
  3. Free disk space / raise quota on the volume holding destDir.
  4. Pass a valid -t type (e.g. dat) and a name without path separators or illegal bytes.

Example fix

# before
gencmn -d /readonly/out -n icudt75l -t dat list.txt
# after
mkdir -p ./out && rm -f ./out/icudt75l.dat && gencmn -d ./out -n icudt75l -t dat list.txt
Defensive patterns

Strategy: validation

Validate before calling

# ensure output dir exists, is writable, and stale output is removed
mkdir -p "$DEST" && test -w "$DEST" || { echo "dest not writable" >&2; exit 1; }
rm -f "$DEST/$NAME.$TYPE"

Prevention

When it happens

Trigger: destDir does not exist or is not writable; type/name contain invalid characters; a file of the same name is locked/read-only; udata_create fails its header write. The check is `if(U_FAILURE(errorCode))` right after the udata_create call.

Common situations: Output directory not created yet (gencmn does not mkdir -p); building into a read-only source tree; leftover read-only .dat from a prior root-owned build; disk full or quota exceeded at the start of the write.

Related errors


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