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

KeyError in _count_datapoints_in_message #66

Open
DriftingShadows opened this issue Jun 18, 2024 · 1 comment
Open

KeyError in _count_datapoints_in_message #66

DriftingShadows opened this issue Jun 18, 2024 · 1 comment

Comments

@DriftingShadows
Copy link

We're suddenly getting errors today causing gateway to look like fine (logs continue to show incoming messages) but message never seem to reach thingsboard.

""2024-06-18 04:37:41" - |ERROR| - [tb_gateway_service.py] - tb_gateway_service - __send_rpc_reply - 1142 - 'OGCPV01001'"
Traceback (most recent call last):
  File "/thingsboard_gateway/gateway/tb_gateway_service.py", line 1133, in __send_rpc_reply
    self.tb_client.client.gw_send_rpc_reply(device, req_id, content, quality_of_service=quality_of_service)
  File "/root/.local/lib/python3.10/site-packages/tb_gateway_mqtt.py", line 258, in gw_send_rpc_reply
    info = self._send_device_request(TBSendMethod.PUBLISH, device, topic=GATEWAY_RPC_TOPIC,
  File "/root/.local/lib/python3.10/site-packages/tb_gateway_mqtt.py", line 159, in _send_device_request
    info = self._publish_data(**kwargs, device=device_name,
  File "/root/.local/lib/python3.10/site-packages/tb_device_mqtt.py", line 777, in _publish_data
    return self._send_request(TBSendMethod.PUBLISH, {"topic": topic, "payload": data, "qos": qos}, timeout,
  File "/root/.local/lib/python3.10/site-packages/tb_device_mqtt.py", line 654, in _send_request
    datapoints = self._count_datapoints_in_message(data_for_analysis, device=device)
  File "/root/.local/lib/python3.10/site-packages/tb_device_mqtt.py", line 898, in _count_datapoints_in_message
    datapoints += TBDeviceMqttClient._count_datapoints_in_message(data[device])  # noqa
KeyError: 'XXXX12345'

Any idea what may be going on?

@samson0v
Copy link
Contributor

Hi @DriftingShadows, thanks for your interest in ThingsBoard Python Client SDK!
Try to use the latest release version (currently 1.10.8) and let us know about the result.

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