{"record":{"id":"2c27e5ebcc398664","repo":"nodejs/node","slug":"couldn-t-write-bundle-s-error-s","errorCode":null,"errorMessage":"couldn't write bundle %s. Error:%s","messagePattern":"couldn't write bundle (.+?)\\. Error:(.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"deps/icu-small/source/tools/genrb/genrb.cpp","lineNumber":764,"sourceCode":"    if(U_FAILURE(status)) {\n        fprintf(stderr, \"couldn't make the res fileName for  bundle %s. Error:%s\\n\",\n                filename, u_errorName(status));\n        return;\n    }\n    if(write_java== true){\n        bundle_write_java(data.getAlias(), outputDir, outputEnc,\n                          outputFileName, sizeof(outputFileName),\n                          options[JAVA_PACKAGE].value, options[BUNDLE_NAME].value, &status);\n    }else if(write_xliff ==true){\n        bundle_write_xml(data.getAlias(), outputDir, outputEnc,\n                         filename, outputFileName, sizeof(outputFileName),\n                         language, xliffOutputFileName, &status);\n    }else{\n        /* Write the data to the file */\n        data->write(outputDir, packageName, outputFileName, sizeof(outputFileName), status);\n    }\n    if (U_FAILURE(status)) {\n        fprintf(stderr, \"couldn't write bundle %s. Error:%s\\n\", outputFileName, u_errorName(status));\n    }\n}\n\n/* Generate the target .res file name from the input file name */\nstatic char*\nmake_res_filename(const char *filename,\n                  const char *outputDir,\n                  const char *packageName,\n                  UErrorCode &status) {\n    char *basename;\n    char *dirname;\n    char *resName;\n\n    int32_t pkgLen = 0; /* length of package prefix */\n\n\n    if (U_FAILURE(status)) {\n        return nullptr;","sourceCodeStart":746,"sourceCodeEnd":782,"githubUrl":"https://github.com/nodejs/node/blob/1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e/deps/icu-small/source/tools/genrb/genrb.cpp#L746-L782","documentation":"After genrb constructs the output filename and attempts to write the bundle (as binary .res, Java source, or XLIFF XML), the write operation returned a UErrorCode failure. This is genrb's final output write-failure exit point — the resource bundle was parsed and assembled successfully, but could not be serialized to disk.","triggerScenarios":"data->write() fails due to disk full, permission denied, or the output directory not existing. bundle_write_java() or bundle_write_xml() can fail similarly for their respective output formats. The specific failing function depends on the --write-java and --write-xliff options.","commonSituations":"Output directory was deleted between genrb startup and write time; disk full during a large locale data build; file system permissions changed; network filesystem timeout on the output path; concurrent builds writing to the same output directory.","solutions":["Check that the output directory exists and has write permissions: `mkdir -p <outputDir> && chmod u+w <outputDir>`","Verify available disk space: `df -h <outputDir>`","Check the u_errorName code — U_FILE_ACCESS_ERROR means permission/path, U_BUFFER_OVERFLOW_ERROR means internal write buffer","Ensure no other process holds a lock on the output file","If writing Java or XLIFF, verify the output encoding (-e option) is valid"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Pre-flight check before genrb write phase\nOUTPUT_DIR=\"./output\"\nmkdir -p \"$OUTPUT_DIR\"\n[ -w \"$OUTPUT_DIR\" ] || { echo \"Cannot write to $OUTPUT_DIR\"; exit 1; }\n# Check available disk space (need at least 10MB for typical locale builds)\navail_kb=$(df -P \"$OUTPUT_DIR\" | awk 'NR==2 {print $4}')\n[ \"$avail_kb\" -gt 10240 ] || { echo \"Insufficient disk space on $OUTPUT_DIR\"; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure the output directory exists and is writable before starting the build","Check available disk space before large locale data builds","Avoid running concurrent genrb processes that write to the same output directory","Use a build system that checks return codes and fails fast on write errors"],"tags":["icu","genrb","write-failure","output","disk-io"],"backgroundTag":null,"analyzedSha":"1b2de5e052fc0fb95fd7fb6846dcec4ade598e9e","analyzedAt":"2026-08-13T00:53:24.642Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}