home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
73.56k stars 30.74k forks source link

Litter-Robot raises RuntimeError: Concurrent call to receive() is not allowed #84486

Closed allenporter closed 1 year ago

allenporter commented 1 year ago

The problem

The integration throws a runtime error in some circumstances:

Logger: homeassistant
Source: /usr/src/homeassistant/homeassistant/runner.py:97
First occurred: December 19, 2022 at 12:08:01 PM (1 occurrences)
Last logged: December 19, 2022 at 12:08:01 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pylitterbot/robot/litterrobot3.py", line 304, in _monitor
    msg = await websocket.receive(timeout=80)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_ws.py", line 217, in receive
    raise RuntimeError("Concurrent call to receive() is not allowed")
RuntimeError: Concurrent call to receive() is not allowed

What version of Home Assistant Core has the issue?

2022.12.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Litter-Robot

Link to integration documentation on our website

https://www.home-assistant.io/integrations/litterrobot/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 1 year ago

Hey there @natekspencer, @tkdrob, mind taking a look at this issue as it has been labeled with an integration (litterrobot) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `litterrobot` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Change the title of the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign litterrobot` Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


litterrobot documentation litterrobot source (message by IssueLinks)

natekspencer commented 1 year ago

Is this right after starting or while it's been running for a while?

tkdrob commented 1 year ago

Right after starting but I seem to only see this in the dev environment.

allenporter commented 1 year ago

Yeah, around startup.

FWIW I have two of these devices.

tkdrob commented 1 year ago

@allenporter same

natekspencer commented 1 year ago

Perhaps that's why I've never encountered it. I only have one of each robot. I'll have to try to think through it

ChrisBaker97 commented 1 year ago

I've got three, and I'm getting it too. Right on startup or any time I reload the Litter Robot integration. I see the message twice, though, so it seems like it's once for each extra device beyond the first.

2022-12-24 12:34:55.446 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pylitterbot/robot/litterrobot3.py", line 304, in _monitor
    msg = await websocket.receive(timeout=80)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_ws.py", line 217, in receive
    raise RuntimeError("Concurrent call to receive() is not allowed")
RuntimeError: Concurrent call to receive() is not allowed
2022-12-24 12:34:55.685 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/pylitterbot/robot/litterrobot3.py", line 304, in _monitor
    msg = await websocket.receive(timeout=80)
  File "/usr/local/lib/python3.10/site-packages/aiohttp/client_ws.py", line 217, in receive
    raise RuntimeError("Concurrent call to receive() is not allowed")
RuntimeError: Concurrent call to receive() is not allowed
thenoid commented 1 year ago

Just to pile on, 4 litter robots, 3 error messages


2023-01-04 17:56:02.734 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pylitterbot/robot/litterrobot3.py", line 304, in _monitor
msg = await websocket.receive(timeout=80)
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_ws.py", line 217, in receive
raise RuntimeError("Concurrent call to receive() is not allowed")
RuntimeError: Concurrent call to receive() is not allowed
2023-01-04 17:56:03.315 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pylitterbot/robot/litterrobot3.py", line 304, in _monitor
msg = await websocket.receive(timeout=80)
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_ws.py", line 217, in receive
raise RuntimeError("Concurrent call to receive() is not allowed")
RuntimeError: Concurrent call to receive() is not allowed
2023-01-04 17:56:03.705 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/pylitterbot/robot/litterrobot3.py", line 304, in _monitor
msg = await websocket.receive(timeout=80)
File "/usr/local/lib/python3.10/site-packages/aiohttp/client_ws.py", line 217, in receive
raise RuntimeError("Concurrent call to receive() is not allowed")
RuntimeError: Concurrent call to receive() is not allowed
natekspencer commented 1 year ago

Can you let me know if this issue is resolved with 2023.1.4?

allenporter commented 1 year ago

Looks good so far from my end, no errors in the log (though not sure how deterministic this was to begin with) Thanks!

tkdrob commented 1 year ago

Marking this completed. Tested this myself with making changes in the app. HA sees the change after like 5 seconds. Awesome.

tkdrob commented 1 year ago

@home-assistant close