{"record":{"id":"34768bca2bcdabf3","repo":"apache/dolphinscheduler","slug":"call-method-to-host-failed","errorCode":null,"errorMessage":"Call method to \" + host + \" failed","messagePattern":"Call method to \" \\+ host \\+ \" failed","errorType":"exception","errorClass":"RemoteException","httpStatus":null,"severity":"error","filePath":"dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client/NettyRemotingClient.java","lineNumber":147,"sourceCode":"                return doSendSync(transporter, host, timeoutMillis);\n            } catch (Exception ex) {\n                ClientSyncExceptionMetrics clientSyncExceptionMetrics =\n                        ClientSyncExceptionMetrics.of(syncRequestDto, ex);\n                RpcMetrics.recordClientSyncRequestException(clientSyncExceptionMetrics);\n\n                if (currentExecuteTimes < maxRetryTimes\n                        && Arrays.stream(retryStrategy.retryFor()).anyMatch(e -> e.isInstance(ex))) {\n                    currentExecuteTimes++;\n                    if (retryStrategy.retryInterval() > 0) {\n                        ThreadUtils.sleep(retryStrategy.retryInterval());\n                    }\n                    continue;\n                }\n\n                if (ex instanceof RemoteException) {\n                    throw (RemoteException) ex;\n                } else {\n                    throw new RemoteException(\"Call method to \" + host + \" failed\", ex);\n                }\n            } finally {\n                ClientSyncDurationMetrics clientSyncDurationMetrics = ClientSyncDurationMetrics\n                        .of(syncRequestDto)\n                        .withMilliseconds(System.currentTimeMillis() - start);\n                RpcMetrics.recordClientSyncRequestDuration(clientSyncDurationMetrics);\n            }\n        }\n    }\n\n    private IRpcResponse doSendSync(final Transporter transporter,\n                                    final Host serverHost,\n                                    long timeoutMills) throws RemoteException, InterruptedException {\n        final Channel channel = getOrCreateChannel(serverHost);\n        if (channel == null) {\n            throw new RemoteException(String.format(\"connect to : %s fail\", serverHost));\n        }\n        final ResponseFuture responseFuture = new ResponseFuture(transporter.getHeader().getOpaque(), timeoutMills);","sourceCodeStart":129,"sourceCodeEnd":165,"githubUrl":"https://github.com/apache/dolphinscheduler/blob/02eac45a1b6676e639fcbfb4be2243de5771b05d/dolphinscheduler-extract/dolphinscheduler-extract-base/src/main/java/org/apache/dolphinscheduler/extract/base/client/NettyRemotingClient.java#L129-L165","documentation":"NettyRemotingClient.sendSync wraps any non-RemoteException throwable raised while sending an RPC request synchronously to a remote worker/master host into a generic RemoteException. It means the synchronous call to the remote host failed for a reason other than a remote-side business error, e.g. connection setup failure, write failure, or timeout surfaced as a local exception. The original exception is attached as the cause for diagnosis.","triggerScenarios":"Calling sendSync (via a generated client proxy, e.g. ISchedulerClient or IWorkflowClient) when the target host is down, unreachable, the channel write fails, doSendSync throws a non-RemoteException (IllegalArgumentException from createChannel, RuntimeException on InterruptedException), or the await is interrupted/fails unexpectedly.","commonSituations":"Worker or master process crashed mid-deployment; DNS or /etc/hosts entries pointing to a stale IP; firewall or security group blocking the RPC port; cluster scaled down but scheduler config still references removed hosts; network partition between master and worker nodes.","solutions":["Check that the target host is reachable: ping/telnet the host IP and port configured in the registry (e.g. nc -zv <ip> <port>)","Inspect the chained cause in the exception (ex.getCause()) to find the root failure (timeout, refused, interrupted)","Verify the host registered in ZooKeeper matches the actual worker/master address and port; restart the remote process if stale","Check network/firewall/security-group rules between master and worker on the DolphinScheduler RPC port","Retry the operation; if it happens persistently, check remote JVM GC pauses or thread pool exhaustion on the remote side"],"exampleFix":"// before\nIRpcResponse resp = nettyRemotingClient.sendSync(host, request, 3000);\n// after\nIRpcResponse resp;\ntry {\n    resp = nettyRemotingClient.sendSync(host, request, 30000);\n} catch (RemoteException e) {\n    log.error(\"RPC to {} failed: {}\", host, e.getCause(), e);\n    throw e;\n}","handlingStrategy":"try-catch","validationCode":"boolean isHostReachable(Host host) {\n    try (Socket s = new Socket()) {\n        s.connect(new InetSocketAddress(host.getIp(), host.getPort()), 3000);\n        return true;\n    } catch (IOException e) {\n        return false;\n    }\n}","typeGuard":"null","tryCatchPattern":"try {\n    IRpcResponse resp = client.sendSync(host, request, timeoutMills);\n} catch (RemoteTimeoutException e) {\n    // retry with larger timeout\n} catch (RemoteException e) {\n    log.error(\"RPC to {} failed, cause: {}\", host, e.getCause(), e);\n    // failover to another host or rethrow\n}","preventionTips":["Always log e.getCause() of RemoteException — the root network error is there","Pre-flight check host reachability before dispatching tasks to a newly registered worker","Keep worker registration (ZooKeeper) consistent with actual listening ports","Retry idempotent RPCs with exponential backoff"],"tags":["rpc","network","remote-exception"],"backgroundTag":"api-request-failed","analyzedSha":"02eac45a1b6676e639fcbfb4be2243de5771b05d","analyzedAt":"2026-09-06T17:43:00.555Z","contentChangedAt":"2026-09-06T17:43:00.555Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}