integration: HACS main page is not showing integrations: crashing on unknown version in AwesomeVersion code as version string contains the word 'core-'

System Health details

System Health

version core-2021.9.1
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.9.6
os_name Linux
os_version 5.11.0-27-generic
arch x86_64
timezone Australia/Melbourne
Home Assistant Community Store
GitHub API ok
Github API Calls Remaining 4485
Installed Version 1.15.1
Stage running
Available Repositories 882
Installed Repositories 22
Home Assistant Cloud
logged_in false
can_reach_cert_server ok
can_reach_cloud_auth ok
can_reach_cloud ok
Lovelace
dashboards 2
resources 8
views 7
mode storage

Checklist

  • I’m running the newest version of HACS https://github.com/hacs/integration/releases/latest
  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • I have read https://hacs.xyz/docs/issues
  • This issue is related to the backend (integration part) of HACS.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).

Describe the issue

HACS is failing on a version check. I ‘kludged’ the code to get by, but I believe it relates to AwesomeVersion not handling a version string starting with ‘core-’

I did this to get by for now: in misc.py

def version_left_higher_then_right(left: str, right: str) -> bool:
    """Return a bool if source is newer than target, will also be true if identical."""
    # KLUDGE-start
    if left.find('core-') >=0:
        left = left.replace('core-','')
    if right.find('core-') >=0:
        right = right.replace('core-','')
    # KLUDGE-end
    return version.version_left_higher_then_right(left, right)

Its a definite hack as I don’t know what the intent of the version checking is, so this might be totally the wrong thing to do logically 😃

Reproduction steps

  1. upgraded to core-2021.9.1
  2. click on HACS front page
  3. all integrations are missing. …

Debug logs

Example log:
2021-09-03 11:54:04 ERROR (MainThread) [homeassistant] Error doing job: Exception in callback HACSSensor._update_and_write_state(<Event hacs/status[L]>)
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/config/custom_components/hacs/sensor.py", line 55, in _update_and_write_state
    self._update()
  File "/config/custom_components/hacs/sensor.py", line 68, in _update
    repository.pending_upgrade
  File "/config/custom_components/hacs/helpers/properties/pending_update.py", line 23, in pending_upgrade
    return self.pending_update
  File "/config/custom_components/hacs/helpers/properties/pending_update.py", line 8, in pending_update
    if not self.can_install:
  File "/config/custom_components/hacs/helpers/properties/can_be_installed.py", line 21, in can_install
    return self.can_be_installed
  File "/config/custom_components/hacs/helpers/properties/can_be_installed.py", line 12, in can_be_installed
    if not version_left_higher_then_right(
  File "/config/custom_components/hacs/helpers/functions/misc.py", line 27, in version_left_higher_then_right
    return version.version_left_higher_then_right(left, right)
  File "/config/custom_components/hacs/utils/version.py", line 12, in version_left_higher_then_right
    return AwesomeVersion(left) >= AwesomeVersion(right)
  File "/usr/local/lib/python3.9/site-packages/awesomeversion/awesomeversion.py", line 129, in __ge__
    return self.__eq__(compareto) or self.__gt__(compareto)
  File "/usr/local/lib/python3.9/site-packages/awesomeversion/awesomeversion.py", line 117, in __gt__
    raise AwesomeVersionCompare(
awesomeversion.exceptions.AwesomeVersionCompare: Can't compare unknown

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Comments: 15 (4 by maintainers)

Most upvoted comments

Solved by reinstalling HACS according official guide.