{"record":{"id":"68681ab3bd6eca7c","repo":"NationalSecurityAgency/ghidra","slug":"could-open-module-data-directory","errorCode":null,"errorMessage":"Could open module data directory","messagePattern":"Could open module data directory","errorType":"exception","errorClass":"LSHException","httpStatus":null,"severity":"error","filePath":"Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/FunctionDatabase.java","lineNumber":315,"sourceCode":"\t\t}\n\t\telse {\n\t\t\tres = newrec.getNameExec() + \" already ingested with UNKNOWN difference in metadata\";\n\t\t}\n\t\treturn res;\n\t}\n\n\tpublic static Configuration loadConfigurationTemplate(String configname) throws LSHException {\n\t\tResourceFile moduleDataSubDirectory;\n\t\tfinal Configuration config = new Configuration();\n\t\ttry {\n\t\t\tmoduleDataSubDirectory = Application.getModuleDataSubDirectory(\"\");\n\t\t\tconfig.loadTemplate(moduleDataSubDirectory, configname);\n\t\t}\n\t\tcatch (final FileNotFoundException e) {\n\t\t\tthrow new LSHException(\"Missing configuration data: \" + e.getMessage());\n\t\t}\n\t\tcatch (final IOException e) {\n\t\t\tthrow new LSHException(\"Could open module data directory\");\n\t\t}\n\t\tcatch (final SAXException e) {\n\t\t\tthrow new LSHException(\"Unable to parse configuration template\");\n\t\t}\n\t\treturn config;\n\t}\n\n\t/**\n\t * Central location for building vector factory used by FunctionDatabase\n\t * @return the LSHVectorFactory object\n\t */\n\tpublic static WeightedLSHCosineVectorFactory generateLSHVectorFactory() {\n\t\treturn new WeightedLSHCosineVectorFactory();\n\t}\n\n\t/**\n\t * Get the maximum number of functions to be queried per staged query when searching\n\t * for similar functions.","sourceCodeStart":297,"sourceCodeEnd":333,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Features/BSim/src/main/java/ghidra/features/bsim/query/FunctionDatabase.java#L297-L333","documentation":"Thrown by FunctionDatabase.loadConfigurationTemplate when an IOException (other than FileNotFoundException) occurs while reading or opening the module data directory or template. Note the message 'Could open module data directory' is grammatically incomplete (it means 'could NOT open'); it wraps the underlying IOException but does not append its message.","triggerScenarios":"Application.getModuleDataSubDirectory(\"\") or config.loadTemplate throws a generic IOException: permission denied, I/O error reading the directory, or the directory exists but is unreadable. The catch swallows the original message, so only the generic string surfaces.","commonSituations":"Filesystem permissions prevent reading the module data directory. The directory was deleted or is a broken symlink. A disk I/O error or locked file on Windows. Running Ghidra from a read-only or partially-mounted location.","solutions":["Check filesystem read permissions on the Ghidra module data directory and its parent tree.","Confirm the module data directory exists and is not a broken symlink or empty mount point.","Reinstall/repair the Ghidra distribution if the directory is missing or corrupt.","Run Ghidra from a fully-installed, readable location rather than a temp/extracted archive."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Verify the module data directory is readable before loading\nResourceFile dir = Application.getModuleDataSubDirectory(\"\");\nif (!dir.exists() || !dir.isDirectory()) {\n    throw new IllegalStateException(\"Module data directory missing or unreadable: \" + dir);\n}\nConfiguration config = FunctionDatabase.loadConfigurationTemplate(configname);","typeGuard":null,"tryCatchPattern":"try {\n    Configuration config = FunctionDatabase.loadConfigurationTemplate(configname);\n} catch (LSHException e) {\n    if (e.getMessage().equals(\"Could open module data directory\")) {\n        log.error(\"Cannot read BSim module data directory; check permissions/installation\", e);\n    }\n    throw e;\n}","preventionTips":["Run Ghidra from a fully installed, readable location.","Check filesystem permissions on the module data directory tree.","Reinstall the distribution if the data directory is missing or corrupt."],"tags":["bsim","configuration","io-error","filesystem","setup"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}