Skip to content

Conversation

agners
Copy link
Member

@agners agners commented Sep 2, 2025

Proposed change

Check the currently installed Core version relative to the last known Core version and if its older than 2 years, mark the system unsupported. Also add a Job condition to prevent automatic refreshing of the update information in this case. We use it to block fetching the version json as well as updating and adding add-on repositories.

Using current Core version as reference to mark the system unsupported is necessary so that an update of Core will mark the system as supported again, such that Supervisor will refresh the update information again. If we were to take the current date as a reference, then 2 years after a Core version of an installation gets declared unsupported, we'd only offer an update to the then newest known Core version, which would be 2 years old already and hence the system would remain unsupported.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (which adds functionality to the supervisor)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • The code has been formatted using Ruff (ruff format supervisor tests)
  • Tests have been added to verify that the new code works.

If API endpoints or add-on configuration are added/changed:

@agners agners added the new-feature A new feature label Sep 2, 2025
@agners agners marked this pull request as ready for review September 9, 2025 21:19
@agners agners requested a review from mdegat01 September 9, 2025 21:19
@agners agners added the needs-client-library Pull requests needs client library changes but none is linked label Sep 10, 2025
@agners agners force-pushed the mark-old-core-versions-unsupported branch from 4793119 to 71a4cfc Compare September 10, 2025 08:52
@agners
Copy link
Member Author

agners commented Sep 11, 2025

We have a generic fallback for unknown unsupported reasons. With that, Home Assistant Core versions newer than 2022.12.0 will display the following message:

image

The "More info" link points to https://www.home-assistant.io/more-info/unsupported/core_version.

Copy link
Contributor

@mdegat01 mdegat01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess the code suggestion for EvaluateCoreVersion is more of a nitpick but I do think the code is a bit unnecessarily complex, unless there's something I'm missing.

I do really think we should refer to what we call core as "Home Assistant" in any place that is user facing though.

@home-assistant home-assistant bot marked this pull request as draft September 15, 2025 17:04
@home-assistant
Copy link

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@agners agners force-pushed the mark-old-core-versions-unsupported branch from fb782fe to c4cedda Compare September 16, 2025 10:07
Check the currently installed Core version relative to the current
date, and if its older than 2 years, mark the system unsupported.
Also add a Job condition to prevent automatic refreshing of the update
information in this case.
Also align handling between OS and Core version evaluations.
Block execution of fetch_data and store reload jobs if the core version
is unsupported. This essentially freezes the installation until the
user takes action and updates the Core version to a supported one.
Instead of using current date to determine if Core version is more than
2 years old, use the latest known Core version as reference point and
check if current version is more than 24 releases behind.

This is crucial because when update information refresh is disabled due to
unsupported Core version, using date would create a permanent unsupported
state. Even if users update to the last known version in 4+ years, the
system would remain unsupported. By using latest known version as reference,
updating Core to the last known version makes the system supported again,
allowing update information refresh to resume.

This ensures users can always escape the unsupported state by updating
to the last known Core version, maintaining the update refresh cycle.
Avoid any ambiguity in what is exactly outdated/unsupported by using
Home Assistant Core instead of just Core.
@agners agners force-pushed the mark-old-core-versions-unsupported branch from c4cedda to 1286921 Compare September 16, 2025 10:19
@agners agners marked this pull request as ready for review September 16, 2025 10:19
@home-assistant home-assistant bot requested a review from mdegat01 September 16, 2025 10:19
@mdegat01 mdegat01 added missing-documentation Added to pull requests that needs a docs, but none is linked needs-core Pull request needs Home Assistant Core changes but none are linked labels Sep 16, 2025
Copy link
Member

@sairon sairon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested on latest dev OS with Supervisor from this branch, with Core 2023.8.1:
image

After clicking the update, the notification is cleared:

