RestComm/jdiameter

Read thread is stopped for socket

abidmaria opened this issue · 13 comments

Hello ,
The below log messages indicate that the connection between my client and the server is being closed by the server since i am getting "Read thread is stopped for socket", from the Wireshark the message indicates that the server is closing the connection after it has sent the final "ACK" message indeed , the server is sending a FIN,ACK after the client sends a Capabilities-Exchange message. This suggests that the server is properly receiving the client's message, but for some reason it is not responding with a message of its own and instead is closing the connection. the localhost is my laptop , below is the logs
`
2023-01-09 13:11:43,946 INFO DictionaryImpl - Mobicents Diameter Dictionary loaded in 188ms -- Vendors[10] Commands[52] Types[20] AVPs[510]

2023-01-09 13:11:44,044 INFO StackImpl - (-)(-)(-)(-)(-) Started Mobicents DIAMETER Stack v1.5.10.0-build639 (-)(-)(-)(-)(-)

2023-01-09 13:11:44,544 INFO StackCreator - Diameter CLIENT :: Adding Listener for [AppId [Vendor-Id:0; Auth-Application-Id:4; Acct-Application-Id:0]].

2023-01-09 13:11:44,547 INFO StackCreator - Diameter CLIENT :: Supporting 1 applications.

2023-01-09 13:11:45,152 INFO NetworkGuard - Open server socket ServerSocket[addr=/127.0.0.1,localport=8080]

2023-01-09 13:12:00,267 INFO TCPTransportClient - Read thread is stopped for socket [Socket[addr=10.10.10.113/10.10.203.113,port=3868,localport=60884]]
2023-01-09 13:12:00,267 INFO TCPTransportClient - Read thread is stopped for socket [Socket[addr=10.10.10.113/10.105.10.113,port=3868,localport=60884]]
2023-01-09 13:12:00,267 INFO TCPTransportClient - Read thread is stopped for socket [Socket[addr=10.10.10.113/10.105.10.113,port=3868,localport=60884]]`

do you have any idea please

Thanks

Best Regards

Team , this GIThub is still active ? i cannot see any comments or feedback

Hello abidmaria, you could try enabling DEBUG log level and then check why the thread is closing the channel, CEA/CER cycle not completing successfully usually indicates application capability misconfiguration.

Hello abidmaria, you could try enabling DEBUG log level and then check why the thread is closing the channel, CEA/CER cycle not completing successfully usually indicates application capability misconfiguration.

Thank you , sure I will follow your recommandation and I will let you know

Hello

The root cause was there is no answer for capability exchange:

before exchanging CCR-I... capability exchange should be answered first by the server , now I don't know if this is also related to the client ...still checking....what do you think ?

Thanks

Hello abidmaria, you are correct, first comes the SCTP (init & ack; echo & ack), then the capabilities exchange (it is required to set up apps & params on your end), only after those go for the credit control dialog. With that said, if you doubt one end, you can deploy the diameter example provided as a server & as a client, mind the setting of ports (avoid using the same ports on the same host, if that is the case). You´ll have then complete control, debug settings, and networking sniffing locally.

CaptureDiameter
Thank you for your feedback , establish the SCTP connection by sending the "init" message and then acknowledging the "ack" response -> done
Then, initiate the capabilities exchange to set up the applications and parameters - done after i got disconnected by the server, i am suspecting Vendor-Id and Application-Ids configuration from the client side what do you think ? Please refer to the screenshot

Well, AppId and VendorId shall match in order to establish communication between both ends, if you're trying Credit-Control, it requires VendorId 10415 for 3GPP and AuthApplId as 4 configured. But can't tell you much more, unless you control the remote end... if not, the best path would be to check with the techie staff in charge of the remote end.

Thank you for your feedback , email already sent to OCS expert (server side) , i will keep you updated :
I highlighted the below points :
1.Verify the diameter peers for the API on OCS
2.Check if the peer has been created on OCS and if it is in an unlocked state
3.Ensure that the IP is correctly configured as the endpoint

