Odd Error

Need help with SmartFoxServer? You didn't find an answer in our documentation? Please, post your questions here!

Moderators: Lapo, Bax

Zelcer
Posts: 17
Joined: 26 Jan 2013, 04:46

Odd Error

Postby Zelcer » 06 Dec 2015, 04:55

After recently applying the 1.6.18 patch (from 1.6.6) I've been encountering this error once or twice every second, continuously.

Code: Select all

[ WARNING ] [id: 11] (SmartFoxServer.dispatchEvent): Unknown event type: , Disconnecting: java.nio.channels.SocketChannel[connected local=/XX remote=/YY]


Where XX is my server's IP and port, and YY is the IP address and port of a connected user. The server is running on Ubuntu, with around 400-500 concurrent users. I didn't receive this error when using SFS PRO 1.6.6. I should also mention I don't encounter this error on my local windows server, which is also using 1.6.18 (however my local server is only for testing, so I'm the only user on it). I don't believe the actual user is disconnected when this error occurs, as none of my players have reported any issues. I don't believe it is breaking any sort of game logic, either.

Any help is appreciated :)
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Odd Error

Postby Lapo » 06 Dec 2015, 14:04

I think the patch is exposing possible fake clients attempting to talk to your SmartFoxServer.
The error simply indicates that a client has sent a request that the server can't decode. In other words the client is not speaking the server's protocol.

It could be one or more web bots, scanning the internet for targeted attacks etc... If the problem keeps going on I'd recommend checking the sender's IP address(es) and banish them. Best option would be to shut them off via a firewall config.

cheers
Lapo
--
gotoAndPlay()
...addicted to flash games
Zelcer
Posts: 17
Joined: 26 Jan 2013, 04:46

Re: Odd Error

Postby Zelcer » 08 Dec 2015, 22:32

Hey Lapo, thanks for the quick response.

In my case, I'm not so sure it has to do with fake clients. There are hundreds of different IP addresses, many from seemingly valid users, and I've even encountered my own IP a couple times. Could I be causing malformed requests in my server logic somewhere? Could it have to do with passing the login event into another thread?

Also, my server crashed early today (this hasn't happened in a very long time) with a SIGKILL error. Do you think these errors could be related at all?

Thanks again.

EDIT: Nevermind about the SIGKILL issue, I've found the source and fixed it. I'm still stumped on the unknown event type error though.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Odd Error

Postby Lapo » 09 Dec 2015, 07:46

That's interesting.... if you have seen your own address in the list of errors as well as other possibly ligitimate IPs I would probably suspect data corruption at some point in your network.

Is there a firewall in front of your server or installed on the server itself? If so what firewall is it?
Also what OS are you running on?

A couple more SFS-related questions:
What client technology are you using?
What version is the server?
What version is the client API?

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
Zelcer
Posts: 17
Joined: 26 Jan 2013, 04:46

Re: Odd Error

Postby Zelcer » 09 Dec 2015, 08:54

The server is running on Ubuntu 12.04. The default firewall is disabled, and I've not installed any others. The client uses Adobe Flash Player with AS2, the SWF is built for version 11.2. The server is running version 1.6.18. The client API I believe is 1.6.6, or whichever the version that is included with the "SmartFoxServer Pro 1.6.18 patch" here: http://smartfoxserver.com/download/sfsPro#p=updates
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Odd Error

Postby Lapo » 09 Dec 2015, 11:30

Thanks for the details. Everything seems in order.
Is there a way in which you can reproduce the error?
Lapo

--

gotoAndPlay()

...addicted to flash games
Zelcer
Posts: 17
Joined: 26 Jan 2013, 04:46

Re: Odd Error

Postby Zelcer » 09 Dec 2015, 11:54

I'll do some testing and let you know.
Zelcer
Posts: 17
Joined: 26 Jan 2013, 04:46

Re: Odd Error

Postby Zelcer » 18 Dec 2015, 17:02

All I've been able to figure out so far is it happens before a user logs on, just before the loginRequest event is fired.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Odd Error

Postby Lapo » 19 Dec 2015, 10:17

This seems to confirm my suspect that the client causing this error is not a real SmartFox client and it is sending "garbage" to the server.

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games
Zelcer
Posts: 17
Joined: 26 Jan 2013, 04:46

Re: Odd Error

Postby Zelcer » 20 Dec 2015, 00:42

Hmm, okay. Thanks for the help.

While I have you here, would you mind answering a question unrelated to this matter? Imagine running two instances of SFS on the same computer. Both SFS instances connect to the same database. I remember reading somewhere that database executions are thread safe, but how would that work across both instances? For example, a player logs into the first SFS instance, then logs out, and logs into the 2nd SFS instance. When the user logged out of the first SFS instance a database command was executed to update their data in the database. When this player logs into the second SFS instance, that same data is loaded from the database. Would there ever be a time when the data-saving command (1st instance) hadn't finished before the data-getting command (2nd instance)?

If there is, would I have to synchronize both instances with something like Netty? Or is there an alternative?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Re: Odd Error

Postby Lapo » 20 Dec 2015, 11:45

What you're describing is a concurrency scenario in the database, but it has nothing to do with SmartFox.

You could have two threads in any application attempting to concurrently read/write the same DB record. The answer is that the database handles this internally, making sure data doesn't get corrupted. How table or table row locking is something specific to your database so I'd recommend consulting the vendor's doc to learn more about it.

For instance if you use MySQL see here:
http://dev.mysql.com/doc/refman/5.7/en/ ... cking.html

cheers
Lapo

--

gotoAndPlay()

...addicted to flash games

Return to “SmartFoxServer 1.x Discussions and Help”

Who is online

Users browsing this forum: No registered users and 30 guests