{"record":{"id":"a4cada64953bd1ee","repo":"pentaho/pentaho-kettle","slug":"unable-to-connect-to-the-socketwriter-in-the-timeout-in","errorCode":null,"errorMessage":"Unable to connect to the SocketWriter in the {TIMEOUT_IN_SECONDS}s timeout period.","messagePattern":"Unable to connect to the SocketWriter in the (.+?)s timeout period\\.","errorType":"exception","errorClass":"KettleException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/trans/step/RemoteStep.java","lineNumber":648,"sourceCode":"        }\n      }\n    }\n\n    // See if all was OK...\n    if ( lastException != null ) {\n\n      baseStep.logError( \"Error initialising step: \" + lastException.toString() );\n      if ( socket != null ) {\n        socket.shutdownInput();\n        socket.shutdownOutput();\n        socket.close();\n        baseStep.logDetailed( \"Closed connection to server socket to read rows from remote step on server \"\n          + realHostname + \" port \" + portNumber + \" - Local port=\" + socket.getLocalPort() );\n      }\n      throw lastException;\n    } else {\n      if ( inputStream == null ) {\n        throw new KettleException( \"Unable to connect to the SocketWriter in the \"\n          + TIMEOUT_IN_SECONDS + \"s timeout period.\" );\n      }\n    }\n\n    baseStep.logDetailed( \"Opened connection to server socket to read rows from remote step on server \"\n      + realHostname + \" port \" + portNumber + \" - Local port=\" + socket.getLocalPort() );\n\n    // Create a thread to take care of the reading from the client socket.\n    // The rows read will be put in a RowSet buffer.\n    // That buffer will hand over the rows to the step that has this RemoteStep\n    // object defined\n    // as a remote input step.\n    //\n    Runnable runnable = new Runnable() {\n      public void run() {\n        try {\n\n          // First read the row meta data from the socket...","sourceCodeStart":630,"sourceCodeEnd":666,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/trans/step/RemoteStep.java#L630-L666","documentation":"Thrown by RemoteStep.openReaderSocket after the retry loop finished without an exception but no input stream was obtained: the remote SocketWriter never accepted a connection within TIMEOUT_IN_SECONDS. The reader waited out the full timeout and gives up.","triggerScenarios":"Calling openReaderSocket against a remote slave whose server socket does not start or is unreachable within TIMEOUT_IN_SECONDS seconds, exhausting all retry attempts and leaving inputStream null.","commonSituations":"Firewall blocking the cluster data port, wrong hostname/port in the cluster schema, slow slave-server startup, or the remote step failing before it opens its SocketWriter.","solutions":["Verify the remote slave server hostname and data port are correct and reachable (telnet/nc test).","Check the slave server log for errors preventing the SocketWriter from starting.","Open firewall rules for the cluster data ports between master and slaves.","Increase the socket timeout configuration in the cluster schema if the remote startup is slow."],"exampleFix":"// before\nString host = \"slave-internal-name\"; // unresolvable\n// after\nString host = \"10.0.0.12\"; // resolvable, firewalled-open slave host","handlingStrategy":"validation","validationCode":"// Pre-flight connectivity check before opening the reader socket\ntry (Socket s = new Socket()) {\n  s.connect(new InetSocketAddress(realHostname, portNumber), 5000); // throws if unreachable\n}","typeGuard":null,"tryCatchPattern":"try { remoteStep.openReaderSocket(baseStep); } catch (KettleException e) { if (e.getMessage().contains(\"Unable to connect to the SocketWriter\")) { log.error(\"Remote slave \" + hostname + \":\" + port + \" unreachable or too slow\"); } else { throw e; } }","preventionTips":["Open cluster data ports in firewalls between master and slaves","Use resolvable, stable hostnames (or IPs) in cluster schemas","Pre-start slave servers before launching clustered transformations","Raise socket timeout settings when slaves start slowly"],"tags":["kettle","socket","timeout","network","cluster"],"backgroundTag":"request-timeout","analyzedSha":"f3058517a153da500bf4551f46d79b91bf8ec552","analyzedAt":"2026-09-13T14:04:16.340Z","contentChangedAt":"2026-09-13T14:04:16.340Z","schemaVersion":2},"datasetVersion":"2026-09-20T23:17:15.980Z"}