Tomcat InitCrypto only affecting some users

Post here your questions about SFS2X. Here we discuss all server-side matters. For client API questions see the dedicated forums.

Moderators: Lapo, Bax

Ninjaoninja2
Posts: 194
Joined: 22 Sep 2013, 23:33

Tomcat InitCrypto only affecting some users

Postby Ninjaoninja2 » 19 Jan 2020, 01:45

Hello,

My team and I just launched a new beta using SmartFoxServer2X and some of our users are unable to login since we upgraded to 14.0. We're getting a couple of errors in the server logs...

Code: Select all

Crypto Init Failed :: Server side session not found for id:..., from: xx.xx.xxx

Code: Select all

Crypto Init Failed :: Server side session not found for id: null, from: xx.xx.xxx

Code: Select all

Invalid request, session expired. Message: { ssid:...., cmd: poll, data: NoData }

Code: Select all

Crypto Init Failed :: Cryptography already initialized, from: xx.xx.xxx


We are unfamiliar with these errors, and have never Tomcat, this is new for us. Any suggestions?
User avatar
Lapo
Site Admin
Posts: 21340
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Tomcat InitCrypto only affecting some users

Postby Lapo » 20 Jan 2020, 08:12

Hi,
these are different errors, with different context.
It would help to see the full stack trace, but anyways they represent different connection/login issues.

As regards Tomcat, I am not sure why it should be the problem. For example the " Server side session not found for id" is a client issue, not a server side one. It means that the client did not send a valid session key.

Judging from these messages I would suspect some deeper login issues, probably due to slow server side code. Do you run a custom login Extension? If so I would measure the time it takes to complete the login process and log it in the log files. Then check what those timings are and make sure they don't exceed a few hundreds milliseconds. Ideally they should be <=50ms

Thanks
Lapo
--
gotoAndPlay()
...addicted to flash games
Jochanan
Posts: 75
Joined: 11 May 2018, 09:12

Re: Tomcat InitCrypto only affecting some users

Postby Jochanan » 21 Jan 2020, 15:47

We are having same issues with 2.14.
Unity3D API: Version: 1.7.12
We are using custom login. We are having issues with iOS (Windows, Android and MacOS was fine)

In the server log are these messages:

Code: Select all

com.smartfoxserver.v2.exceptions.SFSExtensionException: Extension Request refused. Sender is not a User: { Id: 77, Type: DEFAULT, Logged: No, IP: XXX:49485 } com.smartfoxserver.v2.controllers.v290.ExtensionReqController.processRequest(ExtensionReqController.java:93) com.smartfoxserver.v2.controllers.v290.ExtensionReqController$1.run(ExtensionReqController.java:68) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) java.lang.Thread.run(Thread.java:748)
com.smartfoxserver.v2.exceptions.SFSExtensionException: Extension Request refused. Sender is not a User: { Id: 76, Type: DEFAULT, Logged: No, IP: XXX:49484 } com.smartfoxserver.v2.controllers.v290.ExtensionReqController.processRequest(ExtensionReqController.java:93) com.smartfoxserver.v2.controllers.v290.ExtensionReqController$1.run(ExtensionReqController.java:68) java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) java.lang.Thread.run(Thread.java:748)
...
Crypto Init Failed :: Server side session not found for id: 26ffca7861b6fedd20bd9fee1ffadb0a, from: XXX
Crypto Init Failed :: Server side session not found for id: da9152d8f1bd720db71a12e9291f86e6, from: XXX


Any thoughts?
User avatar
Lapo
Site Admin
Posts: 21340
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Tomcat InitCrypto only affecting some users

Postby Lapo » 21 Jan 2020, 16:08

Yes,
it sounds like the client session dies before the cryptography exchange is completed.
The client session is the socket connection established between client and SFS2X, before a login is performed. By default the client is allowed to remain in this state for ~20 seconds before it's kicked out.

This is normally more than enough time to either login, or initialize the cryptography and then login. It may be that for some mobile clients this is actually not enough time and they are failing to complete the process.

I would suggest to increase the session timeout to 60 seconds via the AdminTool > Server Configurator > Session max idle time.


Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Jochanan
Posts: 75
Joined: 11 May 2018, 09:12

Re: Tomcat InitCrypto only affecting some users

Postby Jochanan » 21 Jan 2020, 17:12

That is not a solution for us, because we have two kinds of servers, one of them is lobby which has information about available games and other one is game, where the games are actually played on.

Our game is time-restricted and time starts as soon as lobby creates a game room on game server, so user cannot connect 20+ seconds to the server.
User avatar
Lapo
Site Admin
Posts: 21340
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Tomcat InitCrypto only affecting some users

Postby Lapo » 22 Jan 2020, 08:35

If my supposition is correct (some clients are too slow during connection/login) then you have no control over that delay because it is dependent on the client's network conditions.

The solution I suggested (increase session timeout) simply makes the server more tolerant to such delay.
Lapo

--

gotoAndPlay()

...addicted to flash games
Ninjaoninja2
Posts: 194
Joined: 22 Sep 2013, 23:33

Re: Tomcat InitCrypto only affecting some users

Postby Ninjaoninja2 » 29 Jan 2020, 23:38

Lapo wrote:If my supposition is correct (some clients are too slow during connection/login) then you have no control over that delay because it is dependent on the client's network conditions.

The solution I suggested (increase session timeout) simply makes the server more tolerant to such delay.

We also did this, and it seemed to fix the issue.

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 23 guests