Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed message parsing #16

Closed
hoffi085 opened this issue May 17, 2021 · 2 comments
Closed

Failed message parsing #16

hoffi085 opened this issue May 17, 2021 · 2 comments

Comments

@hoffi085
Copy link

Describe the bug
The data-collector cannot parse the message from the gateway.

Log

--- Logging error ---
2021-05-17T13:25:01.857048206Z  Traceback (most recent call last):
2021-05-17T13:25:01.857050267Z    File "/root/app/auditing/datacollectors/LoraServerIOCollector.py", line 305, in on_message
2021-05-17T13:25:01.857052381Z      standard_packet['modu'] = data_rate.get('modulation')
2021-05-17T13:25:01.857054493Z  AttributeError: 'NoneType' object has no attribute 'get'
2021-05-17T13:25:01.857056511Z  
2021-05-17T13:25:01.857058665Z  During handling of the above exception, another exception occurred:
2021-05-17T13:25:01.857060818Z  
2021-05-17T13:25:01.857073146Z  Traceback (most recent call last):
2021-05-17T13:25:01.857075270Z    File "/usr/lib/python3.7/logging/__init__.py", line 1034, in emit
2021-05-17T13:25:01.857079975Z      msg = self.format(record)
2021-05-17T13:25:01.857082044Z    File "/usr/lib/python3.7/logging/__init__.py", line 880, in format
2021-05-17T13:25:01.857084244Z      return fmt.format(record)
2021-05-17T13:25:01.857086378Z    File "/usr/lib/python3.7/logging/__init__.py", line 619, in format
2021-05-17T13:25:01.857088692Z      record.message = record.getMessage()
2021-05-17T13:25:01.857090797Z    File "/usr/lib/python3.7/logging/__init__.py", line 380, in getMessage
2021-05-17T13:25:01.857096189Z      msg = msg % self.args
2021-05-17T13:25:01.857098317Z  TypeError: not all arguments converted during string formatting
2021-05-17T13:25:01.857100489Z  Call stack:
2021-05-17T13:25:01.857102545Z    File "/usr/lib/python3.7/threading.py", line 885, in _bootstrap
2021-05-17T13:25:01.857104659Z      self._bootstrap_inner()
2021-05-17T13:25:01.857106694Z    File "/usr/lib/python3.7/threading.py", line 917, in _bootstrap_inner
2021-05-17T13:25:01.857108781Z      self.run()
2021-05-17T13:25:01.857110758Z    File "/usr/lib/python3.7/threading.py", line 865, in run
2021-05-17T13:25:01.857113060Z      self._target(*self._args, **self._kwargs)
2021-05-17T13:25:01.857115287Z    File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 3452, in _thread_main
2021-05-17T13:25:01.857117467Z      self.loop_forever(retry_first_connection=True)
2021-05-17T13:25:01.857119585Z    File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 1779, in loop_forever
2021-05-17T13:25:01.857121716Z      rc = self.loop(timeout, max_packets)
2021-05-17T13:25:01.857123767Z    File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 1181, in loop
2021-05-17T13:25:01.857125821Z      rc = self.loop_read(max_packets)
2021-05-17T13:25:01.857127844Z    File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 1572, in loop_read
2021-05-17T13:25:01.857130090Z      rc = self._packet_read()
2021-05-17T13:25:01.857132189Z    File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 2310, in _packet_read
2021-05-17T13:25:01.857134383Z      rc = self._packet_handle()
2021-05-17T13:25:01.857136499Z    File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 2936, in _packet_handle
2021-05-17T13:25:01.857138583Z      return self._handle_publish()
2021-05-17T13:25:01.857147571Z    File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 3216, in _handle_publish
2021-05-17T13:25:01.857149877Z      self._handle_on_message(message)
2021-05-17T13:25:01.857151923Z    File "/usr/local/lib/python3.7/dist-packages/paho/mqtt/client.py", line 3444, in _handle_on_message
2021-05-17T13:25:01.857154042Z      self.on_message(self, self._userdata, message)
2021-05-17T13:25:01.857156123Z    File "/root/app/auditing/datacollectors/LoraServerIOCollector.py", line 99, in <lambda>
2021-05-17T13:25:01.857158345Z      self.mqtt_client.on_message = lambda client, userdata, msg: self.on_message(client, userdata, msg)
2021-05-17T13:25:01.857160699Z    File "/root/app/auditing/datacollectors/LoraServerIOCollector.py", line 438, in on_message
2021-05-17T13:25:01.857162904Z      json.dumps(mqtt_messsage) if is_protobuf_message else msg.payload.decode("utf-8"))
2021-05-17T13:25:01.857165243Z  Message: 'Error creating Packet in Chirpstack collector:'
2021-05-17T13:25:01.857167438Z  Arguments: (AttributeError("'NoneType' object has no attribute 'get'"), 'Topic: ', 'gateway/00aeaefffe000016/event/up', 'Message: ', '{"phyPayload":"AL3GraPODsb57T4AAArKJQCfXCDdLOQ=","txInfo":{"frequency":868500000,"modulation":"LORA","loRaModulationInfo":{"bandwidth":125,"spreadingFactor":9,"codeRate":"4/5","polarizationInversion":false}},"rxInfo":{"gatewayID":"AK6u//4AABY=","time":"2021-05-17T13:25:01.577240Z","timeSinceGPSEpoch":"1305293119.577s","rssi":-99,"loRaSNR":-14,"channel":7,"rfChain":0,"board":0,"antenna":0,"location":null,"fineTimestampType":"ENCRYPTED","encryptedFineTimestamp":{"aesKeyIndex":0,"encryptedNS":"b+YoGvCf7xj81Xo+s2hvFA==","fpgaID":null},"context":"r85q/A==","uplinkID":"uM8nnPeORxqIJjWCz4ViPA==","crcStatus":"CRC_OK"}}')
@cyones
Copy link
Collaborator

cyones commented May 18, 2021

Hi! Thank you for the bug report. I think this error is solved in the development branch of the data-collectors project. We will be merging this branch into master these days, so the problem should be solved this week.

@cyones cyones closed this as completed Mar 30, 2022
@cyones
Copy link
Collaborator

cyones commented Mar 30, 2022

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants