{"record":{"id":"b268e84576b802ca","repo":"NationalSecurityAgency/ghidra","slug":"no-trace-active-b268e8","errorCode":null,"errorMessage":"No trace active","messagePattern":"No trace active","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"Ghidra/Debug/Debugger-agent-x64dbg/src/main/py/src/ghidraxdbg/commands.py","lineNumber":131,"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 != 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 != 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, 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":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/NationalSecurityAgency/ghidra/blob/d5f144c24d6bc53c9cbf4448c6d11143e7696206/Ghidra/Debug/Debugger-agent-x64dbg/src/main/py/src/ghidraxdbg/commands.py#L113-L149","documentation":"Raised by State.require_trace when STATE.trace is None. The trace object is created by start_trace (via 'ghidra trace start') and holds the connection to Ghidra's trace-rpc along with memory and register mappers. Any trace-data operation (put-*, activate, etc.) that calls require_trace before start_trace will hit this guard.","triggerScenarios":"A command calls STATE.require_trace() before 'ghidra trace start' has created the trace, or after reset_trace cleared it. This happens when data commands are issued before the trace lifecycle is initiated.","commonSituations":"User issued 'ghidra trace put-*' or activate commands before 'ghidra trace start'. The trace was reset (e.g. after disconnect) and not re-started. start_trace failed (e.g. missing schema.xml, or language detection failed) leaving trace as None.","solutions":["Run 'ghidra trace start' successfully before issuing any trace-data commands.","Verify start_trace completed without errors (check schema.xml path and language detection).","After a disconnect/reconnect cycle, re-run 'ghidra trace start' before data commands."],"exampleFix":"# before: data command without trace\ntrace = STATE.require_trace()  # trace is None\n\n# after: start trace lifecycle first\nghidra_trace_connect('127.0.0.1:12345')\nghidra_trace_start()\ntrace = STATE.require_trace()","handlingStrategy":"validation","validationCode":"if STATE.trace is None:\n    raise RuntimeError(\"No trace active; run 'ghidra trace start' first\")","typeGuard":"def has_trace() -> bool:\n    return STATE.trace is not None","tryCatchPattern":"try:\n    trace = STATE.require_trace()\nexcept RuntimeError:\n    ghidra_trace_connect('127.0.0.1:12345')\n    ghidra_trace_start()\n    trace = STATE.require_trace()","preventionTips":["Run 'ghidra trace start' before issuing any trace-data commands.","Verify start_trace completed without errors.","Re-start the trace after disconnect/reconnect cycles."],"tags":["x64dbg","debugger-agent","state-machine","runtimeerror","trace-lifecycle","initialization"],"backgroundTag":null,"analyzedSha":"d5f144c24d6bc53c9cbf4448c6d11143e7696206","analyzedAt":"2026-08-14T01:00:57.564Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}