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

Raspberry Pi Zero - Task exception was never retrieved error #28

Closed
backslashV opened this issue Dec 10, 2021 · 5 comments
Closed

Raspberry Pi Zero - Task exception was never retrieved error #28

backslashV opened this issue Dec 10, 2021 · 5 comments

Comments

@backslashV
Copy link

backslashV commented Dec 10, 2021

Device: raspberry pi zero
bluetoothctl -v: 5.6.2

Error:

Unhandled Error
Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/txdbus/protocol.py", line 140, in dataReceived
    self.rawDBusMessageReceived(raw_msg)
  File "/home/pi/.local/lib/python3.7/site-packages/txdbus/protocol.py", line 266, in rawDBusMessageReceived
    self.signalReceived(m)
  File "/home/pi/.local/lib/python3.7/site-packages/txdbus/client.py", line 642, in signalReceived
    self.router.routeMessage(msig)
  File "/home/pi/.local/lib/python3.7/site-packages/txdbus/router.py", line 128, in routeMessage
    r.match(m)
--- <exception caught here> ---
  File "/home/pi/.local/lib/python3.7/site-packages/txdbus/router.py", line 67, in match
    self.callback(m)
  File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/client.py", line 867, in _properties_changed_callback
    message.path, message.body[1]
  File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/client.py", line 894, in args_parser
    return func(char_map.get(sender, sender), bytearray(data.get("Value")))
  File "/home/pi/Desktop/idasen-controller/idasen_controller/main.py", line 224, in _move_to
    except asyncio.exceptions.InvalidStateError:
builtins.AttributeError: module 'asyncio' has no attribute 'exceptions'

Task exception was never retrieved
future: <Task finished coro=<unsubscribe() done, defined at /home/pi/Desktop/idasen-controller/idasen_controller/main.py:187> exception=RemoteError('org.bluez.Error.Failed')>
Traceback (most recent call last):
  File "/home/pi/Desktop/idasen-controller/idasen_controller/main.py", line 189, in unsubscribe
    await client.stop_notify(uuid)
  File "/home/pi/.local/lib/python3.7/site-packages/bleak/backends/bluezdbus/client.py", line 776, in stop_notify
    ).asFuture(asyncio.get_event_loop())
txdbus.error.RemoteError: org.bluez.Error.Failed: No notify session started
ConnectingConnected F2:7D:17:78:73:80
Height:  675mm
Final height:  811mm (Target: 1050mm)
DisconnectingDisconnected

Any ideas? I was getting the same error before updating bluetoothctl when it was at v5.5.

@rhyst
Copy link
Owner

rhyst commented Dec 11, 2021

What version of Python are you using? It looks like maybe asyncio.exceptions.InvalidStateError only works in >3.8. I think I can change it to asyncio.InvalidStateError which should work down to 3.6.

I'm not sure if that's the actual error though or if its just erroring there as well.

@backslashV
Copy link
Author

I am running Python 3.7. I changed it to asyncio.InvalidStateError in my forked repo. Will report if I still see the issue.

@backslashV
Copy link
Author

So, I upgraded to Python 3.9. The unhandled error part went away, but I am still seeing the "Task exception was never retrieved error" from time to time:
image

@rhyst
Copy link
Owner

rhyst commented Jan 8, 2022

I don't have a RPi to test on unfortunately. Does it still move the desk correctly despite the errors, or does it stop? If you were willing to add some error handling in the right place I'd happily accept a PR.

@rhyst rhyst changed the title Unhandled error Raspberry Pi Zero - Task exception was never retrieved error Jan 17, 2022
@rhyst
Copy link
Owner

rhyst commented Jan 21, 2022

Closing as it seems like it works despite the error?

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