{"record":{"id":"7e20f97283ff0cb2","repo":"apache/flink","slug":"failed-to-deserialize-coordination-response","errorCode":null,"errorMessage":"Failed to deserialize coordination response","messagePattern":"Failed to deserialize coordination response","errorType":"exception","errorClass":"CompletionException","httpStatus":null,"severity":"error","filePath":"flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java","lineNumber":612,"sourceCode":"\n        SerializedValue<CoordinationRequest> serializedRequest;\n        try {\n            serializedRequest = new SerializedValue<>(request);\n        } catch (IOException e) {\n            return FutureUtils.completedExceptionally(e);\n        }\n\n        ClientCoordinationRequestBody requestBody =\n                new ClientCoordinationRequestBody(serializedRequest);\n        return sendRequest(headers, params, requestBody)\n                .thenApply(\n                        responseBody -> {\n                            try {\n                                return responseBody\n                                        .getSerializedCoordinationResponse()\n                                        .deserializeValue(getClass().getClassLoader());\n                            } catch (IOException | ClassNotFoundException e) {\n                                throw new CompletionException(\n                                        \"Failed to deserialize coordination response\", e);\n                            }\n                        });\n    }\n\n    public CompletableFuture<String> stopWithSavepoint(\n            final JobID jobId,\n            final boolean advanceToEndOfTime,\n            @Nullable final String savepointDirectory,\n            final SavepointFormatType formatType,\n            final boolean isDetachedMode) {\n\n        final StopWithSavepointTriggerHeaders stopWithSavepointTriggerHeaders =\n                StopWithSavepointTriggerHeaders.getInstance();\n\n        final SavepointTriggerMessageParameters stopWithSavepointTriggerMessageParameters =\n                stopWithSavepointTriggerHeaders.getUnresolvedMessageParameters();\n        stopWithSavepointTriggerMessageParameters.jobID.resolve(jobId);","sourceCodeStart":594,"sourceCodeEnd":630,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java#L594-L630","documentation":"Thrown when deserializing a coordination response from the JobManager fails. The sendCoordinationRequest method sends a serialized CoordinationRequest to the JobManager REST API, receives a SerializedValue response, and calls deserializeValue(getClass().getClassLoader()). An IOException (corrupted bytes) or ClassNotFoundException (response class not on client classpath) triggers this error.","triggerScenarios":"Calling sendCoordinationRequest where the response object's class is not available in the RestClusterClient's classloader; class version mismatch between the client and the operator that produced the response; corrupted REST response payload.","commonSituations":"Client and server run different Flink versions; the operator coordination response references a class from a user JAR not loaded on the client; network corruption or REST serialization produces invalid byte payloads.","solutions":["Ensure the same Flink version and user JAR versions are on both the client and the cluster classpaths.","If ClassNotFoundException, add the missing JAR containing the coordination response class to the client classpath.","If IOException, check for network/proxy issues that could corrupt the REST response body.","Verify the operator's CoordinationResponse type is Serializable and uses a compatible serialization format."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    CoordinationResponse resp = client.sendCoordinationRequest(request).get();\n} catch (ExecutionException e) {\n    Throwable cause = ExceptionUtils.stripExecutionException(e);\n    if (cause.getMessage().contains(\"Failed to deserialize coordination response\")) {\n        // check for ClassNotFoundException — user JAR missing on client\n        if (cause.getCause() instanceof ClassNotFoundException) {\n            log.error(\"Missing class on client: {}\", cause.getCause().getMessage());\n        }\n    }\n}","preventionTips":["Keep client and cluster Flink versions aligned.","Ensure user JARs with coordination response classes are on the client classpath.","Test coordination request/response round-trip in integration tests."],"tags":["serialization","rest-client","operator-coordination","classloader"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}