{"record":{"id":"c30e3b1f009a5d08","repo":"pentaho/pentaho-kettle","slug":"ssh-connection-failed-while-waiting-with-no-configured","errorCode":null,"errorMessage":"SSH connection failed while waiting with no configured timeout","messagePattern":"SSH connection failed while waiting with no configured timeout","errorType":"exception","errorClass":"SshTimeoutException","httpStatus":null,"severity":"error","filePath":"engine/src/main/java/org/pentaho/di/core/ssh/mina/MinaSshConnection.java","lineNumber":264,"sourceCode":"    // until the connection is established with no deadline imposed.\n    long connectTimeout = config.getConnectTimeoutMillis();\n    boolean connected;\n\n    try {\n      if ( connectTimeout > 0 ) {\n        connected = cf.await( connectTimeout );\n      } else {\n        connected = cf.await();\n      }\n    } catch ( IOException e ) {\n      throw new SshConnectionException( \"SSH connection failed during await\", e );\n    }\n\n    if ( !connected ) {\n      if ( connectTimeout > 0 ) {\n        throw new SshTimeoutException( \"SSH connection timed out after \" + connectTimeout + \"ms\" );\n      }\n      throw new SshTimeoutException( \"SSH connection failed while waiting with no configured timeout\" );\n    }\n\n    if ( !cf.isConnected() ) {\n      Throwable cause = cf.getException();\n      throw new SshConnectionException( \"SSH connection failed\", cause );\n    }\n  }\n\n  private ClientSession establishSession( ConnectFuture cf ) throws SshConnectionException {\n    ClientSession s = cf.getSession();\n\n    if ( s == null ) {\n      throw new SshConnectionException( \"SSH connection failed - session is null\" );\n    }\n\n    return s;\n  }\n","sourceCodeStart":246,"sourceCodeEnd":282,"githubUrl":"https://github.com/pentaho/pentaho-kettle/blob/f3058517a153da500bf4551f46d79b91bf8ec552/engine/src/main/java/org/pentaho/di/core/ssh/mina/MinaSshConnection.java#L246-L282","documentation":"Thrown by waitForConnection when the ConnectFuture never reaches connected state and no connectTimeout was configured (>0). Since there is no timeout, the wait loop ended through some other exit path without ever becoming connected, so the library fails fast with a descriptive message rather than hanging.","triggerScenarios":"connect() invoked with connectTimeout == 0 (or unset) and the connection wait loop terminates without connected becoming true — e.g. the future completes with a disconnect/exception before any timeout applies.","commonSituations":"Users leaving the timeout field empty/default 0 in the SSH connection dialog; hosts that accept TCP then immediately close the connection (tcpwrappers, MaxStartups limits).","solutions":["Set an explicit positive connectTimeout in the SSH connection config","Check remote sshd logs for connections being dropped at accept time","Test the same connection with a plain ssh client to confirm reachability","Inspect the ConnectFuture exception path — look for a related 'SSH connection failed' cause in logs"],"exampleFix":"// before\nSshConfig cfg = new SshConfig(host, user); // connectTimeout defaults to 0\n// after\ncfg.setConnectTimeout(15000); // fail fast with clear timeout instead of open-ended wait","handlingStrategy":"validation","validationCode":"// before connect()\nif ( config.getConnectTimeout() <= 0 ) {\n  throw new IllegalArgumentException( \"connectTimeout must be set (>0) to get a bounded, diagnosable connect\" );\n}","typeGuard":null,"tryCatchPattern":"try { conn.connect(); }\ncatch ( SshTimeoutException e ) { log.error( \"SSH wait failed with no timeout configured: {}\", e.getMessage() ); }","preventionTips":["Never leave the timeout field at 0/default; set an explicit value","Standardize SSH connection configs via a shared template","Check remote sshd limits (MaxStartups) if connections drop at accept","Test connectivity with the ssh CLI first"],"tags":["ssh","network","timeout","configuration"],"backgroundTag":"missing-required-config-field","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"}