{"record":{"id":"9ea842e5560dc2f9","repo":"nodejs/node","slug":"gencmn-udata-create-d-s-n-s-t-s-failed","errorCode":null,"errorMessage":"gencmn: udata_create(-d %s -n %s -t %s) failed - %s\\n","messagePattern":"gencmn: udata_create\\(-d (.+?) -n (.+?) -t (.+?)\\) failed - (.+?)\\\\n","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/toolutil/pkg_gencmn.cpp","lineNumber":243,"sourceCode":"        UNewDataMemory *out;\n\n        /* determine the offsets of all basenames and files in this common one */\n        basenameOffset=4+8*fileCount;\n        fileOffset=(basenameOffset+(basenameTotal+15))&~0xf;\n        for(i=0; i<fileCount; ++i) {\n            files[i].fileOffset=fileOffset;\n            fileOffset+=(files[i].fileSize+15)&~0xf;\n            files[i].basenameOffset=basenameOffset;\n            basenameOffset+=files[i].basenameLength;\n        }\n\n        /* create the output file */\n        out=udata_create(destDir, type, name,\n                         &dataInfo,\n                         copyRight == nullptr ? U_COPYRIGHT_STRING : copyRight,\n                         &errorCode);\n        if(U_FAILURE(errorCode)) {\n            fprintf(stderr, \"gencmn: udata_create(-d %s -n %s -t %s) failed - %s\\n\",\n                destDir, name, type,\n                u_errorName(errorCode));\n            exit(errorCode);\n        }\n\n        /* write the table of contents */\n        udata_write32(out, fileCount);\n        for(i=0; i<fileCount; ++i) {\n            udata_write32(out, files[i].basenameOffset);\n            udata_write32(out, files[i].fileOffset);\n        }\n\n        /* write the basenames */\n        for(i=0; i<fileCount; ++i) {\n            udata_writeString(out, files[i].basename, files[i].basenameLength);\n        }\n        length=4+8*fileCount+basenameTotal;\n","sourceCodeStart":225,"sourceCodeEnd":261,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/toolutil/pkg_gencmn.cpp#L225-L261","documentation":"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).","triggerScenarios":"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.","commonSituations":"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.","solutions":["Create and verify the output dir is writable before running: `mkdir -p \"$DEST\" && test -w \"$DEST\"`.","Remove stale read-only output: `rm -f \"$DEST\"/$NAME.$TYPE` and re-run.","Free disk space / raise quota on the volume holding destDir.","Pass a valid -t type (e.g. dat) and a name without path separators or illegal bytes."],"exampleFix":"# before\ngencmn -d /readonly/out -n icudt75l -t dat list.txt\n# after\nmkdir -p ./out && rm -f ./out/icudt75l.dat && gencmn -d ./out -n icudt75l -t dat list.txt","handlingStrategy":"validation","validationCode":"# ensure output dir exists, is writable, and stale output is removed\nmkdir -p \"$DEST\" && test -w \"$DEST\" || { echo \"dest not writable\" >&2; exit 1; }\nrm -f \"$DEST/$NAME.$TYPE\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["gencmn does not mkdir -p the output dir — create it in the build recipe first.","Remove read-only stale outputs before rebuilding.","Free disk space before large data builds.","Capture and surface gencmn's stderr (it includes u_errorName) in CI logs."],"tags":["icu","gencmn","udata","build-tools","file-io"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}