2025-09-17 11:59:59.904 INFO (MainThread) [supervisor.docker.interface] Updating image ghcr.io/home-assistant/qemux86-64-homeassistant:2023.8.1 to ghcr.io/home-assistant/qemux86-64-homeassistant:2025.9.3
2025-09-17 11:59:59.904 INFO (MainThread) [supervisor.docker.interface] Downloading docker image ghcr.io/home-assistant/qemux86-64-homeassistant with tag 2025.9.3.
2025-09-17 12:00:43.629 INFO (SyncWorker_1) [supervisor.docker.manager] Stopping homeassistant application
2025-09-17 12:00:49.032 INFO (SyncWorker_1) [supervisor.docker.manager] Cleaning homeassistant application
2025-09-17 12:00:49.047 INFO (MainThread) [supervisor.homeassistant.module] Update pulse/client.config: /data/tmp/homeassistant_pulse
2025-09-17 12:00:49.107 INFO (MainThread) [supervisor.docker.homeassistant] Starting Home Assistant ghcr.io/home-assistant/qemux86-64-homeassistant with version 2025.9.3
2025-09-17 12:00:49.107 INFO (MainThread) [supervisor.homeassistant.core] Wait until Home Assistant is ready
2025-09-17 12:00:51.380 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2025-09-17 12:00:51.398 INFO (MainThread) [supervisor.resolution.evaluations.base] Clearing home_assistant_core_version as reason for unsupported

Add-on repos can't be indeed added:

image

Update data is still correctly fetched if missing or old on Supervisor restart, so nothing currently prevents from updating to the latest Core.

What's still missing is the docs - this link returns 404 and I don't see an open PR for it: https://www.home-assistant.io/more-info/unsupported/home_assistant_core_version

@agners agners requested a review from Copilot September 18, 2025 08:41
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a Home Assistant Core version check that marks the system as unsupported if the currently installed Core version is more than 2 years old compared to the latest known version. It also prevents automatic refreshing of update information when Core is unsupported.

Key changes:

  • Add Core version evaluation to mark systems with 2+ year old versions as unsupported
  • Block update fetching and store reloading when Core version is unsupported
  • Use latest known Core version as reference instead of current date to enable recovery after updates

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
supervisor/resolution/evaluations/home_assistant_core_version.py New evaluation class to check Core version age against 2-year threshold
supervisor/resolution/const.py Add HOME_ASSISTANT_CORE_VERSION unsupported reason enum
supervisor/jobs/const.py Add HOME_ASSISTANT_CORE_SUPPORTED job condition
supervisor/jobs/decorator.py Add condition check for Core version support in job execution
supervisor/updater.py Block updater data fetching when Core version is unsupported
supervisor/store/__init__.py Block store reloading and updating when Core version is unsupported
supervisor/misc/tasks.py Block store reload task when Core version is unsupported
tests/resolution/evaluation/test_evaluate_home_assistant_core_version.py Comprehensive test coverage for Core version evaluation logic
tests/jobs/test_job_decorator.py Test Core supported job condition functionality
supervisor/resolution/evaluations/os_version.py Add debug logging for version parsing errors to match Core version implementation

@sairon sairon removed the missing-documentation Added to pull requests that needs a docs, but none is linked label Sep 18, 2025
@agners agners marked this pull request as draft September 18, 2025 14:05
@agners
Copy link
Member Author

agners commented Sep 19, 2025

