{"record":{"id":"49465ea0bcc30adb","repo":"NationalSecurityAgency/ghidra","slug":"failed-to-create-the-jython-cache-directory-at-c","errorCode":null,"errorMessage":"Failed to create the jython cache directory at: {cacheDir}","messagePattern":"Failed to create the jython cache directory at: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"critical","filePath":"Ghidra/Extensions/Jython/src/main/java/ghidra/jython/JythonUtils.java","lineNumber":72,"sourceCode":"\t}\n\n\t/**\n\t * Sets up the jython cache directory.  This is a temporary space that jython source files\n\t * get compiled to and cached.  It should NOT be in the Ghidra installation directory, because\n\t * some installations will not have the appropriate directory permissions to create new files in.\n\t * \n\t * @param monitor A monitor to use during the cache directory setup.\n\t * @return The jython cache directory.\n\t * @throws IOException If there was a disk-related problem setting up the cache directory.\n\t * @throws CancelledException If the user cancelled the setup.\n\t */\n\tpublic static File setupJythonCacheDir(TaskMonitor monitor)\n\t\t\tthrows CancelledException, IOException {\n\n\t\tFile devDir = new File(Application.getUserSettingsDirectory(), \"dev\");\n\t\tFile cacheDir = new File(devDir, JYTHON_CACHEDIR);\n\t\tif (!FileUtilities.mkdirs(cacheDir)) {\n\t\t\tthrow new IOException(\"Failed to create the jython cache directory at: \" + cacheDir);\n\t\t}\n\n\t\tFile jythonSrcDestDir = new File(cacheDir, JYTHON_SRC);\n\t\tif (!FileUtilities.createDir(jythonSrcDestDir)) {\n\t\t\tthrow new IOException(\n\t\t\t\t\"Failed to create the \" + JYTHON_SRC + \" directory at: \" + jythonSrcDestDir);\n\t\t}\n\n\t\tFile jythonModuleDir = Application.getMyModuleRootDirectory().getFile(false);\n\t\tFile jythonSrcDir = new File(jythonModuleDir, JYTHON_SRC);\n\t\tif (!jythonSrcDir.exists()) {\n\t\t\ttry {\n\t\t\t\tjythonSrcDir = Application.getModuleDataSubDirectory(jythonModuleDir.getName(),\n\t\t\t\t\tJYTHON_SRC).getFile(false);\n\t\t\t}\n\t\t\tcatch (FileNotFoundException e) {\n\t\t\t\tthrow new IOException(\"Failed to find the module's \" + JYTHON_SRC + \" directory\");\n\t\t\t}","sourceCodeStart":54,"sourceCodeEnd":90,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Extensions/Jython/src/main/java/ghidra/jython/JythonUtils.java#L54-L90","documentation":"Thrown by JythonUtils.setupJythonCacheDir() when FileUtilities.mkdirs() fails to create the jython cache directory at <userSettings>/dev/jython_cachedir. This cache holds compiled .py outputs and is intentionally placed outside the install dir to avoid permission problems. mkdirs failing means the parent is not writable or a non-directory file occupies the path.","triggerScenarios":"Interpreter init where the user settings directory's 'dev' folder cannot be created or the 'jython_cachedir' path is blocked (read-only home, no disk quota, existing file at that name).","commonSituations":"Running Ghidra as a user whose settings directory is on a read-only mount; restricted/containerized environment where the settings dir lacks write permission; a stale lock file occupying the cache path; full disk.","solutions":["Check write permission on the Ghidra user settings directory (shown in Help -> About -> Ghidra user settings); grant write access to the user.","Remove any non-directory file occupying <settings>/dev/jython_cachedir.","Free disk space / raise quota on the volume holding the settings directory, then retry interpreter creation."],"exampleFix":"null","handlingStrategy":"validation","validationCode":"import ghidra.framework.Application;\nimport java.io.File;\nFile cache = new File(new File(Application.getUserSettingsDirectory(), \"dev\"), \"jython_cachedir\");\nif (!cache.getParentFile().canWrite()) {\n    // settings/dev not writable; fix permissions before interpreter init\n}","typeGuard":"null","tryCatchPattern":"try {\n    GhidraJythonInterpreter.get();\n} catch (NullPointerException npe) {\n    // get() returns null on IOException; verify <settings>/dev writability\n}","preventionTips":["Ensure the Ghidra user settings directory is writable by the launching user.","In containers, mount the settings dir on a writable volume.","Watch disk-full / quota conditions before starting Jython."],"tags":["jython","filesystem","permissions","environment"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}