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

error after update #84

Closed
nagyrobi opened this issue Jul 6, 2022 · 15 comments
Closed

error after update #84

nagyrobi opened this issue Jul 6, 2022 · 15 comments

Comments

@nagyrobi
Copy link

nagyrobi commented Jul 6, 2022

After today's update to 0.5.1 at HA restart:

2022-07-06 20:26:23 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.pfsense.update
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 618, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 635, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/pfsense/update.py", line 93, in <module>
    class PfSenseFirmwareUpdatesAvailableUpdate(PfSenseUpdate):
  File "/config/custom_components/pfsense/update.py", line 107, in PfSenseFirmwareUpdatesAvailableUpdate
    def installed_version(self) -> str | None:
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
2022-07-06 20:26:23 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform pfsense.update: Platform not found (Exception importing custom_components.pfsense.update).
2022-07-06
@Qpernicus
Copy link

Qpernicus commented Jul 6, 2022

I have the same error.

Combined with this:


 Logger: homeassistant.setup
Source: setup.py:298
First occurred: 21:37:57 (1 occurrences)
Last logged: 21:37:57
Unable to prepare setup for platform pfsense.update: Platform not found (Exception importing custom_components.pfsense.update).

@nagyrobi
Copy link
Author

nagyrobi commented Jul 6, 2022

Seems it's fixed by upgrading to HA 2022.7.0...?

@travisghansen
Copy link
Owner

I've been developing against 2022.07 atm, but nothing there should be new to that version that I'm aware of..

@travisghansen
Copy link
Owner

Working on things now and will have a new version in main for you to try momentarily if you could.

@travisghansen
Copy link
Owner

Actually any chance you can test next branch?

@travisghansen
Copy link
Owner

Also in main and v0.5.2 now..

@megapearl
Copy link

megapearl commented Jul 6, 2022

Same problem here (tested main, 0.5.0, 0.5.1, 0.5.2) but all below 0.5.0 are working fine for me.

I'm on:

Version core-2022.7.0
Installation Type Home Assistant Core
Development false
Supervisor false
Docker false
User homeassistant
Virtual Environment true
Python Version 3.9.3
Operating System Family Linux
Operating System Version 5.10.25-v8+
CPU Architecture aarch64
Timezone Europe/Amsterdam
Configuration Directory /home/homeassistant/.homeassistant


pfSense is on:

Version 2.6.0-RELEASE (amd64)built on Mon Jan 31 19:57:53 UTC 2022FreeBSD 12.3-STABLEThe system is on the latest version.Version information updated at Wed Jul 6 23:23:18 CEST 2022

This error originated from a custom integration.

Logger: homeassistant.loader
Source: custom_components/pfsense/update.py:149
Integration: pfSense (documentation, issues)
First occurred: 23:52:29 (1 occurrences)
Last logged: 23:52:29

Unexpected exception importing platform custom_components.pfsense.update
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 618, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 635, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/pfsense/update.py", line 92, in <module>
    class PfSenseFirmwareUpdatesAvailableUpdate(PfSenseUpdate):
  File "/home/homeassistant/.homeassistant/custom_components/pfsense/update.py", line 149, in PfSenseFirmwareUpdatesAvailableUpdate
    self, version: str | None, backup: bool, **kwargs: Any
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

and

Unable to prepare setup for platform pfsense.update: Platform not found (Exception importing custom_components.pfsense.update)

and

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 397, in async_add_entities
    await asyncio.gather(*tasks)
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity_platform.py", line 641, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/entity.py", line 775, in add_to_platform_finish
    await self.async_added_to_hass()
  File "/srv/homeassistant/lib/python3.9/site-packages/homeassistant/helpers/update_coordinator.py", line 332, in async_added_to_hass
    self._handle_coordinator_update, self.coordinator_context
AttributeError: 'PfSensePendingNoticesPresentBinarySensor' object has no attribute 'coordinator_context'

@travisghansen
Copy link
Owner

@megapearl have you updated to v0.5.2?

@megapearl
Copy link

Yes, as I mentioned above, I tried 0.5.2 too.

@GSzabados
Copy link

This is the error message in v0.5.2


Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 618, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 635, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/pfsense/update.py", line 92, in <module>
    class PfSenseFirmwareUpdatesAvailableUpdate(PfSenseUpdate):
  File "/config/custom_components/pfsense/update.py", line 149, in PfSenseFirmwareUpdatesAvailableUpdate
    self, version: str | None, backup: bool, **kwargs: Any
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

@megapearl
Copy link

Tried it on a different system too, same errors:

Version core-2022.6.7
Installation Type Home Assistant Core
Development false
Supervisor false
Docker false
User homeassistant
Virtual Environment true
Python Version 3.9.13
Operating System Family FreeBSD
Operating System Version 13.1-RELEASE
CPU Architecture amd64
Timezone Europe/Amsterdam

This error originated from a custom integration.

Logger: homeassistant.loader
Source: custom_components/pfsense/update.py:149
Integration: pfSense (documentation, issues)
First occurred: 12:33:49 AM (1 occurrences)
Last logged: 12:33:49 AM

Unexpected exception importing platform custom_components.pfsense.update
Traceback (most recent call last):
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 618, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/local/share/homeassistant/lib/python3.9/site-packages/homeassistant/loader.py", line 635, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/homeassistant/.homeassistant/custom_components/pfsense/update.py", line 92, in <module>
    class PfSenseFirmwareUpdatesAvailableUpdate(PfSenseUpdate):
  File "/home/homeassistant/.homeassistant/custom_components/pfsense/update.py", line 149, in PfSenseFirmwareUpdatesAvailableUpdate
    self, version: str | None, backup: bool, **kwargs: Any
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'

@travisghansen
Copy link
Owner

Ah, I see 1 more place I missed it. I think I'll have a fix shortly..

@travisghansen
Copy link
Owner

Can someone test v0.5.3?

@GSzabados
Copy link

GSzabados commented Jul 6, 2022

No error! And the notification for a firmware update shows up as expected! Thanks! All good now!

@megapearl
Copy link

Fixed for me too, updated to v0.5.3 on 2 different systems, no error's anymore.
Thanks for your time and work! :-)

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

No branches or pull requests

5 participants