Unexpected 402::Unknown client from server

95 views
Skip to first unread message

Yoke Khei Lam

unread,
Aug 24, 2020, 2:29:54 PM8/24/20
to cometd-users
Hi,

I captured tcpdump at client application side because received 402::Unknown client error from server sometimes unexpectedly.

2020-08-24 09:08:11.505196 << {"id":"833","connectionType":"long-polling","channel":"/meta/connect","clientId":"epxeiixj1jox7f4105ryeloj2uck"}
2020-08-24 09:08:11.513197 >> {"channel":"/test/info/all","data":"89\u001f2020-08-24 09:08:11.0"},{"channel":"/meta/connect","successful":true,"id":"833"}
2020-08-24 09:08:12.013912 << {"id":"834","connectionType":"long-polling","channel":"/meta/connect","clientId":"epxeiixj1jox7f4105ryeloj2uck"}
2020-08-24 09:08:12.024756 >> {"channel":"/test/info/all","data":"26\u001f3.554834875E8\u001d25\u001f747509610"},{"channel":"/test/connectivity","data":"2020-08-24 09:08:11.927\u001d2JY"},{"channel":"/meta/connect","successful":true,"id":"834"}
2020-08-24 09:08:12.525206 << {"id":"835","connectionType":"long-polling","channel":"/meta/connect","clientId":"epxeiixj1jox7f4105ryeloj2uck"}
2020-08-24 09:08:12.593756 >> {"channel":"/test/info/all","data":"101\u001f400\u001d103\u001f165\u001d102\u001f312"},{"channel":"/meta/connect","successful":true,"id":"835"}
2020-08-24 09:08:13.095140 << {"id":"836","connectionType":"long-polling","channel":"/meta/connect","clientId":"epxeiixj1jox7f4105ryeloj2uck"}
2020-08-24 09:08:13.127718 >> {"channel":"/meta/connect","advice":{"interval":0,"reconnect":"handshake"},"error":"402::Unknown client","successful":false,"id":"836"}
2020-08-24 09:08:13.132524 << {"id":"837","supportedConnectionTypes":["long-polling"],"channel":"/meta/handshake","version":"1.0"}
2020-08-24 09:08:13.146385 >> {"channel":"/meta/handshake","clientId":"eu5w3eyqtt0mml41u6rnsi688jf8","version":"1.0","minimumVersion":"1.0","successful":true,"id":"837","supportedConnectionTypes":["callback-polling","long-polling"]}
2020-08-24 09:08:13.150535 << {"id":"840","connectionType":"long-polling","advice":{"timeout":0},"channel":"/meta/connect","clientId":"eu5w3eyqtt0mml41u6rnsi688jf8"}
2020-08-24 09:08:13.159826 >> {"channel":"/meta/connect","advice":{"timeout":60000,"interval":500,"reconnect":"retry"},"successful":true,"id":"840"}

Client application detail:
<dependency>
  <groupId>org.cometd.java</groupId>
  <artifactId>cometd-java-client</artifactId>
  <version>2.3.0</version>
</dependency>

 Server application detail:
<dependency>
  <groupId>org.cometd.java</groupId>
  <artifactId>bayeux-api</artifactId>
  <version>2.9.1</version>
</dependency>
<dependency>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-server</artifactId>
  <version>8.1.16.v20140903</version>
</dependency>
<dependency>
  <groupId>org.eclipse.jetty</groupId>
  <artifactId>jetty-servlets</artifactId>
  <version>8.1.16.v20140903</version>
<dependency>
<groupId>org.cometd.java</groupId>
  <artifactId>cometd-java-server</artifactId>
  <version>2.9.1</version>
</dependency>

web.xml:
<init-param>
  <param-name>timeout</param-name>
  <param-value>60000</param-value>
</init-param>
<init-param>
  <param-name>maxInterval</param-name>
  <param-value>20000</param-value>
</init-param>
<init-param>
  <param-name>interval</param-name>
  <param-value>500</param-value>
</init-param>
<init-param>
  <param-name>logLevel</param-name>
  <param-value>2</param-value>
</init-param>

Please share some insights how to investigate root cause on either client or server side? The interval of sending /meta/connect looks ok. Could it be due to CometD version compatibility issue? Thank you.

Best regards,
YK

Simone Bordet

unread,
Aug 24, 2020, 2:31:36 PM8/24/20
to cometd-users
Hi,

On Mon, Aug 24, 2020 at 8:29 PM Yoke Khei Lam <yoke...@gmail.com> wrote:
>

[snip]

CometD 2.x is really old and not maintained anymore.
Please upgrade to CometD 5.x and see if you still have the problem.

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.

Yoke Khei Lam

unread,
Aug 25, 2020, 11:44:41 AM8/25/20
to cometd-users
Hi,

Thanks for quick feedback. I will propose to customer to upgrade both CometD client and server application in production environment to version 5.x. Indeed the problem is not due to old CometD version. It is a bug in client application,  which sends two long polling request to server at the same time. Server accepts only one long polling request for single sign-on, hence disconnected the old session.

Best regards,
YK

Reply all
Reply to author
Forward
0 new messages