simbaja / gehome

Python SDK for GE smart appliances
MIT License
42 stars 29 forks source link

Unhandled exception while running client: Passing coroutines is forbidden, use tasks explicitly., ignoring and restarting #51

Closed Lx closed 1 year ago

Lx commented 1 year ago
$ python3 -V
Python 3.11.2

Running the gehome-appliance-data tool with the correct username, password, and region, I end up with an endless loop of log messages:

``` 2023-04-06 00:28:02,016 DEBUG Getting OAuth2 token 2023-04-06 00:28:02,025 DEBUG Client changed state: GeClientState.INITIALIZING to GeClientState.AUTHORIZING_OAUTH 2023-04-06 00:28:05,694 DEBUG Getting WS credentials 2023-04-06 00:28:05,696 DEBUG Client changed state: GeClientState.AUTHORIZING_OAUTH to GeClientState.AUTHORIZING_CLIENT 2023-04-06 00:28:07,382 INFO Starting GE Appliances client 2023-04-06 00:28:07,758 DEBUG Client changed state: GeClientState.AUTHORIZING_CLIENT to GeClientState.CONNECTING 2023-04-06 00:28:09,031 DEBUG = connection is CONNECTING 2023-04-06 00:28:09,702 DEBUG > GET /?access_token=######## HTTP/1.1 2023-04-06 00:28:09,702 DEBUG > Host: ws-us-west-2.brillion.geappliances.com 2023-04-06 00:28:09,702 DEBUG > Upgrade: websocket 2023-04-06 00:28:09,702 DEBUG > Connection: Upgrade 2023-04-06 00:28:09,702 DEBUG > Sec-WebSocket-Key: ######## 2023-04-06 00:28:09,702 DEBUG > Sec-WebSocket-Version: 13 2023-04-06 00:28:09,702 DEBUG > User-Agent: Python/3.11 websockets/11.0 2023-04-06 00:28:10,261 DEBUG < HTTP/1.1 101 Switching Protocols 2023-04-06 00:28:10,262 DEBUG < Date: Wed, 05 Apr 2023 14:28:10 GMT 2023-04-06 00:28:10,262 DEBUG < Connection: upgrade 2023-04-06 00:28:10,262 DEBUG < upgrade: websocket 2023-04-06 00:28:10,262 DEBUG < sec-websocket-accept: ######## 2023-04-06 00:28:10,262 DEBUG = connection is OPEN 2023-04-06 00:28:10,263 DEBUG > TEXT '{"kind": "websocket#subscribe", "action": "subs...["/appliance/*/erd/*"]}' [91 bytes] 2023-04-06 00:28:10,264 DEBUG > TEXT '{"kind": "websocket#api", "action": "api", "hos...id": "List-appliances"}' [150 bytes] 2023-04-06 00:28:10,265 DEBUG Client changed state: GeClientState.CONNECTING to GeClientState.CONNECTED 2023-04-06 00:28:10,265 DEBUG = connection is CLOSING 2023-04-06 00:28:10,266 DEBUG > CLOSE 1000 (OK) [2 bytes] 2023-04-06 00:28:10,897 DEBUG < CLOSE 1000 (OK) [2 bytes] 2023-04-06 00:28:10,899 DEBUG = connection is CLOSED 2023-04-06 00:28:10,900 INFO Unhandled exception while running client: Passing coroutines is forbidden, use tasks explicitly., ignoring and restarting 2023-04-06 00:28:10,900 DEBUG Waiting before reconnecting 2023-04-06 00:28:10,900 DEBUG Client changed state: GeClientState.CONNECTED to GeClientState.DROPPED 2023-04-06 00:28:10,901 DEBUG Client changed state: GeClientState.DROPPED to GeClientState.WAITING 2023-04-06 00:28:12,902 DEBUG Refreshing authentication before reconnecting 2023-04-06 00:28:12,902 DEBUG Refreshing OAuth2 token 2023-04-06 00:28:12,907 DEBUG Client changed state: GeClientState.WAITING to GeClientState.AUTHORIZING_OAUTH ... ```

The bit I find most interesting is:

2023-04-06 00:28:10,265 DEBUG    Client changed state: GeClientState.CONNECTING to GeClientState.CONNECTED
2023-04-06 00:28:10,265 DEBUG    = connection is CLOSING
2023-04-06 00:28:10,266 DEBUG    > CLOSE 1000 (OK) [2 bytes]
2023-04-06 00:28:10,897 DEBUG    < CLOSE 1000 (OK) [2 bytes]
2023-04-06 00:28:10,899 DEBUG    = connection is CLOSED
2023-04-06 00:28:10,900 INFO     Unhandled exception while running client: Passing coroutines is forbidden, use tasks explicitly., ignoring and restarting

which to me suggests that something is trying to kick off a task in an erroneous way after the connection is established.

Lx commented 1 year ago

Tested OK on Python 3.10.10, so is isolated to 3.11.

simbaja commented 1 year ago

Yep, 3.11 related, should be fixed