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

  1. Free space / raise quota on the settings volume and retry interpreter creation.
  2. Clear <settings>/dev/jython_cachedir so the copy restarts cleanly.
  3. 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

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


AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14). Data as JSON: /api/errors/e028dc160e25306c. Report an issue: GitHub.