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
72.62k stars 30.38k forks source link

ZHA: Detected blocking call to glob with args #128615

Open ilemik opened 2 hours ago

ilemik commented 2 hours ago

The problem

I got the follwoing issue when I tried to add the recognized SONOFF Zigbee 3.0 USB Dongle Plus in my Homeassistant (version is latest): It suggests there is a problem with the integration, I have used the follwowing ssh command to create the docker:

docker run -d \
  --name homeassistant-dup2 \
  --restart unless-stopped \
  -v /share/Container/homeassistant:/config \
  --device=/dev/ttyUSB0 \
  --network=host \
  homeassistant/home-assistant:latest

Everything works fine until I'm adding the detected device, see log...

I have the follwoing information about the device from the ssh command line:

crw-rw-rw- 1 admin administrators 188, 0 2024-10-17 21:59 /dev/ttyUSB0
/dev/ttyUSB0
[~] # dmesg | grep -i usb
[    1.741153] vcc5v0_usb: supplied by dc_12v
[    1.746159] vcc5v0_host: supplied by vcc5v0_usb
[    1.751717] vcc5v0_otg: supplied by vcc5v0_usb
[    1.773902] usbcore: registered new interface driver usbfs
[    1.780011] usbcore: registered new interface driver hub
[    1.785876] usbcore: registered new device driver usb
[    4.050866] usbcore: registered new interface driver asix
[    4.057025] usbcore: registered new interface driver ax88179_178a
[    4.063914] usbcore: registered new interface driver dm9601
[    4.070207] usbcore: registered new interface driver CoreChips
[    4.076811] usbcore: registered new interface driver smsc75xx
[    4.083299] usbcore: registered new interface driver smsc95xx
[    4.089781] usbcore: registered new interface driver net1080
[    4.096164] usbcore: registered new interface driver plusb
[    4.102347] usbcore: registered new interface driver MOSCHIP usb-ethernet driver
[    4.136495] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    4.161986] phy phy-fe8b0000.usb2-phy.3: illegal mode
[    4.169895] ehci-platform fd800000.usb: EHCI Host Controller
[    4.176248] ehci-platform fd800000.usb: new USB bus registered, assigned bus number 1
[    4.185108] ehci-platform fd800000.usb: irq 18, io mem 0xfd800000
[    4.204790] ehci-platform fd800000.usb: USB 2.0 started, EHCI 1.00
[    4.212252] hub 1-0:1.0: USB hub found
[    4.238181] ehci-platform fd880000.usb: EHCI Host Controller
[    4.244562] ehci-platform fd880000.usb: new USB bus registered, assigned bus number 2
[    4.253437] ehci-platform fd880000.usb: irq 20, io mem 0xfd880000
[    4.280787] ehci-platform fd880000.usb: USB 2.0 started, EHCI 1.00
[    4.288225] hub 2-0:1.0: USB hub found
[    4.302174] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    4.320333] phy phy-fe8b0000.usb2-phy.3: illegal mode
[    4.326012] ohci-platform fd840000.usb: Generic Platform OHCI controller
[    4.333523] ohci-platform fd840000.usb: new USB bus registered, assigned bus number 3
[    4.342386] ohci-platform fd840000.usb: irq 19, io mem 0xfd840000
[    4.413285] hub 3-0:1.0: USB hub found
[    4.422545] ohci-platform fd8c0000.usb: Generic Platform OHCI controller
[    4.430083] ohci-platform fd8c0000.usb: new USB bus registered, assigned bus number 4
[    4.438963] ohci-platform fd8c0000.usb: irq 21, io mem 0xfd8c0000
[    4.509271] hub 4-0:1.0: USB hub found
[    4.519091] phy phy-fe8a0000.usb2-phy.1: illegal mode
[    4.530936] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 5
[    4.557386] hub 5-0:1.0: USB hub found
[    4.572464] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 6
[    4.581039] xhci-hcd xhci-hcd.0.auto: Host supports USB 3.0 SuperSpeed
[    4.595318] usb usb6: We don't know the algorithms for LPM for this host, disabling LPM.
[    4.604854] hub 6-0:1.0: USB hub found
[    4.624694] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 7
[    4.651183] hub 7-0:1.0: USB hub found
[    4.666230] xhci-hcd xhci-hcd.1.auto: new USB bus registered, assigned bus number 8
[    4.674810] xhci-hcd xhci-hcd.1.auto: Host supports USB 3.0 SuperSpeed
[    4.682160] usb usb8: We don't know the algorithms for LPM for this host, disabling LPM.
[    4.691671] hub 8-0:1.0: USB hub found
[    4.700800] usbcore: registered new interface driver usb-storage
[    5.011966] usbcore: registered new interface driver btusb
[    5.082351] usbcore: registered new interface driver usbhid
[    5.088608] usbhid: USB HID core driver
[   10.406449] usbcore: registered new interface driver usblp
[   10.549261] usbcore: registered new interface driver r8152
[   37.272470] ---- reset /sys/bus/usb/devices/usb6
[   38.327329] hub 6-0:1.0: USB hub found
[   38.336142] usb usb6: authorized to connect
[   38.378154] usbcore: registered new interface driver pl2303
[   38.384455] usbserial: USB Serial support registered for pl2303
[   38.394288] usbcore: registered new interface driver cdc_acm
[   38.400689] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
[  220.510805] usbcore: registered new interface driver snd-usb-audio
[  220.899859] usbcore: registered new interface driver uvcvideo
[  220.906338] USB Video Class driver (1.1.1)
[17214.608570] usb 4-1: new full-speed USB device number 2 using ohci-platform
[17215.322267] [usb.004.002] /sys/devices/platform/fd8c0000.usb/usb4/4-1 added.
[18697.807257] usb 4-1: USB disconnect, device number 2
[18697.938162] [usb.004.002] /sys/devices/platform/fd8c0000.usb/usb4/4-1 removed.
[18711.788569] usb 5-1: new full-speed USB device number 2 using xhci-hcd
[18712.011621] [usb.005.002] /sys/devices/platform/usbdrd/fcc00000.dwc3/xhci-hcd.0.auto/usb5/5-1 added.
[19725.291682] usbcore: registered new interface driver cp210x
[19725.298045] usbserial: USB Serial support registered for cp210x
[19725.313396] usb 5-1: cp210x converter now attached to ttyUSB0
Bus 005 Device 002: ID 10c4:ea60 Cygnal Integrated Products, Inc. CP210x Composite Device