I've double checked the behavior on restart since comment at home-assistant/home-assistant.io#40914 (comment) got me worried: When the Supervisor fetches the update data Fetching update data {url} should be printed. On a Supervisor restart (with valid update information present) this does not happen on my system.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/udev.sh
[11:13:59] INFO: Using udev information from host
cont-init: info: /etc/cont-init.d/udev.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun supervisor (no readiness notification)
services-up: info: copying legacy longrun watchdog (no readiness notification)
[11:14:00] INFO: Starting local supervisor watchdog...
s6-rc: info: service legacy-services successfully started
2025-09-19 11:14:01.678 INFO (MainThread) [__main__] Initializing Supervisor setup
2025-09-19 11:14:01.788 INFO (MainThread) [supervisor.coresys] Setting up coresys for machine: odroid-n2
2025-09-19 13:14:01.797 INFO (MainThread) [supervisor.docker.supervisor] Attaching to Supervisor ghcr.io/home-assistant/aarch64-hassio-supervisor with version 9999.09.9.dev9999
2025-09-19 13:14:01.797 INFO (MainThread) [supervisor.docker.supervisor] Connecting Supervisor to hassio-network
2025-09-19 13:14:01.911 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state initialize
2025-09-19 13:14:01.915 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2025-09-19 13:14:01.916 INFO (MainThread) [__main__] Setting up Supervisor
2025-09-19 13:14:01.975 INFO (MainThread) [supervisor.api] Starting API on 172.30.32.2
2025-09-19 13:14:02.069 INFO (MainThread) [supervisor.hardware.monitor] Started Supervisor hardware monitor
2025-09-19 13:14:02.071 INFO (MainThread) [supervisor.dbus.manager] Connected to system D-Bus.
2025-09-19 13:14:02.071 INFO (MainThread) [supervisor.dbus.agent] Load dbus interface io.hass.os
2025-09-19 13:14:02.072 INFO (MainThread) [supervisor.dbus.hostname] Load dbus interface org.freedesktop.hostname1
2025-09-19 13:14:02.073 INFO (MainThread) [supervisor.dbus.logind] Load dbus interface org.freedesktop.login1
2025-09-19 13:14:02.074 INFO (MainThread) [supervisor.dbus.network] Load dbus interface org.freedesktop.NetworkManager
2025-09-19 13:14:02.075 INFO (MainThread) [supervisor.dbus.rauc] Load dbus interface de.pengutronix.rauc
2025-09-19 13:14:02.076 INFO (MainThread) [supervisor.dbus.resolved] Load dbus interface org.freedesktop.resolve1
2025-09-19 13:14:02.077 INFO (MainThread) [supervisor.dbus.systemd] Load dbus interface org.freedesktop.systemd1
2025-09-19 13:14:02.078 INFO (MainThread) [supervisor.dbus.timedate] Load dbus interface org.freedesktop.timedate1
2025-09-19 13:14:02.418 INFO (MainThread) [supervisor.host.services] Updating service information
2025-09-19 13:14:02.428 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information
2025-09-19 13:14:02.852 INFO (MainThread) [supervisor.host.network] Updating local network information
2025-09-19 13:14:02.968 INFO (MainThread) [supervisor.host.apparmor] Loading AppArmor Profiles: {'hassio-supervisor'}
2025-09-19 13:14:03.013 INFO (MainThread) [supervisor.os.manager] Detect Home Assistant Operating System 16.3.dev20250903 / BootSlot A
2025-09-19 13:14:03.013 INFO (MainThread) [supervisor.mounts.manager] Initializing all user-configured mounts
2025-09-19 13:14:05.430 INFO (MainThread) [supervisor.plugins.dns] Restarting CoreDNS plugin
2025-09-19 13:14:05.436 INFO (SyncWorker_2) [supervisor.docker.manager] Restarting hassio_dns
2025-09-19 13:14:06.408 INFO (MainThread) [supervisor.docker.monitor] Started docker events monitor
2025-09-19 13:14:06.412 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-cli with version 2025.09.0.dev0801
2025-09-19 13:14:09.089 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-dns with version 2025.02.0.dev2601
2025-09-19 13:14:09.117 INFO (MainThread) [supervisor.plugins.dns] Updated /etc/resolv.conf
2025-09-19 13:14:09.130 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-audio with version 2025.08.0.dev0502
2025-09-19 13:14:09.158 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-observer with version 2025.09.0.dev0401
2025-09-19 13:14:09.192 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/aarch64-hassio-multicast with version 2025.08.0.dev1101
2025-09-19 13:14:09.218 INFO (MainThread) [supervisor.homeassistant.secrets] Loaded 1 Home Assistant secrets
2025-09-19 13:14:09.222 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/home-assistant/odroid-n2-homeassistant with version 2023.8.4
2025-09-19 13:14:09.243 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/5c53de3b repository
2025-09-19 13:14:09.244 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/356e0765 repository
2025-09-19 13:14:09.246 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/15ef4d2f repository
2025-09-19 13:14:09.246 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/d5369777 repository
2025-09-19 13:14:09.249 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/f8bdff44 repository
2025-09-19 13:14:09.249 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/core repository
2025-09-19 13:14:09.250 INFO (MainThread) [supervisor.store.git] Loading add-on /data/addons/git/a0d7b954 repository
2025-09-19 13:14:11.298 INFO (MainThread) [supervisor.store] Loading add-ons from store: 87 all - 87 new - 0 remove
2025-09-19 13:14:11.362 INFO (MainThread) [supervisor.addons.manager] Found 10 installed add-ons
2025-09-19 13:14:11.405 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-ssh with version 9.20.0
2025-09-19 13:14:11.407 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/wireguard/aarch64 with version 0.12.0
2025-09-19 13:14:11.410 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/esphome/esphome-hassio with version 2025.8.2
2025-09-19 13:14:11.416 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-vlc with version 0.3.1
2025-09-19 13:14:11.417 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-matter-server with version 8.0.0
2025-09-19 13:14:11.427 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-mosquitto with version 6.5.2
2025-09-19 13:14:11.437 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/node-red/aarch64 with version 20.0.0
2025-09-19 13:14:11.445 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/hassio-addons/adguard/aarch64 with version 5.3.2
2025-09-19 13:14:11.446 INFO (MainThread) [supervisor.docker.interface] Attaching to ghcr.io/agners/ssh-rf-testing with version 11.3.0
2025-09-19 13:14:11.449 INFO (MainThread) [supervisor.docker.interface] Attaching to homeassistant/aarch64-addon-zwave_js with version 0.20.0
2025-09-19 13:14:12.229 INFO (MainThread) [supervisor.backups.manager] Found 259 backup files
2025-09-19 13:14:14.050 INFO (MainThread) [supervisor.discovery] Loaded 6 messages
2025-09-19 13:14:14.050 INFO (MainThread) [supervisor.ingress] Loaded 0 ingress sessions
2025-09-19 13:14:14.051 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state setup
2025-09-19 13:14:14.051 INFO (MainThread) [supervisor.resolution.checks.base] Run check for detached_addon_missing/addon
2025-09-19 13:14:14.051 INFO (MainThread) [supervisor.resolution.checks.base] Run check for multiple_data_disks/system
2025-09-19 13:14:14.052 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disabled_data_disk/system
2025-09-19 13:14:14.052 INFO (MainThread) [supervisor.resolution.checks.base] Run check for detached_addon_removed/addon
2025-09-19 13:14:14.052 INFO (MainThread) [supervisor.resolution.checks.base] Run check for deprecated_addon/addon
2025-09-19 13:14:14.053 INFO (MainThread) [supervisor.resolution.checks.base] Run check for duplicate_os_installation/system
2025-09-19 13:14:14.100 INFO (MainThread) [supervisor.resolution.check] System checks complete
2025-09-19 13:14:14.100 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state setup
2025-09-19 13:14:14.101 WARNING (MainThread) [supervisor.resolution.evaluations.base] Home Assistant Core version '2023.8.4' is more than 2 years old! (more-info: https://www.home-assistant.io/more-info/unsupported/home_assistant_core_version)
2025-09-19 13:14:14.102 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2025-09-19 13:14:14.102 INFO (MainThread) [supervisor.jobs] 'ResolutionFixup.run_autofix' blocked from execution, system is not running - setup
2025-09-19 13:14:14.105 WARNING (MainThread) [supervisor.core] System running in a unsupported environment!
2025-09-19 13:14:14.128 INFO (MainThread) [supervisor.os.manager] Rauc: slot A - activated slot kernel.0, marked slot kernel.0 as good
2025-09-19 13:14:14.146 WARNING (MainThread) [supervisor.jobs] 'Updater.fetch_data' blocked from execution, unsupported Home Assistant Core version
2025-09-19 13:14:14.147 INFO (MainThread) [supervisor.addons.manager] Phase 'initialize' starting 0 add-ons
2025-09-19 13:14:14.147 INFO (MainThread) [supervisor.core] Detected Supervisor restart
2025-09-19 13:14:14.147 INFO (MainThread) [supervisor.misc.tasks] All core tasks are scheduled
2025-09-19 13:14:14.148 INFO (MainThread) [supervisor.host.info] Updating local host information
2025-09-19 13:14:14.148 INFO (MainThread) [supervisor.resolution.check] Starting system checks with state running
2025-09-19 13:14:14.148 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_failed/dns_server
2025-09-19 13:14:14.154 INFO (MainThread) [supervisor.core] Supervisor is up and running
2025-09-19 13:14:14.161 INFO (MainThread) [__main__] Running Supervisor
2025-09-19 13:14:14.164 INFO (MainThread) [supervisor.resolution.checks.base] Run check for security/core
2025-09-19 13:14:14.164 INFO (MainThread) [supervisor.resolution.checks.base] Run check for multiple_data_disks/system
2025-09-19 13:14:14.164 INFO (MainThread) [supervisor.resolution.checks.base] Run check for ipv4_connection_problem/system
2025-09-19 13:14:14.164 INFO (MainThread) [supervisor.resolution.checks.base] Run check for dns_server_ipv6_error/dns_server
2025-09-19 13:14:14.172 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
2025-09-19 13:14:14.179 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disabled_data_disk/system
2025-09-19 13:14:14.179 INFO (MainThread) [supervisor.resolution.checks.base] Run check for docker_config/system
2025-09-19 13:14:14.180 INFO (MainThread) [supervisor.resolution.checks.base] Run check for no_current_backup/system
2025-09-19 13:14:14.180 INFO (MainThread) [supervisor.resolution.module] Create new suggestion create_full_backup - system / None
2025-09-19 13:14:14.181 INFO (MainThread) [supervisor.resolution.module] Create new issue no_current_backup - system / None
2025-09-19 13:14:14.181 INFO (MainThread) [supervisor.resolution.checks.base] Run check for pwned/addon
2025-09-19 13:14:14.202 INFO (MainThread) [supervisor.host.services] Updating service information
2025-09-19 13:14:14.211 INFO (MainThread) [supervisor.host.network] Updating local network information
2025-09-19 13:14:14.278 INFO (MainThread) [supervisor.resolution.checks.base] Run check for free_space/system
2025-09-19 13:14:14.282 INFO (MainThread) [supervisor.resolution.checks.base] Run check for disk_lifetime/system
2025-09-19 13:14:14.288 INFO (MainThread) [supervisor.resolution.checks.base] Run check for trust/supervisor
2025-09-19 13:14:14.300 INFO (MainThread) [supervisor.resolution.check] System checks complete
2025-09-19 13:14:14.300 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state running
2025-09-19 13:14:14.452 INFO (MainThread) [supervisor.host.sound] Updating PulseAudio information
2025-09-19 13:14:14.468 INFO (MainThread) [supervisor.host.manager] Host information reload completed
2025-09-19 13:14:14.565 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete
2025-09-19 13:14:14.566 INFO (MainThread) [supervisor.resolution.fixup] Starting system autofix at state running
2025-09-19 13:14:14.566 INFO (MainThread) [supervisor.resolution.fixup] System autofix complete

On Updater startup, we reload() only if no board information are available (see supervisor/updater.py). Then the first actual reload of updater data happens later on startup, see (supervisor/core.py). At this point the Setup evaluation already happened, and the fetch is successfully blocked.

Maybe your local updater information was missing the board information? This changed with #6152 shipped in Supervisor 2025.9.0 though which is on stable channel 🤔

@agners agners marked this pull request as ready for review September 19, 2025 11:37
@home-assistant home-assistant bot requested a review from mdegat01 September 19, 2025 11:37
@agners
Copy link
Member Author

agners commented Sep 19, 2025

From @sairon's run:

2025-09-17 12:29:13.343 INFO (MainThread) [supervisor.resolution.evaluate] Starting system evaluation with state setup
2025-09-17 12:29:13.343 INFO (MainThread) [supervisor.resolution.evaluate] System evaluation complete

It seems that the evaluation during setup did not consider the system as unsupported. The only reason I can think of is if the updater data still contained an old Core version at that point, so the Supervisor just learned after the fetch about a newer Core version and marked Core unsupported during the later reevaluation.

I've tested the current code on a second system, and for me the evaluation during setup worked fine. Let's merge this PR and do some more testing during dev/beta.

@agners agners merged commit c712d3c into main Sep 19, 2025
24 checks passed
@agners agners deleted the mark-old-core-versions-unsupported branch September 19, 2025 15:58
@github-actions github-actions bot locked and limited conversation to collaborators Sep 21, 2025
@agners agners removed needs-client-library Pull requests needs client library changes but none is linked needs-core Pull request needs Home Assistant Core changes but none are linked labels Sep 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants