hass-aarlo icon indicating copy to clipboard operation
hass-aarlo copied to clipboard

Detected I/O inside the event loop

Open pinkfloydFR opened this issue 2 years ago • 12 comments

Seen in my log :

2021-07-26 22:00:00 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for aarlo doing I/O at custom_components/aarlo/pyaarlo/backend.py, line 137: r = self._session.get(

2021-07-26 22:00:00 WARNING (MainThread) [pyaarlo] request-error=RuntimeError

Rasberry 4 / HA OS / All updated

pinkfloydFR avatar Jul 26 '21 22:07 pinkfloydFR

Thanks. I'll take a look.

What version of Home Assistant are you on?

twrecked avatar Jul 27 '21 02:07 twrecked

Core Version : core-2021.7.4 on Home Assistant OS 6.1.

Thk !

pinkfloydFR avatar Jul 27 '21 07:07 pinkfloydFR

(Of course) I'm not seeing it here.

Had the system been up for a while or are there any other logs near that might help identify the issue.

If it's reproducible can you turn on debug for pyaarlo and we can see what is happening just before.

twrecked avatar Jul 27 '21 12:07 twrecked

no more warning for now, i will check it and inform you if it appear again.

pinkfloydFR avatar Jul 27 '21 14:07 pinkfloydFR

One again ! 2021-07-27 16:32:16 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for aarlo doing I/O at custom_components/aarlo/pyaarlo/backend.py, line 137: r = self._session.get( 2021-07-27 16:32:16 WARNING (MainThread) [pyaarlo] request-error=RuntimeError

and i remember ! yesterday i change my config from :

aarlo:
  username: !secret arlo_username
  password: !secret arlo_password

to

aarlo:
  username: !secret arlo_username
  password: !secret arlo_password
  user_agent: apple
  recent_time: 10
  stream_snapshot: True
  refresh_devices_every: 1
  stream_timeout: 120
  reconnect_every: 90
  stream_snapshot_stop: 3

( to try correct the snapshot problem )

I revert the change to see if warning appear again...

pinkfloydFR avatar Jul 27 '21 16:07 pinkfloydFR

Can you turn on debugging, I need to know what happened just before the warning log. Something like this should do it:

logger:
    default: info
    logs:
        pyaarlo: debug
        custom_components.aarlo: debug

twrecked avatar Jul 28 '21 12:07 twrecked

Seem like with my 'short' config, i didn't get the error.

Ok, reverted my config with all parameters and added the debug info. stay tunned.

pinkfloydFR avatar Jul 28 '21 12:07 pinkfloydFR

I bet it's the snapshot stop! Let me know what you find.

twrecked avatar Jul 28 '21 13:07 twrecked

log_snippet_with_aarlo_error.txt I have this error as well and can reproduce it every time I call the aarlo.set_mode service. The mode is correctly set by the way and so far I don't see any other negative effect on the HA system.

I turned on the debug logging as you suggested in an earlier comment. See attached snippet where the error occurs. If you have other suggestions to debug this issue, let me know and I'm happy to give it a try.

aarlo version: v0.7.2b7

My HA system: version: core-2021.12.9 installation_type: Home Assistant OS dev: false hassio: true docker: true user: root virtualenv: false python_version: 3.9.7 os_name: Linux os_version: 5.10.88 arch: x86_64 host_os: Home Assistant OS 7.1 update_channel: stable supervisor_version: supervisor-2021.12.2 docker_version: 20.10.9

dewittutonnie avatar Jan 15 '22 17:01 dewittutonnie

Thanks for this. You're getting an error which is causing an I/O request to happen. I should be able to reproduce and fix this one.

twrecked avatar Jan 21 '22 12:01 twrecked

A quick update: i checked all my Arlo related automations again and found out that I was still using the deprecated service alarm_control_panel.aarlo_set_mode… and with these calls the error occurred every time. I changed them all to aarlo.alarm_set_mode and now it all runs without any errors in the log. Hope this helps.

dewittutonnie avatar Jan 21 '22 14:01 dewittutonnie

That's a lot of help. Thanks.

twrecked avatar Jan 30 '22 02:01 twrecked