{"record":{"id":"cc52c7b6b3c086c0","repo":"NationalSecurityAgency/ghidra","slug":"open-failed","errorCode":null,"errorMessage":"Open failed: {}","messagePattern":"Open failed: (.+?)","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/DBTraceContentHandler.java","lineNumber":87,"sourceCode":"\t\ttry {\n\t\t\tbf = dbItem.open(version, minChangeVersion);\n\t\t\tdbh = new DBHandle(bf);\n\t\t\tOpenMode openMode = OpenMode.IMMUTABLE;\n\t\t\ttrace = new DBTrace(dbh, openMode, monitor, consumer);\n\t\t\tgetTraceChangeSet(trace, bf);\n\t\t\tsuccess = true;\n\t\t\treturn trace;\n\t\t}\n\t\tcatch (VersionException | IOException | CancelledException e) {\n\t\t\tthrow e;\n\t\t}\n\t\tcatch (Throwable t) {\n\t\t\tMsg.error(this, \"GetImmutableObject failed\", t);\n\t\t\tString msg = t.getMessage();\n\t\t\tif (msg == null) {\n\t\t\t\tmsg = t.toString();\n\t\t\t}\n\t\t\tthrow new IOException(\"Open failed: \" + msg, t);\n\t\t}\n\t\tfinally {\n\t\t\tif (!success) {\n\t\t\t\tif (trace != null) {\n\t\t\t\t\ttrace.release(consumer);\n\t\t\t\t}\n\t\t\t\tif (dbh != null) {\n\t\t\t\t\tdbh.close();\n\t\t\t\t}\n\t\t\t\tif (bf != null) {\n\t\t\t\t\tbf.dispose();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\t@Override\n\tpublic DBTrace getReadOnlyObject(FolderItem item, int version, boolean okToUpgrade,","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Framework-TraceModeling/src/main/java/ghidra/trace/database/DBTraceContentHandler.java#L69-L105","documentation":"In getImmutableObject, after content-type validation passes, opening the DB (buffer file, DBHandle, DBTrace construction) can throw unexpected Throwables — schema errors, missing managers, deserialization faults, version-incompatible structures. These are caught, logged, and rethrown as a single IOException(\"Open failed: <msg>\", t) preserving the cause.","triggerScenarios":"Any non-IOException/VersionException/CancelledException Throwable during immutable open: a corrupt buffer file, an unrecognized stored schema, an NPE in a trace manager initializer, or an incompatible Ghidra version reading a newer trace DB.","commonSituations":"Opening a trace created by a newer/older Ghidra build whose DB schema differs. Truncated or corrupted .gbr/.gbt buffer files. A refactor that changed DBTrace storage layout without a version bump. Missing/changed dependent DB schema.","solutions":["Inspect getCause() of the IOException to find the real failure (often VersionException-like or a deserialization error).","If the cause indicates a version/schema mismatch, upgrade Ghidra or re-export the trace from its source on the current build.","If corruption, restore from version control / re-record the trace.","Check the log line 'GetImmutableObject failed' for the stack trace."],"exampleFix":"// before\ntry {\n    DBTrace t = handler.getImmutableObject(item, consumer, ver, minVer, monitor);\n} catch (IOException e) {\n    throw new RuntimeException(\"cannot open\", e);\n}\n\n// after: surface the root cause\ntry {\n    DBTrace t = handler.getImmutableObject(item, consumer, ver, minVer, monitor);\n} catch (IOException e) {\n    Throwable root = e.getCause() != null ? e.getCause() : e;\n    throw new IOException(\"Open failed for trace; root cause: \" + root, e);\n}","handlingStrategy":"try-catch","validationCode":"// Pre-check: confirm the file exists, is a trace, and warn on version metadata if available.\nif (!DBTraceContentHandler.TRACE_CONTENT_TYPE.equals(item.getContentType())) {\n    throw new IOException(\"not a trace: \" + item.getContentType());\n}","typeGuard":null,"tryCatchPattern":"try {\n    return handler.getImmutableObject(item, consumer, ver, minVer, monitor);\n} catch (IOException e) {\n    Throwable cause = e.getCause();\n    if (cause instanceof VersionException ve) {\n        // prompt upgrade / open on compatible build\n    } else {\n        // corruption or schema fault: restore from backup\n        Msg.error(this, \"Trace open failed\", cause == null ? e : cause);\n    }\n    throw e;\n}","preventionTips":["Always inspect getCause() of 'Open failed' IOExceptions rather than the wrapper message.","Keep traces on a known Ghidra build or handle VersionException explicitly.","Maintain backups/version control for trace files to recover from corruption."],"tags":["content-handler","io","db-open","version","corruption"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}