{"record":{"id":"28186796eb5f22fc","repo":"NationalSecurityAgency/ghidra","slug":"commit-directory-does-not-exist","errorCode":null,"errorMessage":"Commit directory does not exist: {}","messagePattern":"Commit directory does not exist: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java","lineNumber":666,"sourceCode":"\t\t}\n\n\t\ttry (BulkSignatures bsim = getBulkSignatures()) {\n\t\t\tif (commitOption) {\n\t\t\t\t// Generate and commit updates to BSim database\n\t\t\t\tbsim.updateRepoSignatures(ghidraURL, xmlDirectory, overwriteOption, monitor);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Generate update XML files only\n\t\t\t\tbsim.generateUpdatesFromServer(ghidraURL, xmlDirectory, overwriteOption,\n\t\t\t\t\tconfigOption, monitor);\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate File checkDirectory(String dirPath) throws IOException {\n\t\tFile dir = new File(dirPath);\n\t\tif (!dir.exists()) {\n\t\t\tthrow new IOException(\"Commit directory does not exist: \" + dirPath);\n\t\t}\n\t\tif (!dir.isDirectory()) {\n\t\t\tthrow new IOException(dirPath + \": is not a directory\");\n\t\t}\n\t\treturn dir.getCanonicalFile();\n\t}\n\n\tprivate void doCommitSigs(List<String> params, TaskMonitor monitor)\n\t\t\tthrows IOException, SAXException, LSHException, CancelledException {\n\t\tif (params.size() < 1) {\n\t\t\tthrow new IllegalArgumentException(\"Missing directory containing signature files\");\n\t\t}\n\n\t\tString xmlDirectory = params.get(0);\n\n\t\tFile dir = checkDirectory(xmlDirectory);\n\n\t\tboolean hasOverride = optionValueMap.containsKey(OVERRIDE_OPTION);","sourceCodeStart":648,"sourceCodeEnd":684,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/ingest/BSimLaunchable.java#L648-L684","documentation":"Thrown as IOException by checkDirectory() when the path given to commitsigs or commitupdates does not exist on the filesystem. Unlike the IllegalArgumentException argument-parsing errors, this is an I/O failure discovered when validating the directory that contains the signature/update XML files to be sent to the BSim server.","triggerScenarios":"Running commitsigs or commitupdates with a path where new File(dirPath).exists() returns false (line 665). The path was never created, is misspelled, or points to a different working directory.","commonSituations":"Typo in the directory path; relative path evaluated from an unexpected CWD; the directory was cleaned up between generatesigs and commitsigs steps; Docker/container path mismatch; NFS mount not yet available.","solutions":["Verify the directory exists: 'ls -la <dirPath>' before running the command.","Use an absolute path to avoid CWD ambiguity.","Re-run generatesigs/generateupdates to recreate the XML files if the directory was deleted.","Create the directory first if you intended to point at a fresh location, then populate it."],"exampleFix":"# before\nbsim commitsigs postgresql://myhost/BsimDB /tmp/xmout\n# after (fix typo)\nbsim commitsigs postgresql://myhost/BsimDB /tmp/xmlout","handlingStrategy":"validation","validationCode":"// Pre-check directory existence before calling run()\nimport java.io.File;\nFile dir = new File(dirPath);\nif (!dir.exists()) {\n    throw new IOException(\"Commit directory does not exist: \" + dirPath);\n}\nif (!dir.isDirectory()) {\n    throw new IOException(dirPath + \": is not a directory\");\n}","typeGuard":null,"tryCatchPattern":"// In a calling program wrapping BSimLaunchable\ntry {\n    launchable.launch(layout, params);\n} catch (Exception e) {\n    // IOException for FS problems exits with code 1; IllegalArgumentException with 22\n    if (e instanceof IOException) {\n        log.error(\"Filesystem error during BSim commit: {}\", e.getMessage());\n    }\n    throw e;\n}","preventionTips":["Always verify the XML output directory exists immediately before commitsigs/commitupdates.","Use absolute paths in scripts to avoid CWD-related surprises.","If generating and committing in one script, check the generatesigs/generateupdates exit code before proceeding to commit."],"tags":["cli","filesystem","bsim","commitsigs","commitupdates"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}