NationalSecurityAgency/ghidra · error · IOException
Failed to copy jython-src files to: {jythonSrcDestDir}
Error message
Failed to copy jython-src files to: {jythonSrcDestDir} What it means
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.
Source
Thrown at Ghidra/Extensions/Jython/src/main/java/ghidra/jython/JythonUtils.java:98
File jythonModuleDir = Application.getMyModuleRootDirectory().getFile(false);
File jythonSrcDir = new File(jythonModuleDir, JYTHON_SRC);
if (!jythonSrcDir.exists()) {
try {
jythonSrcDir = Application.getModuleDataSubDirectory(jythonModuleDir.getName(),
JYTHON_SRC).getFile(false);
}
catch (FileNotFoundException e) {
throw new IOException("Failed to find the module's " + JYTHON_SRC + " directory");
}
}
try {
FileUtilities.copyDir(jythonSrcDir, jythonSrcDestDir, f -> f.getName().endsWith(".py"),
monitor);
}
catch (IOException e) {
throw new IOException(
"Failed to copy " + JYTHON_SRC + " files to: " + jythonSrcDestDir);
}
System.setProperty("python.cachedir.skip", "false");
System.setProperty("python.cachedir", cacheDir.getAbsolutePath());
System.setProperty("python.path", jythonSrcDestDir.getAbsolutePath());
return cacheDir;
}
}
View on GitHub (pinned to d5f144c24d)
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.
Example fix
null
Defensive patterns
Strategy: retry
Validate before calling
import java.io.File;
File cache = new File(new File(Application.getUserSettingsDirectory(), "dev"), "jython_cachedir");
long free = cache.getParentFile().getUsableSpace();
if (free < 10L * 1024 * 1024) {
// low disk; clear space before interpreter init
} Type guard
null
Try / catch
try {
GhidraJythonInterpreter.get();
} catch (NullPointerException npe) {
// copyDir failed; free space / clear cache, then retry once
} Prevention
- 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.
When it happens
Trigger: 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).
Common situations: 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.
Related errors
- Failed to create the jython cache directory at: {cacheDir}
- Failed to create the jython-src directory at: {jythonSrcDest
- Failed to find the jython home directory at: {jythonHomeDir}
- Failed to find the module's jython-src directory
- Couldn't create file " + projectFile.getAbsolutePath()
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/e028dc160e25306c.
Report an issue: GitHub.