What version of Home Assistant Core has the issue?

core-2024.10.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

Zigbee Home Automation

Link to integration documentation on our website

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

Diagnostics information

unfortunately I can't open the zigbee integration as it fails...

Example YAML snippet

No response

Anything in the logs that might be useful for us?

`2024-10-17 21:18:13.369 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to glob with args ('/dev/ttyS*',) inside the event loop by integration 'zha' at homeassistant/components/zha/radio_manager.py, line 221: probe_result = await radio.controller.probe(dev_config) (offender: /usr/local/lib/python3.12/site-packages/serial/tools/list_ports_linux.py, line 92: devices = glob.glob('/dev/ttyS*')           # built-in serial ports), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+zha%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#glob
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 189, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once
    handle._run()
  File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 477, in _handle_request
    resp = await request_handler(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 559, in _handle
    return await handler(request)
  File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 83, in forwarded_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 85, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware
    response = await handler(request)
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle
    result = await handler(request, **request.match_info)
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin
    return await func(self, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 222, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 122, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 370, in async_configure
    result = await self._async_configure(flow_id, user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 417, in _async_configure
    result = await self._async_handle_step(
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 520, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
  File "/usr/src/homeassistant/homeassistant/components/zha/config_flow.py", line 553, in async_step_confirm
    probe_result = await self._radio_mgr.detect_radio_type()
  File "/usr/src/homeassistant/homeassistant/components/zha/radio_manager.py", line 221, in detect_radio_type
    probe_result = await radio.controller.probe(dev_config)`

Additional information

No response

home-assistant[bot] commented 2 hours ago

Hey there @dmulcahey, @adminiuga, @puddly, @thejulianjes, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `zha` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign zha` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)