Hello , The OCS expert suggested setting the Origin host to Diameter in API, and after trying to establish a connection, the success answer 2001 was received. Please refer to the screenshot
success

now i have another problem :

`2023-02-07 12:48:57,653 INFO StackImpl - (-)(-)(-)(-)(-) Starting Mobicents DIAMETER Stack v1.5.10.0-build639 (-)(-)(-)(-)(-)

2023-02-07 12:48:57,778 WARN DictionaryImpl - Duplicated AVP Definition for AVP Code: 456, Vendor-Id: 0. See TRACE logs for definitions.

2023-02-07 12:48:57,790 INFO DictionaryImpl - Mobicents Diameter Dictionary loaded in 86ms -- Vendors[10] Commands[52] Types[20] AVPs[510]

2023-02-07 12:48:57,853 INFO StackImpl - (-)(-)(-)(-)(-) Started Mobicents DIAMETER Stack v1.5.10.0-build639 (-)(-)(-)(-)(-)

2023-02-07 12:48:58,358 INFO StackCreator - Diameter CLIENT :: Adding Listener for [AppId [Vendor-Id:0; Auth-Application-Id:4; Acct-Application-Id:0]].

2023-02-07 12:48:58,358 INFO StackCreator - Diameter CLIENT :: Supporting 1 applications.

java.lang.ClassCastException: class GGSN.StackCreator cannot be cast to class java.util.Stack (GGSN.StackCreator is in unnamed module of loader 'app'; java.util.Stack is in module java.base of loader 'bootstrap')

**at GGSN.Main.setup(Main.java:41)

at GGSN.Main.main(Main.java:25)....2023-02-07 12:49:03,297**

`INFO Client - Sending Request: 272 [E2E:1759510530 -- HBH:0 -- AppID:4]

2023-02-07 12:49:03,297 INFO Client - Request AVPs:

2023-02-07 12:49:03,297 INFO Client - <avp name="Session-Id" .....

....
,....`

**Exception in thread "main" java.lang.AssertionError: Did not receive INITIAL! Client ER:

at org.junit.Assert.fail(Assert.java:89)

at GGSN.Main.startTest(Main.java:77)

at GGSN.Main.main(Main.java:26)**

from Tcpdump no initial request in the trace , do you have any idea please ?

Thanks

Hello , I have fixed the issue , now i have some challenge with AVP 55 ,
2023-03-16 11:50:14,315 INFO Client - <avp name="Failed-AVP" code="279" vendor="0"> 2023-03-16 11:50:14,315 INFO Client - <avp name="Event-Timestamp" code="55" vendor="0" value="" /> 2023-03-16 11:50:14,316 INFO Client - </avp>
from Wireshark , AVP: Failed-AVP(279) l=20 f=-M-
Event-Timestamp: Feb 7, 2036 06:28:16.000000000 UTC

Do you have any idea ?

Thanks

Best Regards

After resolving the issue, I am attempting to include the rating group AVP 432, but I'm encountering the following error:

AVP: Error-Message(281) l=151 f=--- val=[Gy-CCR-Initial] Rating-Group: Failed to extract value from AVP: Rating-Group: Corrupt Unsigned32 Avp: Data length not 4 octets <Avp code=432/>

is there any bug :

this is the code

`AvpSet AVP432 = AVP456.addGroupedAvp(432, true, false);

int ratingGroupValue = 6606;

ByteBuffer ratingGroupBuffer = ByteBuffer.allocate(4);

ratingGroupBuffer.putInt((int) ratingGroupValue);

byte[] ratingGroupBytes = ratingGroupBuffer.array();

AVP432.addAvp(432, ratingGroupBytes, 0, true, false);`

I'm hoping to receive an answer, as I have asked multiple questions without receiving any feedback.

Hello, please any update.
Thanks

Issue fixed !