Akka Http TStream errorakka.stream.StreamTcpException: Tcp command [Connect(xyzurl:80,None,List(),Some(10 seconds),true)] failed

Hi , I am facing below issue in Akka http akka_actor=‘2.4.16’, akka_http=‘10.1.8’, akka_stream=‘2.5.22’.
And I have given the below settings
val orig = ConnectionPoolSettings(actorSystem.settings.config).copy(idleTimeout = 7 minutes)
val clientSettings = orig.connectionSettings.withIdleTimeout(7 minutes)
val settings = orig.copy(connectionSettings = clientSettings)

As well in application.conf
akka { jvm-exit-on-fatal-error = false
akka.http.client.idle-timeout=60s
akka.http.client.connecting-timeout=60s
akka.http.host-connection-pool.idle-timeout=60s
akka.http.host-connection-pool.client.idle-timeout=60s
akka.http.host-connection-pool.pool-implementation = 60s
http { host-connection-pool.client.idle-timeout = 60s
client { idle-timeout = 60s }
}
}

ERROR[ClsToXyzProSpaceActor-akka.actor.default-dispatcher-34] AkkaConsumerGeoJsonXYZProSpace$ - Stream errorakka.stream.StreamTcpException: Tcp command [Connect(xyz-layers-pg.cit.cpprd.aws.in.here.com:80,None,List(),Some(10 seconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(10 seconds) expired
akka.stream.StreamTcpException: Tcp command [Connect(xyz-layers-pg.cit.cpprd.aws.in.here.com:80,None,List(),Some(10 seconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(10 seconds) expired
Caused by: akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(10 seconds) expired

I am not getting the proper answer for this . Pls let me know what else I can do in this … Regards, Ashish Sahu

1 Like

This part of the error message is what is happening: Connect timeout of Some(10 seconds) expired

In your config and code you are changing idle-timeout which is when a connection succeeded but had no traffic for a while. Connection timeout means the client tried to create a TCP connection but couldn’t establish a connection for that long.

The connection timeout can be configured with akka.http.client.connecting-timeout but it is likely an indication that something else is wrong (and you won’t be able to connect anyway) if it takes more than 10 seconds.

@johanandren could you elaborate? I have a question at Tcp command [Connect(...,None,List(),Some(10 seconds),true)] failed because of akka.io.TcpOutgoingConnection$$anon$2: Connect timeout of Some(10 seconds) expired which is making me believe that akka may have issues especially when working through a proxy.