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

Uncaught thread exception #114

Closed
alex-rb338 opened this issue Nov 20, 2020 · 6 comments
Closed

Uncaught thread exception #114

alex-rb338 opened this issue Nov 20, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@alex-rb338
Copy link

alex-rb338 commented Nov 20, 2020

It firstly happens after update to Home Assistant 0.118.0 & HassOS 4.17. It was never happens before at ha 0.117.* and hassos 4.15
But now - it happens 1-2 times a day. All zigbee devices became uncontrollable.
Home Assistant restart fix that but only temporarly.

Logs attached:

Logger: root
Source: custom_components/xiaomi_gateway3/core/gateway3.py:555
First occurred: 12:45:10 PM (1 occurrences)
Last logged: 12:45:10 PM

Uncaught thread exception
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/threading.py", line 932, in _bootstrap_inner
    self.run()
  File "/config/custom_components/xiaomi_gateway3/core/gateway3.py", line 95, in run
    self.mqtt.loop_forever()
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1779, in loop_forever
    rc = self.loop(timeout, max_packets)
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1181, in loop
    rc = self.loop_read(max_packets)
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 1572, in loop_read
    rc = self._packet_read()
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 2310, in _packet_read
    rc = self._packet_handle()
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 2936, in _packet_handle
    return self._handle_publish()
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3216, in _handle_publish
    self._handle_on_message(message)
  File "/usr/local/lib/python3.8/site-packages/paho/mqtt/client.py", line 3444, in _handle_on_message
    self.on_message(self, self._userdata, message)
  File "/config/custom_components/xiaomi_gateway3/core/gateway3.py", line 354, in on_message
    self.process_ble_event(msg.payload)
  File "/config/custom_components/xiaomi_gateway3/core/gateway3.py", line 555, in process_ble_event
    pdid = data['dev'].get('pdid')
TypeError: list indices must be integers or slices, not str
@maybeloveu
Copy link

hass.io the same problerm.

@to4ko
Copy link

to4ko commented Nov 21, 2020

HA 118.2 one of my gateways got disconnected in 6.5h after HA start (Supervised install on Ubuntu 20.04). Other two gateways working just fine. GWs firmware 1.4.6_0012.

At the same moment, all 3 gateways working just fine on 117.6 HA instance.

Not sure if it's connected, but there is BLE device connected to gateway went offline.

image

AlexxIT added a commit that referenced this issue Nov 21, 2020
@AlexxIT AlexxIT changed the title Uncaught thread exception in v0.10.2 after update to Home Assistant 0.118.0 & HassOS 4.17 Uncaught thread exception Nov 21, 2020
@AlexxIT AlexxIT added the bug Something isn't working label Nov 21, 2020
@AlexxIT AlexxIT self-assigned this Nov 21, 2020
@charles0103
Copy link

hass.io the same problerm.

me too.

@alex-rb338
Copy link
Author

alex-rb338 commented Nov 23, 2020

Ive surrounded string with error in gateway3.py with try-catch:

try: pdid = data['dev'].get('pdid') except: return
And since that it works ok. I understand that this is a dirty fix.
AlexxIT commit some changes 35421e9
But i havent tried to use master version yet.

UPD: updated to master version. Will test it a couple of days.

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 23, 2020

Master version has fix. Will be in next release. Or you can update to master now.

@alex-rb338
Copy link
Author

Seems everything is ok now.
Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants