RestComm / load-balancer

RestComm Converged (SIP/HTTP/WebSockets/SMPP) Load Balancer
http://www.restcomm.com/
GNU Affero General Public License v3.0
26 stars 31 forks source link

ERROR log on response from node to TLS->TCP request #129

Closed gyoetam closed 6 years ago

gyoetam commented 7 years ago

Load balancer writes ERROR log when processing a response (to a TLS->TCP request from external client to node) and trying to deliver response via TLS to client. Seems like it's looking for the tlsPort of the node, which it doesn't have (see SIPNode in same message), as all TLS is terminated by LB.

The response is still delivered correctly to the client.

2017-09-20 22:29:07,847 ERROR pool-AffinityJAIN-thread-4 org.mobicents.tools.sip.balancer.SIPBalancerValveProcessor - A Problem happened in the BalancerValve on response SIP/2.0 200 OK
Via: SIP/2.0/TLS [external-client-address]:[port];rport=[rport];branch=...;received=[external-client-address]
Record-Route: <sip:[LB-internal-address]:[LB-internal-TCP-port];transport=tcp;lr;node_host=[node-ip];node_port=[node-tcp-port];version=0>
Record-Route: <sip:[LB-external-address]:[LB-external-TLS-port];transport=tls;lr;node_host=[node-ip];node_port=[node-tcp-port];version=0>
CSeq: 2 INVITE
Contact: <sip:[node-ip]:[node-tcp-port];transport=tcp>
[...]

java.lang.RuntimeException: No transport found for node SIPNode hostname[...] ip[...] httpPort[...] sslPort[...] sessionId[...] udpPort[...] version[0] tcpPort[...]  tlsPort
        at org.mobicents.tools.sip.balancer.CallIDAffinityBalancerAlgorithm.processInternalResponse(CallIDAffinityBalancerAlgorithm.java:120)
        at org.mobicents.tools.sip.balancer.SIPBalancerForwarder.processResponse(SIPBalancerForwarder.java:2334)
        at org.mobicents.tools.sip.balancer.SIPBalancerValveProcessor.processResponse(SIPBalancerValveProcessor.java:110)
        at gov.nist.javax.sip.stack.SIPTransactionStack.newSIPServerResponse(SIPTransactionStack.java:1674)
        at gov.nist.javax.sip.stack.ConnectionOrientedMessageChannel.processMessage(ConnectionOrientedMessageChannel.java:541)
        at gov.nist.javax.sip.parser.NioPipelineParser$Dispatch.run(NioPipelineParser.java:137)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:473)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
        at gov.nist.javax.sip.MDCScheduledTHExecutor$MDCFuture.run(MDCScheduledTHExecutor.java:57)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1152)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:622)
        at java.lang.Thread.run(Thread.java:748)
knosach commented 6 years ago

hi @gyoetam , the main issue is in this line https://github.com/RestComm/load-balancer/blob/master/jar/src/main/java/org/mobicents/tools/sip/balancer/CallIDAffinityBalancerAlgorithm.java#L72. I mean why LB did not find senderNode in the map. Can you provide more details: 1) lb config 2) debug log thanks

knosach commented 6 years ago

not reproducible with the last version of LB