Unknown error while checking for update. Broken auto update for plugin

Looking for support in the plugin implementation for an ongoing issue.

After initial release mid-2023, my plugin (Octolight Home-Assistant) had an issue raised earlier this year where the OctoPrint Software Update was showing that it could not search for new versions.

No updates had been made to the plugin in 18 months, so I took the opportunity to update the code, and eventually after changing some details in setup.py, it started working again and displaying the installed and available versions. But 'Unknown error" has reappeared after a few months of that version (0.2.1 at the time).

image

Does anyone have any advice on what could have changed on the code or OctoPrint side to raise this error?

It says "please check the logs" and the closest I can find is as below, which I have not been able to use to use to diagnose the underlying problem. The Plugin Manager installs the latest plugin without issue if you manually uninstall then look to reinstall and the plugin homepage show the correct details at every update.

2025-05-30 20:44:38,820 - octoprint.plugins.softwareupdate - ERROR - Could not check octolightHA for updates
Traceback (most recent call last):
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/plugins/softwareupdate/__init__.py", line 1856, in _get_current_version
    information, is_current = version_checker.get_latest(
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/plugins/softwareupdate/version_checks/github_release.py", line 312, in get_latest
    remote_name, remote_tag, release_notes = _get_latest_release(
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/plugins/softwareupdate/version_checks/github_release.py", line 146, in _get_latest_release
    return _filter_out_latest(
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/plugins/softwareupdate/version_checks/github_release.py", line 89, in _filter_out_latest
    releases = sorted(releases, key=sort_key)
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/plugins/softwareupdate/version_checks/github_release.py", line 142, in <lambda>
    sort_key = lambda release: comparable_factory(
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/plugins/softwareupdate/version_checks/github_release.py", line 203, in <lambda>
    return lambda version: get_comparable_version(version, base=force_base)
  File "/data/python/octoprint/lib/python3.9/site-packages/octoprint/util/version.py", line 150, in get_comparable_version
    version = parse_version(version_string)
  File "/data/python/octoprint/lib/python3.9/site-packages/packaging/version.py", line 52, in parse
    return Version(version)
  File "/data/python/octoprint/lib/python3.9/site-packages/packaging/version.py", line 198, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: 'initial'

I wouldn't think it's related, but looking at your tagging for releases I notice that you have mixed v#.#.# with #.#.# over the life of the plugin. I did a quick test and installed the v0.2.1 release and saw the same error in logs.

2025-05-30 11:46:16,587 - octoprint.plugins.softwareupdate - ERROR - Could not check octolightHA for updates
Traceback (most recent call last):
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\Lib\site-packages\octoprint\plugins\softwareupdate\__init__.py", line 1856, in _get_current_version
    information, is_current = version_checker.get_latest(
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\Lib\site-packages\octoprint\plugins\softwareupdate\version_checks\github_release.py", line 312, in get_latest
    remote_name, remote_tag, release_notes = _get_latest_release(
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\Lib\site-packages\octoprint\plugins\softwareupdate\version_checks\github_release.py", line 146, in _get_latest_release
    return _filter_out_latest(
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\Lib\site-packages\octoprint\plugins\softwareupdate\version_checks\github_release.py", line 89, in _filter_out_latest
    releases = sorted(releases, key=sort_key)
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\Lib\site-packages\octoprint\plugins\softwareupdate\version_checks\github_release.py", line 142, in <lambda>
    sort_key = lambda release: comparable_factory(
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\Lib\site-packages\octoprint\plugins\softwareupdate\version_checks\github_release.py", line 203, in <lambda>
    return lambda version: get_comparable_version(version, base=force_base)
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\lib\site-packages\octoprint\util\version.py", line 150, in get_comparable_version
    version = parse_version(version_string)
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\lib\site-packages\packaging\version.py", line 54, in parse
    return Version(version)
  File "C:\OctoPrint\WPy64-31050\python-3.10.5.amd64\lib\site-packages\packaging\version.py", line 200, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: 'initial'

installed 0.2.2 and same issue.

looking at your software update hook everything looks right to me, your are returning a dictionary named the same as your plugin_identifier, with proper capitalization and everything.

The only way I can think of debugging this would be to step through the software update process in a local dev environment.

I may go through past releases and update the tags for consistency (to x.x.x). Perhaps if it's an issue with some update scanner, that might resolve it.

I'm hesitant to delete all previous releases and just leave the latest, but that might be a last resort in future. Thanks for the code review.

I don't think that is the issue though because the v does follow semantic versioning, there's something really strange going on with this one but can't pinpoint it exactly. The way software update checks is using the Google API and fills in your github username and repo name from the hook here. @foosel has a keen eye for weird things like this, maybe, she can spot the culprit.

I went through, renamed all the releases to align to x.x.x, and, whilst not immediate, the auto update appears to have resolved.

I'm going to assume that whatever the crawler was up to was struggling to parse the versions

In case someone does come across this, steps taken:

  1. Retag all releases to follow a standard scheme
  2. Manually set "prior version" for each release in GitHub.

Because the resolution in OctoPrint was not immediate, I can't say whether either (or neither) of these steps was important.

Thanks @jneilliii for looking over the codebase.