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

Repeated warnings in the logs about AWS integration: "Detected blocking call to listdir" #124279

Closed
duemir opened this issue Aug 20, 2024 · 3 comments

Comments

@duemir
Copy link

duemir commented Aug 20, 2024

The problem

AWS integration keeps printing warnings about blocking calls.

What version of Home Assistant Core has the issue?

core-2024.8.2

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

aws

Link to integration documentation on our website

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

Diagnostics information

No response

Example YAML snippet

aws:
  credentials:
    - name: My AWS
      aws_access_key_id: ...
      aws_secret_access_key: ...
  notify:
    - service: lambda
      region_name: ap-southeast-2
      credential_name: "My AWS"
      name: my_aws_lambdas

Anything in the logs that might be useful for us?

2024-08-20 18:16:04.893 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to listdir with args ('/usr/local/lib/python3.12/site-packages/botocore/data',) inside the event loop by integration 'aws' at homeassistant/components/aws/__init__.py, line 177: async with session.create_client("iam", **aws_config) as client: (offender: /usr/local/lib/python3.12/site-packages/botocore/loaders.py, line 306: for d in os.listdir(possible_path)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+aws%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir
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 190, 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/src/homeassistant/homeassistant/components/aws/__init__.py", line 177, in _validate_aws_credentials
    async with session.create_client("iam", **aws_config) as client:

2024-08-20 18:16:04.987 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to listdir with args ('/usr/local/lib/python3.12/site-packages/botocore/data/marketplace-entitlement',) inside the event loop by integration 'aws' at homeassistant/components/aws/__init__.py, line 177: async with session.create_client("iam", **aws_config) as client: (offender: /usr/local/lib/python3.12/site-packages/botocore/loaders.py, line 311: api_versions = os.listdir(full_dirname)), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+aws%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir
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 190, 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/src/homeassistant/homeassistant/components/aws/__init__.py", line 177, in _validate_aws_credentials
    async with session.create_client("iam", **aws_config) as client:

2024-08-20 18:16:09.585 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to listdir with args ('/usr/local/lib/python3.12/site-packages/botocore/data/iam',) inside the event loop by integration 'aws' at homeassistant/components/aws/__init__.py, line 177: async with session.create_client("iam", **aws_config) as client: (offender: /usr/local/lib/python3.12/site-packages/botocore/loaders.py, line 363: for dirname in os.listdir(possible_path):), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+aws%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#listdir
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 190, 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/src/homeassistant/homeassistant/components/aws/__init__.py", line 177, in _validate_aws_credentials
    async with session.create_client("iam", **aws_config) as client:

2024-08-20 18:16:09.601 WARNING (MainThread) [homeassistant.util.loop] Detected blocking call to open with args ('/usr/local/lib/python3.12/site-packages/botocore/data/iam/2010-05-08/service-2.json.gz', 'rb') inside the event loop by integration 'aws' at homeassistant/components/aws/__init__.py, line 177: async with session.create_client("iam", **aws_config) as client: (offender: /usr/local/lib/python3.12/gzip.py, line 192: fileobj = self.myfileobj = builtins.open(filename, mode or 'rb')), please create a bug report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+aws%22
For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#open
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 190, 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/src/homeassistant/homeassistant/components/aws/__init__.py", line 177, in _validate_aws_credentials
    async with session.create_client("iam", **aws_config) as client:

Additional information

No response

@home-assistant
Copy link

@duemir
Copy link
Author

duemir commented Aug 20, 2024

It looks like #119295 was opened to address this.

@issue-triage-workflows
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@issue-triage-workflows issue-triage-workflows bot closed this as not planned Won't fix, can't repro, duplicate, stale Dec 1, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants