core icon indicating copy to clipboard operation
core copied to clipboard

regression upgrading to 2025.3.2 from 2025.3.1 - failed to import pyasn1

Open pleasantone opened this issue 9 months ago • 3 comments

The problem

Upon first startup after migrating to 2025.3.2 the brother integration craps out with a failure to import pyasn1. I seem to recall we revved that module in core recently?

What version of Home Assistant Core has the issue?

core-2025.3.2

What was the last working version of Home Assistant Core?

core-2025.3.1

What type of installation are you running?

Home Assistant OS

Integration causing the issue

brother

Link to integration documentation on our website

No response

Diagnostics information

No response

Example YAML snippet


Anything in the logs that might be useful for us?

Logger: homeassistant.setup
Source: setup.py:340
First occurred: 11:27:53 AM (1 occurrences)
Last logged: 11:27:53 AM

Setup failed for 'brother': Unable to import component: No module named 'pyasn1'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 340, in _async_setup_component
    component = await integration.async_get_component()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1034, in async_get_component
    self._component_future.result()
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1014, in async_get_component
    comp = await self.hass.async_add_import_executor_job(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        self._get_component, True
        ^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/local/lib/python3.13/concurrent/futures/thread.py", line 59, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 1074, in _get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/loop.py", line 201, in protected_loop_func
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.13/importlib/__init__.py", line 88, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 1026, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/usr/src/homeassistant/homeassistant/components/brother/__init__.py", line 5, in <module>
    from brother import Brother, SnmpError
  File "/usr/local/lib/python3.13/site-packages/brother/__init__.py", line 13, in <module>
    from pysnmp.hlapi.asyncio import (
    ...<6 lines>...
    )
  File "/usr/local/lib/python3.13/site-packages/pysnmp/hlapi/asyncio/__init__.py", line 8, in <module>
    from pysnmp.proto.rfc1902 import *
  File "/usr/local/lib/python3.13/site-packages/pysnmp/proto/rfc1902.py", line 7, in <module>
    from pyasn1.type import univ, tag, constraint, namedtype, namedval
ModuleNotFoundError: No module named 'pyasn1'

Additional information

No response

pleasantone avatar Mar 12 '25 19:03 pleasantone

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)

home-assistant[bot] avatar Mar 12 '25 19:03 home-assistant[bot]

I don't see any PR related to pyasn1 in 2025.3.2.

bieniu avatar Mar 13 '25 09:03 bieniu

Hey is there any update on this? I'm also running into this issue.

DavidSnider avatar May 11 '25 17:05 DavidSnider

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.