{"record":{"id":"f6dfb6727aa0e19e","repo":"t8y2/dbx","slug":"candidate-name-method-json-dumps-response-e","errorCode":null,"errorMessage":"{candidate.name} {method}: {json.dumps(response['error'])}","messagePattern":"\\{candidate\\.name\\} \\{method\\}: \\{json\\.dumps\\(response\\['error'\\]\\)\\}","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"agents/drivers/argo-go/bench/agent_compare.py","lineNumber":106,"sourceCode":"            \"id\": request_id,\n            \"method\": method,\n            \"params\": params or {},\n        }\n        try:\n            assert self.process.stdin is not None\n            with self.write_lock:\n                self.process.stdin.write(json.dumps(request, separators=(\",\", \":\")) + \"\\n\")\n                self.process.stdin.flush()\n            response = response_queue.get(timeout=env_float(\"BENCH_RPC_TIMEOUT\", 180.0))\n        except queue.Empty as error:\n            raise TimeoutError(self._failure(f\"timed out during {method}\")) from error\n        finally:\n            with self.request_lock:\n                self.pending.pop(request_id, None)\n        if isinstance(response, Exception):\n            raise response\n        if response.get(\"error\") is not None:\n            raise RuntimeError(\n                f\"{self.candidate.name} {method}: \"\n                f\"{json.dumps(response['error'], ensure_ascii=False)}\"\n            )\n        return response.get(\"result\")\n\n    def rss_kib(self) -> int:\n        if self.candidate.rss_command:\n            output = subprocess.check_output(\n                self.candidate.rss_command,\n                shell=True,\n                text=True,\n            ).strip()\n            return int(output or \"0\")\n        status_path = Path(f\"/proc/{self.process.pid}/status\")\n        if status_path.is_file():\n            for line in status_path.read_text().splitlines():\n                if line.startswith(\"VmRSS:\"):\n                    return int(line.split()[1])","sourceCodeStart":88,"sourceCodeEnd":124,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/argo-go/bench/agent_compare.py#L88-L124","documentation":"When the agent replies with a JSON-RPC response whose `error` field is non-null, AgentProcess.call re-raises it as a RuntimeError formatted as \"<candidate> <method>: <json error>\". It surfaces server-side JSON-RPC application errors from the agent to the benchmark driver.","triggerScenarios":"Any call() where the agent returns {\"error\": ...}: invalid SQL passed by execute_workload, unknown method name, missing/invalid params (e.g. bad agentSessionId), backend connection failure inside the agent, or probe_failure_semantics deliberately triggering an error response.","commonSituations":"Typo in workload method name in configured_workloads; SQL referencing a nonexistent table; agent not connected to Hive/TDengine backend; sending paged parameters the agent version doesn't support.","solutions":["Read the embedded JSON error object in the message for the agent's error code and message and fix the request accordingly","Validate the workload SQL and method names in configured_workloads against the agent's supported protocol","Confirm the agent's backend (Hive/TDengine) connectivity and credentials before the run","Catch RuntimeError per candidate in benchmark_workload and skip/mark the candidate as failed instead of aborting the whole comparison","Pin agent and bench script versions so method/param contracts match"],"exampleFix":"// before\nrows = process.call(\"execute_query\", {\"sql\": sql})\n// after\ntry:\n    rows = process.call(\"execute_query\", {\"sql\": sql})\nexcept RuntimeError as e:\n    print(f\"candidate {process.candidate.name} failed RPC: {e}\")\n    raise  # or continue to next candidate","handlingStrategy":"try-catch","validationCode":"SUPPORTED_METHODS = {\"execute_query\", \"execute_query_page\", \"close\"}\nassert workload[\"method\"] in SUPPORTED_METHODS, f\"agent does not implement {workload['method']}\"","typeGuard":null,"tryCatchPattern":"try:\n    result = process.call(method, params)\nexcept RuntimeError as e:\n    err = e.args[0].split(\": \", 1)[-1]\n    detail = json.loads(err)  # agent's error object: code/message\n    handle_rpc_error(method, detail)","preventionTips":["Keep the bench script's method/param names in sync with the agent's protocol version","Validate workload SQL against the test schema before the run","Verify backend connectivity (Hive/TDengine) before starting benchmarks","Fail per-candidate, not globally, so one bad candidate doesn't kill the comparison"],"tags":["rpc","jsonrpc","server-error","benchmark"],"backgroundTag":"rpc-server-error","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}