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

ZHA: Detected blocking call to glob with args #128615

Open
ilemik opened this issue Oct 17, 2024 · 2 comments
Open

ZHA: Detected blocking call to glob with args #128615

ilemik opened this issue Oct 17, 2024 · 2 comments

Comments

@ilemik
Copy link

ilemik commented Oct 17, 2024

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
Copy link

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)

@puddly puddly changed the title Home assistant ZHA integration seems to have an issue (I'm using QNAP) ZHA: Detected blocking call to glob with args Oct 17, 2024
@herrxyz
Copy link

herrxyz commented Oct 28, 2024

same issue with new HA install using docker

added my local user with gid, uid 1000 to group dialout

docker compose

services:
  homeassistant:
    container_name: ha
    image: ghcr.io/home-assistant/home-assistant:stable
    volumes:
      - '/home/ju/docker/homeassistant:/config'
      - '/home/ju/docker/homeassistant/docker:/etc/services.d/home-assistant'
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0
    environment:
      - TZ=Europe/Berlin # get your Time Zone from - https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      - PUID=1000
      - PGID=1000
      - UMASK=007
      - PACKAGES=iputils
    network_mode: host
    ports:
      - '8123:8123'
      - '1400:1400' #for Sonos
    restart: always
    # you can comment all the rows below if you don't need health check
    healthcheck:
      test: 'curl -m 90 -sLf http://localhost:8123 || date >> /config/healthcheck' #| pkill -9 python3'
      interval: 90s
      timeout: 60s
      retries: 2

ls /dev/ttyUSB0
crw-rw---- 1 root dialout 188, 0 Oct 28 21:14 ttyUSB0

dmesg | grep -i usb

[862466.915692] usb 1-8: new high-speed USB device number 70 using xhci_hcd
[862467.064021] usb 1-8: New USB device found, idVendor=0424, idProduct=2514, bcdDevice= b.b3
[862467.064043] usb 1-8: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[862467.065175] hub 1-8:1.0: USB hub found
[862467.351779] usb 1-8.2: new full-speed USB device number 71 using xhci_hcd
[862467.454762] usb 1-8.2: New USB device found, idVendor=10c4, idProduct=ea60, bcdDevice= 1.00
[862467.454785] usb 1-8.2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[862467.454793] usb 1-8.2: Product: Sonoff Zigbee 3.0 USB Dongle Plus
[862467.454799] usb 1-8.2: Manufacturer: ITead
[862467.454805] usb 1-8.2: SerialNumber: 708eaab40b2bec11b502ce6540c9ce8d
[862467.462772] usb 1-8.2: cp210x converter now attached to ttyUSB0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants