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

"RuntimeError: Task does not support set_exception operation" #26

Open
MagnusVesper opened this issue Sep 21, 2022 · 4 comments
Open

"RuntimeError: Task does not support set_exception operation" #26

MagnusVesper opened this issue Sep 21, 2022 · 4 comments

Comments

@MagnusVesper
Copy link

The run_controller_cli.py script works perfectly for 1 input. But after sending it, the script throws a runtime error.
Here is an example after I connected to the switch and simulated a b button press (which registered on the switch)

cmd >> b
[21:38:24] joycontrol.protocol _write::120 INFO - left change Grip/Order menu
[21:38:24] joycontrol.protocol _writer::190 WARNING - Writer exited...
[21:38:24] joycontrol.transport pause_writing::198 INFO - pause transport write
[21:38:24] joycontrol.transport read::94 ERROR - No data received.
[21:38:24] joycontrol.protocol connection_lost::262 ERROR - Connection lost.
[21:38:24] joycontrol.transport pause_writing::198 INFO - pause transport write
[21:38:24] asyncio default_exception_handler::1744 ERROR - Task exception was never retrieved
future: <Task finished name='Task-170' coro=<L2CAP_Transport.close() done, defined at ~/joycontrol-amiibo_edits/joycontrol/transport.py:208> exception=RuntimeError('Task does not support set_exception operation')>
Traceback (most recent call last):
  File "~/joycontrol-amiibo_edits/joycontrol/transport.py", line 224, in close
    await self._read_thread
  File "~/joycontrol-amiibo_edits/joycontrol/transport.py", line 78, in _reader
    await self._protocol.report_received(await self.read(), self._itr_sock.getpeername())
  File "~/joycontrol-amiibo_edits/joycontrol/transport.py", line 95, in read
    self._protocol.connection_lost()
  File "~/joycontrol-amiibo_edits/joycontrol/protocol.py", line 267, in connection_lost
    self._controller_state_sender.set_exception(NotConnectedError)
RuntimeError: Task does not support set_exception operation
[21:38:24] asyncio default_exception_handler::1744 ERROR - Exception in callback create_error_check_callback.<locals>.callback(<Task finishe...n operation')>) at ~/joycontrol-amiibo_edits/joycontrol/utils.py:55
handle: <Handle create_error_check_callback.<locals>.callback(<Task finishe...n operation')>) at ~/joycontrol-amiibo_edits/joycontrol/utils.py:55>
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "~/joycontrol-amiibo_edits/joycontrol/utils.py", line 58, in callback
    future.result()
RuntimeError: Task does not support set_exception operation

I then have to kill the script to end it.
It doesn't seem to matter how long I wait between connecting and sending the first input. It always works for exactly 1 input then throws this error.

Here is the full output starting from when I called the script:
(Note: I replaced the location of the joycontrol folder with ~ above to look cleaner. The text file has the real path.)
out.txt

@MagnusVesper
Copy link
Author

Here are the steps I took to set up this project:
I'm running Arch, so I followed the first bit of the installation guide on the original project this is forked from. That's where the first 2 lines come from.

sudo pacman -S hidapi
yay -S bluez-utils-compat

sudo pip3 install aioconsole hid crc8
sudo nano /lib/systemd/system/bluetooth.service #changed ExecStart line
sudo systemctl daemon-reload
sudo systemctl restart bluetooth.service
#cd into folder I downloaded this to
sudo pip3 install .

@8ar10der
Copy link

Same problem with same operations

@zhkong
Copy link

zhkong commented May 7, 2023

I have same problem, do you fix it😂?

@bin16
Copy link

bin16 commented May 18, 2023

same problem


cmd >> a
[10:33:02] joycontrol.protocol _write::120 INFO - left change Grip/Order menu
[10:33:02] joycontrol.protocol _writer::190 WARNING - Writer exited...
[10:33:03] joycontrol.transport pause_writing::198 INFO - pause transport write
[10:33:03] joycontrol.transport read::94 ERROR - No data received.
[10:33:03] joycontrol.protocol connection_lost::262 ERROR - Connection lost.
[10:33:03] joycontrol.transport pause_writing::198 INFO - pause transport write
[10:33:03] asyncio default_exception_handler::1744 ERROR - Task exception was never retrieved
future: <Task finished name='Task-124' coro=<L2CAP_Transport.close() done, defined at /root/app/joycontrol/joycontrol/transport.py:208> exception=RuntimeError('Task does not support set_exception operation')>
Traceback (most recent call last):
  File "/root/app/joycontrol/joycontrol/transport.py", line 224, in close
    await self._read_thread
  File "/root/app/joycontrol/joycontrol/transport.py", line 78, in _reader
    await self._protocol.report_received(await self.read(), self._itr_sock.getpeername())
  File "/root/app/joycontrol/joycontrol/transport.py", line 95, in read
    self._protocol.connection_lost()
  File "/root/app/joycontrol/joycontrol/protocol.py", line 267, in connection_lost
    self._controller_state_sender.set_exception(NotConnectedError)
RuntimeError: Task does not support set_exception operation
[10:33:03] asyncio default_exception_handler::1744 ERROR - Exception in callback create_error_check_callback.<locals>.callback(<Task finishe...n operation')>) at /root/app/joycontrol/joycontrol/utils.py:55
handle: <Handle create_error_check_callback.<locals>.callback(<Task finishe...n operation')>) at /root/app/joycontrol/joycontrol/utils.py:55>
Traceback (most recent call last):
  File "/usr/lib/python3.10/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/root/app/joycontrol/joycontrol/utils.py", line 58, in callback
    future.result()
RuntimeError: Task does not support set_exception operation

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

4 participants