{"record":{"id":"5cdce04186147724","repo":"apache/shardingsphere","slug":"get-s-response-failed-code-s-reason-s","errorCode":null,"errorMessage":"Get %s response failed, code:%s, reason: %s","messagePattern":"Get (.+?) response failed, code:(.+?), reason: (.+?)","errorType":"exception","errorClass":"ServerResultException","httpStatus":null,"severity":"error","filePath":"kernel/data-pipeline/scenario/cdc/client/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/client/util/ResponseFuture.java","lineNumber":75,"sourceCode":"    \n    /**\n     * Wait response result.\n     *\n     * @param timeoutMillis timeout milliseconds\n     * @param connectionContext connection context\n     * @return response result\n     * @throws GetResultTimeoutException get result timeout\n     * @throws ServerResultException server result exception\n     */\n    @SneakyThrows(InterruptedException.class)\n    public Object waitResponseResult(final long timeoutMillis, final ClientConnectionContext connectionContext) {\n        if (!countDownLatch.await(timeoutMillis, TimeUnit.MILLISECONDS)) {\n            connectionContext.getResponseFutureMap().remove(requestId);\n            throw new GetResultTimeoutException(\"Get result timeout\");\n        }\n        connectionContext.getResponseFutureMap().remove(requestId);\n        if (!Strings.isNullOrEmpty(errorMessage)) {\n            throw new ServerResultException(String.format(\"Get %s response failed, code:%s, reason: %s\", requestType.name(), errorCode, errorMessage));\n        }\n        return result;\n    }\n    \n    /**\n     * Count down.\n     */\n    public void countDown() {\n        countDownLatch.countDown();\n    }\n}\n","sourceCodeStart":57,"sourceCodeEnd":87,"githubUrl":"https://github.com/apache/shardingsphere/blob/e952770a215630a3659c75d64369168cd3e26b82/kernel/data-pipeline/scenario/cdc/client/src/main/java/org/apache/shardingsphere/data/pipeline/cdc/client/util/ResponseFuture.java#L57-L87","documentation":"When a CDC client request completes but the server attached an error message, waitResponseResult throws ServerResultException with the request type, error code, and server-side reason. This is the client-visible form of any server rejection (invalid parameters, job failures, internal errors) for that request.","triggerScenarios":"Calling a CDC client API (e.g. start subscription, stop subscription) where the proxy validates the request and returns an error payload instead of a result: nonexistent database, invalid username/password for the subscription, job already started, or an internal pipeline failure on the server.","commonSituations":"Subscribing with wrong database/user credentials; starting a subscription that is already running; server-side job exceptions (source unreachable, slot conflicts); version skew where the client sends a request the server rejects.","solutions":["Read the 'reason' and 'code' in the message: they come directly from the proxy and identify the concrete server-side failure.","Check the proxy log at the same timestamp for the full server-side stack trace.","Fix the underlying request (credentials, database name, job state) and resend.","Ensure the CDC client version matches the proxy version to avoid rejected request shapes."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    client.startSubscription(...);\n} catch (final ServerResultException ex) {\n    // message carries requestType, code and server reason; branch on them\n    if (ex.getMessage().contains(\"already\")) { /* idempotent success */ } else { throw ex; }\n}","preventionTips":["Validate credentials and database names before subscribing.","Query current job/subscription state before start/stop calls to make them idempotent.","Watch proxy logs when a client call fails; the reason string mirrors the server exception."],"tags":["cdc","client","server-error","rpc"],"backgroundTag":null,"analyzedSha":"e952770a215630a3659c75d64369168cd3e26b82","analyzedAt":"2026-08-14T13:54:53.392Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}