Support Board
Date/Time: Mon, 20 Jan 2025 04:04:36 +0000
Post From: DTC Decode error on one message only using same decode function. Google protocol buffers.
[2018-04-15 23:32:36] |
enemyspy - Posts: 306 |
Hi, using google protocol buffers on My DTC server. I am getting this error when decoding the DTC message SECURITY_DEFINITION_FOR_SYMBOL_REQUEST sent from Sierra Chart version 1727 remote client: google.protobuf.message.DecodeError: Error parsing message This snippet from my log includes the encoded message and the decoded header. received b'\x16\x00\xfa\x01\x08\x01\x12\x08LTC--BTC\x1a\x04OKEX\x18\x00e\x00\x08\x01\x10\x01\x1a\x08LTC--BTC"\x04OKEX' Message Enum: SECURITY_DEFINITION_FOR_SYMBOL_REQUEST decoded header: (22, 506) serlialized message: b'\x08\x01\x12\x08LTC--BTC\x1a\x04OKEX\x18\x00e\x00\x08\x01\x10\x01\x1a\x08LTC--BTC"\x04OKEX' Using the same uniform decode method: LOGON,HEARTBEAT. MARKET_DATA/DEPTH requests alld decode properly. So wondering why the google protocol decoding would only fail on the one message above from Sierra Chart. Does the message above look to be encoded properly? Full log with stack trace of exception if necessary: starting up on xxx.xxx.xxx.xxx accepting connections connection from ('xx.xx.xx.xx', 65427) Active Threads: 3 accepting connections received b'\x10\x00\x06\x00\x08\x00\x00\x00\x04\x00\x00\x00DTC\x00' sending response response sent back to client received b'7\x00\x01\x00\x08\x08\x12\x08enemyspy\x1a\tlemonbomb"\x00(\x000\x008\x14@\x02J\x00R\x00Z\x0cSierra Chart' Message Enum: LOGON_REQUEST sending response response sent back to client received b'\x0f\x00\x03\x00\x08\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00' Message Enum: HEARTBEAT sending response response sent back to client received b'\x0f\x00\x03\x00\x08\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00' Message Enum: HEARTBEAT sending response response sent back to client received b'\x0f\x00\x03\x00\x08\x00\x11\x00\x00\x00\x00\x00\x00\x00\x00' Message Enum: HEARTBEAT sending response response sent back to client received b'\x16\x00\xfa\x01\x08\x01\x12\x08LTC--BTC\x1a\x04OKEX\x18\x00e\x00\x08\x01\x10\x01\x1a\x08LTC--BTC"\x04OKEX' Message Enum: SECURITY_DEFINITION_FOR_SYMBOL_REQUEST decoded header: (22, 506) serlialized message: b'\x08\x01\x12\x08LTC--BTC\x1a\x04OKEX\x18\x00e\x00\x08\x01\x10\x01\x1a\x08LTC--BTC"\x04OKEX' Exception in thread Thread-2: Traceback (most recent call last): File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner self.run() File "/usr/lib/python3.5/threading.py", line 862, in run self._target(*self._args, **self._kwargs) File "/var/www/FlaskApp/FlaskApp/dtc/dtcServer.py", line 99, in listenToClient res = self.onMessage(data,ID) File "/var/www/FlaskApp/FlaskApp/dtc/dtcServer.py", line 145, in onMessage return dtc.SecurityDefinitionResponse(msg,self.symbset) File "/var/www/FlaskApp/FlaskApp/dtc/dtcProtocol.py", line 116, in SecurityDefinitionResponse request.ParseFromString(msg) google.protobuf.message.DecodeError: Error parsing message |