{"record":{"id":"6bc308850d62117a","repo":"NationalSecurityAgency/ghidra","slug":"no-trace-active-6bc308","errorCode":null,"errorMessage":"No trace active","messagePattern":"No trace active","errorType":"validation","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py","lineNumber":111,"sourceCode":"    def __init__(self) -> None:\n        self.reset_client()\n\n    def require_client(self) -> Client:\n        if self.client is None:\n            raise RuntimeError(\"Not connected\")\n        return self.client\n\n    def require_no_client(self) -> None:\n        if self.client is not None:\n            raise RuntimeError(\"Already connected\")\n\n    def reset_client(self) -> None:\n        self.client: Optional[Client] = None\n        self.reset_trace()\n\n    def require_trace(self) -> Trace[Extra]:\n        if self.trace is None:\n            raise RuntimeError(\"No trace active\")\n        return self.trace\n\n    def require_no_trace(self) -> None:\n        if self.trace is not None:\n            raise RuntimeError(\"Trace already started\")\n\n    def reset_trace(self) -> None:\n        self.trace: Optional[Trace[Extra]] = None\n        util.set_convenience_variable('_ghidra_tracing', \"false\")\n        self.reset_tx()\n\n    def require_tx(self) -> Tuple[Trace[Extra], Transaction]:\n        trace = self.require_trace()\n        if self.tx is None:\n            raise RuntimeError(\"No transaction\")\n        return trace, self.tx\n\n    def require_no_tx(self) -> None:","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-lldb/src/main/py/src/ghidralldb/commands.py#L93-L129","documentation":"Raised by State.require_trace in the Ghidra LLDB agent when STATE.trace is None — i.e. no trace has been started on the current connection. Commands that emit objects/snapshots/transactions (the bulk of commands.py) call require_trace; without a Trace they cannot proceed. RuntimeError signals a lifecycle precondition: 'start_trace' (create_trace + assignment at commands.py:373) must precede trace-emitting commands.","triggerScenarios":"Running a trace-emitting command (put, mem, regs, snapshot, tx, etc.) before 'ghidra_trace_start' created a trace. Reached by ~all commands that build the trace tree.","commonSituations":"User issued put/record commands before 'ghidra_trace_start'; trace was closed (STATE.trace set to None) and user continued; script that records without starting.","solutions":["Run the start-trace command (ghidra_trace_start) after connecting and before any record/put command.","In scripts, assert STATE.trace is not None before emitting.","Catch RuntimeError and hint 'no trace active; run ghidra_trace_start'.","Ensure the start command completed (create_trace succeeded) before issuing record commands."],"exampleFix":"// before\ntrace = STATE.require_trace()\n// after\nif STATE.trace is None:\n    print(\"No trace active. Run: ghidra_trace_start <description>\")\n    return\ntrace = STATE.require_trace()","handlingStrategy":"validation","validationCode":"if STATE.trace is None:\n    print(\"No trace active. Run: ghidra_trace_start <description>\")\n    return\ntrace = STATE.require_trace()","typeGuard":"def trace_active() -> bool:\n    return STATE.trace is not None","tryCatchPattern":"try:\n    trace = STATE.require_trace()\nexcept RuntimeError:\n    print(\"No trace active; run ghidra_trace_start first\")\n    return","preventionTips":["start a trace before any record/put command","guard scripts with a trace check","confirm create_trace succeeded during start"],"tags":["ghidra","lldb","runtime-error","state-machine","trace"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}