Error handling data: inflating sfs2x, Invalid SFSDataType

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

Moderators: Lapo, Bax

boom_boom_room
Posts: 54
Joined: 19 Jan 2011, 12:36

Error handling data: inflating sfs2x, Invalid SFSDataType

Postby boom_boom_room » 25 May 2011, 18:24

We get the following exceptions in our unity console randomly. Any reasons why it could happen? Any fixes? We have installed the release candidate too.

Error: 1

[SFS - ERROR] Error handling data: inflating: unknown compression method at ComponentAce.Compression.Libs.zlib.ZOutputStream.Write (System.Byte[] b1, Int32 off, Int32 len) [0x00000] in <filename unknown>:0
at Sfs2X.Util.ByteArray.Uncompress () [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0

and

Error: 2

[SFS - ERROR] Error handling data: Invalid SFSDataType. Expected: SFS_OBJECT, found: 55 at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.DecodeSFSObject (Sfs2X.Util.ByteArray buffer) [0x00000] in <filename unknown>:0
at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Binary2Object (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Entities.Data.SFSObject.NewFromBinaryData (Sfs2X.Util.ByteArray ba) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.OnPacketRead (Sfs2X.Util.ByteArray packet) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0

also this one:

Error: 3
[SFS - ERROR] Error handling data: Can't decode an SFSObject. Byte data is insufficient. Size: 1 byte(s)

The second case is understandable that it is unable to decode to SFSObject but not sure why it would fail randomly.
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 27 May 2011, 11:19

This is the first time I see this specific error.
It could be caused by a non-SFS2X client sending garbage data, a network error or an API issue we are not aware of.
Do you know a way to reproduce it?

Anyways we're close to a new release which also includes a couple of fixes in the binary compression department, so you will able to check it out soon.
Lapo
--
gotoAndPlay()
...addicted to flash games
boom_boom_room
Posts: 54
Joined: 19 Jan 2011, 12:36

Postby boom_boom_room » 27 May 2011, 19:20

It's random and hence I am not sure what is causing this. I don't see anything going on in the java code so as to send some invalid data. It looks like it's some data not being decoded properly at the client side due to a garbage or corrupt packet because the byte size is not always the same. After I get any of these errors the client stops responding and is in a weird state. We see no way of recovering from this as the socket is always connected and no event is thrown.

We tried increasing the minimum packet size for compression and reducing the queue size for processing incoming packets but the error still happens. Is there a solution? When is the release expected?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 28 May 2011, 06:54

The update is going to be out in a couple of weeks.
In the meanwhile I would recommend disabling compression from server side. This should temporarily fix it.
Lapo

--

gotoAndPlay()

...addicted to flash games
boom_boom_room
Posts: 54
Joined: 19 Jan 2011, 12:36

Postby boom_boom_room » 28 May 2011, 17:34

How do we disable it?
padde
Posts: 7
Joined: 25 Nov 2010, 12:54

Postby padde » 30 May 2011, 09:57

Hi there,

same problem here:

38: ERROR log: Chat error (OnConnection): General error reading data from socket: Invalid SFSDataType. Expected: SFS_OBJECT, found: 2 at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.DecodeSFSObject (Sfs2X.Util.ByteArray buffer) [0x00000] in <filename unknown>:0
at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Binary2Object (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Entities.Data.SFSObject.NewFromBinaryData (Sfs2X.Util.ByteArray ba) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.OnPacketRead (Sfs2X.Util.ByteArray packet) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.OnDataRead (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Bitswarm.BitSwarmClient.OnSocketData (System.Byte[] data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.CallOnData (System.Byte[] data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.HandleBinaryData (System.Byte[] buf, Int32 size) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.Read () [0x00000] in <filename unknown>:0 stack trace: UnityEngine.Debug:LogError(Object) SFS2XChatGUI:OnConnection(BaseEvent) Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent) Sfs2X.SmartFox:ProcessEvents() SFS2XChatGUI:FixedUpdate()


29: ERROR log: Chat error (OnConnection): General error reading data from socket: Invalid SFSDataType. Expected: SFS_OBJECT, found: 0 at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.DecodeSFSObject (Sfs2X.Util.ByteArray buffer) [0x00000] in <filename unknown>:0
at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Binary2Object (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Entities.Data.SFSObject.NewFromBinaryData (Sfs2X.Util.ByteArray ba) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.OnPacketRead (Sfs2X.Util.ByteArray packet) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.OnDataRead (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Bitswarm.BitSwarmClient.OnSocketData (System.Byte[] data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.CallOnData (System.Byte[] data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.HandleBinaryData (System.Byte[] buf, Int32 size) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.Read () [0x00000] in <filename unknown>:0 stack trace: UnityEngine.Debug:LogError(Object) SFS2XChatGUI:OnConnection(BaseEvent) Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent) Sfs2X.SmartFox:ProcessEvents() SFS2XChatGUI:FixedUpdate()



43: ERROR log: Chat error (OnConnection): General error reading data from socket: inflating: unknown compression method at ComponentAce.Compression.Libs.zlib.ZOutputStream.Write (System.Byte[] b1, Int32 off, Int32 len) [0x00000] in <filename unknown>:0
at Sfs2X.Util.ByteArray.Uncompress () [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.OnDataRead (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Bitswarm.BitSwarmClient.OnSocketData (System.Byte[] data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.CallOnData (System.Byte[] data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.HandleBinaryData (System.Byte[] buf, Int32 size) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.Read () [0x00000] in <filename unknown>:0 stack trace: UnityEngine.Debug:LogError(Object) SFS2XChatGUI:OnConnection(BaseEvent) Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent) Sfs2X.SmartFox:ProcessEvents() SFS2XChatGUI:FixedUpdate()



Happens absolutely randomly. Any help would be really appreciated!

Regards,
Patrick
padde
Posts: 7
Joined: 25 Nov 2010, 12:54

Postby padde » 30 May 2011, 14:55

I got a new error message:

ERROR log: Chat error (OnConnection): General error reading data from socket: Can't decode an SFSObject. Byte data is insufficient. Size: 2 byte(s) at Sfs2X.Protocol.Serialization.DefaultSFSDataSerializer.Binary2Object (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Entities.Data.SFSObject.NewFromBinaryData (Sfs2X.Util.ByteArray ba) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSProtocolCodec.OnPacketRead (Sfs2X.Util.ByteArray packet) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.HandlePacketData (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.SFSIOHandler.OnDataRead (Sfs2X.Util.ByteArray data) [0x00000] in <filename unknown>:0
at Sfs2X.Bitswarm.BitSwarmClient.OnSocketData (System.Byte[] data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.CallOnData (System.Byte[] data) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.HandleBinaryData (System.Byte[] buf, Int32 size) [0x00000] in <filename unknown>:0
at Sfs2X.Core.Sockets.TCPSocketLayer.Read () [0x00000] in <filename unknown>:0 stack trace: UnityEngine.Debug:LogError(Object) SFS2XChatGUI:OnConnection(BaseEvent) Sfs2X.Core.EventDispatcher:DispatchEvent(BaseEvent) Sfs2X.SmartFox:ProcessEvents() SFS2XChatGUI:FixedUpdate()


Seems to happen when there are just more users on the server.
It happened when there were about 300 users. We got a licensefile for 500 users.

Regards,
Patrick
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 30 May 2011, 15:27

You can turn off the compression by configuring a very high value for the "Protocol compression threshold", under the Server Configurator in the AdminTool.

Default is 1024 bytes, which means that anything > 1024bytes gets compressed. To avoid the compression to kick in use a value like 10000000 (10MB) or so...
Lapo

--

gotoAndPlay()

...addicted to flash games
padde
Posts: 7
Joined: 25 Nov 2010, 12:54

Postby padde » 30 May 2011, 15:31

Okay, thanks. I'll try that and report if it worked.
boom_boom_room
Posts: 54
Joined: 19 Jan 2011, 12:36

Postby boom_boom_room » 30 May 2011, 17:30

I think we have already done it but it does not help. We will try with a bigger value than what we have set.
padde
Posts: 7
Joined: 25 Nov 2010, 12:54

Postby padde » 30 May 2011, 18:23

Hi,

tried 10 MB, unfortunately it doesn't work.
Still the same problems.

Any further ideas?


Regards,
Patrick
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 31 May 2011, 12:25

Hmmm, Padde actually your problem does not seem to be related to compression. The original post was, your is not.
You should explain a bit better how this problem shows up, and most importantly please specify server version and API version.
With this I imply that we would expect you are using the latest available versions. If not please proceed with an upgrade and let us know if the issue persists after that.

thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
boom_boom_room
Posts: 54
Joined: 19 Jan 2011, 12:36

Postby boom_boom_room » 01 Jun 2011, 13:53

It does not help. It still happens. Any ideas?
User avatar
Lapo
Site Admin
Posts: 23008
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 01 Jun 2011, 14:38

Giving a 2nd look at the error I noticed that this is a problem in compressing the data locally before sending it to the server.
Not the other way around, which is quite weird.
If so... the error should happen on every compression attempt.

I am assuming you are using the latest version RC2a and relative C# API... but in case you don't I would urge you to update.

Thanks
Lapo

--

gotoAndPlay()

...addicted to flash games
boom_boom_room
Posts: 54
Joined: 19 Jan 2011, 12:36

Postby boom_boom_room » 01 Jun 2011, 16:02

The error is random. We have the latest on both the server (RC2a) and the Unity client (SmartFox2.dll).

Are the other two errors (SFSDataType error and the Decode error) related to the compression error? Do you think the next release (with fixes for compression) you mentioned earlier would help eliminate these issues?

Return to “SFS2X Questions”

Who is online

Users browsing this forum: No registered users and 62 guests