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

Detected blocking call to open inside the event loop by integration 'brother'/snmp #117601

Closed
cogneato opened this issue May 16, 2024 · 8 comments · Fixed by #118554
Closed

Detected blocking call to open inside the event loop by integration 'brother'/snmp #117601

cogneato opened this issue May 16, 2024 · 8 comments · Fixed by #118554

Comments

@cogneato
Copy link

The problem

Errors appearing in logs for Brother integration

Logger: homeassistant.util.loop
Source: util/loop.py:90
First occurred: 5:18:41 PM (19 occurrences)
Last logged: 5:18:53 PM

Detected blocking call to open inside the event loop by integration 'brother' at homeassistant/components/brother/utils.py, line 23: snmp_engine = hlapi.SnmpEngine() (offender: /usr/local/lib/python3.12/site-packages/pysnmp/smi/builder.py, line 256: fp = open(p, mode))

Detected blocking call to open inside the event loop by integration 'brother' at homeassistant/components/brother/init.py, line 28: brother = await Brother.create( (offender: /usr/local/lib/python3.12/site-packages/pysnmp/smi/builder.py, line 256: fp = open(p, mode))

What version of Home Assistant Core has the issue?

core-2024.6.0.dev202405160217

What was the last working version of Home Assistant Core?

core-2024.5.3

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Brother

Link to integration documentation on our website

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

Diagnostics information

config_entry-brother-637cdaeb8d12d276c566534e29537cd1.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No noticeable issues with device or sensors itself.

@home-assistant
Copy link

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

Code owner commands

Code owners of brother 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 brother 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)


brother documentation
brother source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented May 17, 2024

Looks like snmp has the same issue

@home-assistant
Copy link

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

Code owner commands

Code owners of snmp 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 snmp 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)


snmp documentation
snmp source
(message by IssueLinks)

@bdraco
Copy link
Member

bdraco commented May 17, 2024

Detected blocking call to open with args ('/usr/local/lib/python3.11/site-packages/pysnmp/smi/mibs/instances/__SNMPv2-MIB.py', 'r') in /usr/local/lib/python3.11/site-packages/pysnmp/smi/builder.py, line 256: fp = open(p, mode) inside the event loop

@bdraco bdraco changed the title Detected blocking call to open inside the event loop by integration 'brother' on dev Detected blocking call to open inside the event loop by integration 'brother'/snmp May 17, 2024
@bdraco
Copy link
Member

bdraco commented May 17, 2024

Issue is in pysnmp-lextudio. Likely been a problem for a while, but went undetected

@cogneato
Copy link
Author

cogneato commented May 17, 2024

I had downgraded to confirm this was not in 2024.5.x, and then updated again to 2024.6 dev nightly and see another error warning with snmp and cognito

Logger: homeassistant.util.loop
Source: util/loop.py:61
First occurred: 11:22:46 PM (3 occurrences)
Last logged: 11:22:58 PM

Detected blocking call to open with args ('/usr/local/lib/python3.12/site-packages/botocore/data/cognito-idp/2016-04-18/service-2.json.gz', 'rb') in /usr/local/lib/python3.12/gzip.py, line 192: fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') inside the event loop

Detected blocking call to open with args ('/usr/local/lib/python3.12/site-packages/botocore/data/cognito-idp/2016-04-18/endpoint-rule-set-1.json.gz', 'rb') in /usr/local/lib/python3.12/gzip.py, line 192: fileobj = self.myfileobj = builtins.open(filename, mode or 'rb') inside the event loop

Detected blocking call to open with args ('/usr/local/lib/python3.12/site-packages/pysnmp/smi/mibs/instances/__SNMPv2-MIB.py', 'r') in /usr/local/lib/python3.12/site-packages/pysnmp/smi/builder.py, line 256: fp = open(p, mode) inside the event loop

@bdraco
Copy link
Member

bdraco commented May 17, 2024

The library code hasn't changed, and the problem has existed for a long time with these libraries.

Home Assistant's ability to detect these type of problems is what is new in dev.

@pimw1
Copy link

pimw1 commented May 29, 2024

Looks like snmp has the same issue

Might be the same as this one? #118426

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