{"record":{"id":"45f7cfe48b4b0149","repo":"t8y2/dbx","slug":"response-error-message","errorCode":null,"errorMessage":"${response.Error.Message}","messagePattern":"\\$\\{response\\.Error\\.Message\\}","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/kingbase-go/bench/agent_compare.go","lineNumber":244,"sourceCode":"\tid := process.nextID.Add(1)\n\tchannel := make(chan agentResponse, 1)\n\tprocess.pending.Store(id, channel)\n\trequest := map[string]any{\"id\": id, \"method\": method, \"params\": params}\n\tpayload, err := json.Marshal(request)\n\tif err != nil {\n\t\treturn nil, err\n\t}\n\tprocess.writeMu.Lock()\n\t_, err = process.stdin.Write(append(payload, '\\n'))\n\tprocess.writeMu.Unlock()\n\tif err != nil {\n\t\tprocess.pending.Delete(id)\n\t\treturn nil, err\n\t}\n\tselect {\n\tcase response := <-channel:\n\t\tif response.Error != nil {\n\t\t\treturn nil, errors.New(response.Error.Message)\n\t\t}\n\t\treturn response.Result, nil\n\tcase <-time.After(30 * time.Second):\n\t\tprocess.pending.Delete(id)\n\t\treturn nil, errors.New(\"agent request timed out\")\n\t}\n}\n\nfunc (process *agentProcess) close() error {\n\t_, _ = process.call(\"shutdown\", map[string]any{})\n\t_ = process.stdin.Close()\n\treturn process.command.Wait()\n}\n\nfunc runQueryBenchmark(process *agentProcess, duration time.Duration, concurrency int, sqlText string, maxRows int, sampleMemory bool) benchmarkResult {\n\tvar operations atomic.Int64\n\tvar failures atomic.Int64\n\tvar peakRSS atomic.Int64","sourceCodeStart":226,"sourceCodeEnd":262,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/kingbase-go/bench/agent_compare.go#L226-L262","documentation":"The agent call succeeded at the transport level but the agent process returned a JSON-RPC-style error response; the driver surfaces the agent's own error message wrapped in a Go error. The actual cause is whatever the agent put in Error.Message, so this error text is dynamic.","triggerScenarios":"Any agent RPC (e.g. 'shutdown' from close, warmup, benchmarkOneConnection, cleanupQueryPage, or ad-hoc calls) where the agent replies with response.Error != nil.","commonSituations":"The agent failed the requested operation (bad SQL, connection refused to the target database, internal panic); the agent binary is an incompatible version returning errors the harness does not expect; the agent could not authenticate to Kingbase.","solutions":["Read the wrapped Error.Message to identify the agent-side root cause and fix it there","Verify the agent process is the correct, compatible version and can reach the target database","Add logging around the call to capture the request id and full response for diagnosis"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"res, err := process.call(method, args); if err != nil { log.Printf(\"agent %s failed: %v\", method, err); return fmt.Errorf(\"agent call %s: %w\", method, err) }","preventionTips":["Always log the wrapped Error.Message — it carries the agent-side root cause","Pin and version-check the agent binary to avoid protocol mismatches","Verify agent-to-database connectivity and credentials before benchmark runs"],"tags":["ipc","agent","rpc"],"backgroundTag":"remote-procedure-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"}