{"record":{"id":"e028dc160e25306c","repo":"NationalSecurityAgency/ghidra","slug":"failed-to-copy-jython-src-files-to-jythonsrcdest","errorCode":null,"errorMessage":"Failed to copy jython-src files to: {jythonSrcDestDir}","messagePattern":"Failed to copy jython-src files to: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"Ghidra/Extensions/Jython/src/main/java/ghidra/jython/JythonUtils.java","lineNumber":98,"sourceCode":"\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}\n\t\t}\n\n\t\ttry {\n\t\t\tFileUtilities.copyDir(jythonSrcDir, jythonSrcDestDir, f -> f.getName().endsWith(\".py\"),\n\t\t\t\tmonitor);\n\t\t}\n\t\tcatch (IOException e) {\n\t\t\tthrow new IOException(\n\t\t\t\t\"Failed to copy \" + JYTHON_SRC + \" files to: \" + jythonSrcDestDir);\n\t\t}\n\n\t\tSystem.setProperty(\"python.cachedir.skip\", \"false\");\n\t\tSystem.setProperty(\"python.cachedir\", cacheDir.getAbsolutePath());\n\t\tSystem.setProperty(\"python.path\", jythonSrcDestDir.getAbsolutePath());\n\n\t\treturn cacheDir;\n\t}\n}\n","sourceCodeStart":80,"sourceCodeEnd":109,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Extensions/Jython/src/main/java/ghidra/jython/JythonUtils.java#L80-L109","documentation":"Thrown by JythonUtils.setupJythonCacheDir() when FileUtilities.copyDir() raises an IOException while copying .py files from the module jython-src into the cache's jython-src destination. The source was located (else 627 would fire) but the copy itself failed mid-stream.","triggerScenarios":"copyDir fails because of an I/O error reading a source .py, writing a destination file, or because the monitor was cancelled (though CancelledException is a separate declared type, copyDir can surface IOException for disk faults).","commonSituations":"Disk full or quota exceeded while writing into the cache; filesystem error on the settings volume; a corrupt/unreadable .py in the source tree; antivirus interfering with the write.","solutions":["Free space / raise quota on the settings volume and retry interpreter creation.","Clear <settings>/dev/jython_cachedir so the copy restarts cleanly.","Inspect source jython-src files for read errors; repair the extension data if a source file is unreadable."],"exampleFix":"null","handlingStrategy":"retry","validationCode":"import java.io.File;\nFile cache = new File(new File(Application.getUserSettingsDirectory(), \"dev\"), \"jython_cachedir\");\nlong free = cache.getParentFile().getUsableSpace();\nif (free < 10L * 1024 * 1024) {\n    // low disk; clear space before interpreter init\n}","typeGuard":"null","tryCatchPattern":"try {\n    GhidraJythonInterpreter.get();\n} catch (NullPointerException npe) {\n    // copyDir failed; free space / clear cache, then retry once\n}","preventionTips":["Keep free disk space on the settings volume for the cache copy.","Periodically clear <settings>/dev/jython_cachedir to drop stale copies.","Ensure the source jython-src .py files are readable."],"tags":["jython","filesystem","io","environment"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}