{"record":{"id":"f884aeec3d94f8a2","repo":"NationalSecurityAgency/ghidra","slug":"only-dbtrace-files-are-supported","errorCode":null,"errorMessage":"only DBTrace files are supported","messagePattern":"only DBTrace files are supported","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/utils/GztExporter.java","lineNumber":90,"sourceCode":"\t\t\tlog.appendMsg(\"Content does not support packed file export!\");\n\t\t\tlog.appendException(e);\n\t\t\treturn false;\n\t\t}\n\t\tcatch (CancelledException ce) {\n\t\t\treturn false;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tlog.appendMsg(\"Unexpected exception exporting file: \" + e.getMessage());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic boolean export(File file, DomainFile domainFile, TaskMonitor monitor)\n\t\t\tthrows ExporterException, IOException {\n\t\tif (!canExportDomainFile(domainFile)) {\n\t\t\tthrow new UnsupportedOperationException(\"only DBTrace files are supported\");\n\t\t}\n\t\ttry {\n\t\t\tdomainFile.packFile(file, monitor);\n\t\t}\n\t\tcatch (CancelledException e) {\n\t\t\treturn false;\n\t\t}\n\t\tcatch (Exception e) {\n\t\t\tlog.appendMsg(\"Unexpected exception exporting file: \" + e.getMessage());\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}\n\n\t@Override\n\tpublic List<Option> getOptions(DomainObjectService domainObjectService) {\n\t\treturn EMPTY_OPTIONS;\n\t}","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger/src/main/java/ghidra/app/plugin/core/debug/utils/GztExporter.java#L72-L108","documentation":"Thrown by GztExporter.export() overload when the DomainFile passed for GZT export does not represent a DBTrace file. The canExportDomainFile() check fails, and UnsupportedOperationException is thrown. This is the DomainFile variant of error 107 — it checks the file's content type rather than the object's class.","triggerScenarios":"GztExporter.export(File, DomainFile, TaskMonitor) receives a DomainFile whose underlying content is not a DBTrace. canExportDomainFile(domainFile) returns false. This happens when the user picks a non-trace file from the project tree for GZT export.","commonSituations":"The user right-clicks a regular program file in the project tree and selects GZT export. A batch export script iterates over DomainFiles and attempts GZT on all of them. The file is a folder, or a non-trace content type.","solutions":["Select only trace files (created by the Debugger) for GZT export.","Filter DomainFiles by content type before calling export in scripts.","Use the correct exporter for the file's actual content type.","Check canExportDomainFile() before invoking export to avoid the exception."],"exampleFix":"// Before:\n// exporter.export(file, domainFile, monitor); // domainFile is not a trace\n//\n// After:\n// if (exporter.canExportDomainFile(domainFile)) {\n//     exporter.export(file, domainFile, monitor);\n// }","handlingStrategy":"validation","validationCode":"// Before calling export with a DomainFile, check capability:\nif (exporter.canExportDomainFile(domainFile)) {\n    exporter.export(file, domainFile, monitor);\n} else {\n    // use a different exporter\n}","typeGuard":"// No simple type guard on DomainFile; use canExportDomainFile() check.\nboolean isTraceFile(DomainFile df) {\n    return DBTraceContentHandler.TRACE_CONTENT_TYPE.equals(df.getContentType());\n}","tryCatchPattern":"try {\n    exporter.export(file, domainFile, monitor);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().equals(\"only DBTrace files are supported\")) {\n        // select a different exporter for this file type\n    } else { throw e; }\n}","preventionTips":["Always call canExportDomainFile() before the DomainFile export overload.","Filter project tree selections to trace files when offering GZT export.","Check the DomainFile content type before selecting an exporter."],"tags":["export","gzt","trace","domain-file","type-mismatch"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}