NationalSecurityAgency/ghidra · error · IOException
File imported is not a Trace: {traceName}
Error message
File imported is not a Trace: {traceName} What it means
Thrown by GztLoader during import when the packed database's content type does not equal DBTraceContentHandler.TRACE_CONTENT_TYPE. The GZT file was opened successfully as a PackedDatabase, but its content handler indicates it stores something other than a trace, so it cannot be loaded as one. This IOException signals a format/content mismatch.
Source
Thrown at Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/utils/GztLoader.java:100
private Trace loadPackedTraceDatabase(ByteProvider provider, String traceName,
Object consumer, TaskMonitor monitor)
throws IOException, CancelledException, VersionException, LanguageNotFoundException {
Trace trace;
File file = provider.getFile();
File tmpFile = null;
if (file == null) {
file = tmpFile = createTmpFile(provider, monitor);
}
try {
PackedDatabase packedDatabase = PackedDatabase.getPackedDatabase(file, true, monitor);
boolean success = false;
DBHandle dbh = null;
try {
if (!DBTraceContentHandler.TRACE_CONTENT_TYPE
.equals(packedDatabase.getContentType())) {
throw new IOException("File imported is not a Trace: " + traceName);
}
monitor.setMessage("Restoring " + provider.getName());
dbh = packedDatabase.open(monitor);
trace = new DBTrace(dbh, OpenMode.UPGRADE, monitor, consumer);
success = true;
}
finally {
if (!success) {
if (dbh != null) {
dbh.close(); // also disposes packed database object
}
else {
packedDatabase.dispose();
}
}View on GitHub (pinned to d5f144c24d)
Solutions
- Verify the file was originally exported as a GZT trace from the Ghidra Debugger.
- If the file is a regular program archive, import it with the appropriate loader instead of GztLoader.
- Re-export the trace from a working debug session to get a valid GZT file.
- Check that the Ghidra version used for import matches or is compatible with the version that created the file.
Example fix
// No code fix; the resolution is to use the correct file: // Ensure the .gzt file was exported via Debugger > Export Trace, not via Program Export.
Defensive patterns
Strategy: validation
Validate before calling
// Before importing, check the packed database content type:
PackedDatabase pdb = PackedDatabase.getPackedDatabase(file, true, monitor);
if (!DBTraceContentHandler.TRACE_CONTENT_TYPE.equals(pdb.getContentType())) {
// inform user: file is not a trace; use a different loader
} Type guard
boolean isTracePackedDatabase(PackedDatabase pdb) {
return DBTraceContentHandler.TRACE_CONTENT_TYPE.equals(pdb.getContentType());
} Try / catch
try {
trace = (DBTrace) gztLoader.load(loadSpecs, options, monitor, consumer);
} catch (IOException e) {
if (e.getMessage().startsWith("File imported is not a Trace")) {
// select a different loader for this file type
} else { throw e; }
} Prevention
- Verify the file was created by the Debugger's trace export, not a regular program export.
- Check the file extension and content type before selecting the GZT loader.
- Keep trace exports and program exports in separate directories to avoid confusion.
When it happens
Trigger: GztLoader.load() opens PackedDatabase.getPackedDatabase(file, true, monitor), then checks packedDatabase.getContentType() against DBTraceContentHandler.TRACE_CONTENT_TYPE and they don't match. The file is a valid Ghidra packed database but contains a Program, or another content type, not a Trace.
Common situations: The user renamed a regular Ghidra program archive (.gzf) to .gzt and tried to import it. The file was exported from a non-debugger context. The packed database's metadata is corrupted, causing the content type to be unreadable or default incorrectly. A version mismatch in the content handler registry.
Related errors
- Cannot add GZT to program
- only DBTrace objects are supported
- only DBTrace files are supported
- No progam to associate with trace was given
- Selected file is not a program
AI-assisted analysis of NationalSecurityAgency/ghidra@d5f144c24d (2026-08-14).
Data as JSON: /api/errors/66d2c7e9cd2e6d5e.
Report an issue: GitHub.