Hi everyone,
I’m posting this here as I don’t know how to reach someone knowledgeable enough to get a solution.
I’ve found and reported on the supervisor github a bug : Bug : config.json ATTR_IMAGE not read by supervisor when switching addons from local to image builds · Issue #3414 · home-assistant/supervisor · GitHub
In a one-line summary : if a user installed an addon that the dev. had configured as locally build, but the dev. switches it to an image-based addon (by adding the “image” tag in config.json), the supervisor ignores the “image” tag and still locally builds it. However, when the user starts the addon, the supervisor will read the “image” tag and bug as it hadn’t downloaded the image but build it instead.
I’ve tried everything to read the devs, including : showing it is an actual bug, providing full logs, making a more explicit title, direct linking the most active devs, and couldn’t get an answer.
I spend tons of hours developing addons, and feel really let down that I must stick to locally build addons otherwise all users would need to uninstall, lose all their data stored in /data, then reinstall the addon.
Thanks anyone who can help solving this supervisor bug and providing some info on what I should do differently to get a response.
Anyone knows a way to contact the devs to get their help on the supervisor bug ?
It has been opened since 9 months here and not one response… And it has a high impact on people affected by this. By preventing from converting locally built addon to remote built on github, it induces increased wear on the sd card, longer installation time, larger backup images to store the container, takes a lot of free space due to intermediate images not properly cleaned, …
Thanks!
opened 07:37PM - 21 Jan 22 UTC
bug
### Describe the issue you are experiencing
If an addon is already installed … with a local-build strategy, it doesn't update correctly if the new version has an image-based strategy.
Example from the logs below : an addon named addon_updater is installed in v3.9, with a config.json that does not contain an image field. It is therefore locally built. When updating to the v5.0, with a config.json that contains an image field, it still builds locally the v5.0 and ignores the image tag. Starting the addon then fails, as the addon reads the image tag and does not find the downloaded image.
### What is the used version of the Supervisor?
supervisor-2021.12.2
### What type of installation are you running?
Home Assistant OS
### Which operating system are you running on?
Home Assistant Operating System
### What is the version of your installed operating system?
7.1
### What version of Home Assistant Core is installed?
core-2021.12.10
### Steps to reproduce the issue
1. Install an addon without an image field (local build)
2. Update the config.json in github to add the image field, and build images
3. Update repo, install the addon
4. Observe in the Supervisor log that the image is built and not downloaded
5. Start the addon and observe in supervisor log the absence of downloaded image
Positive control :
1. Uninstall the above installed app
2. Reinstall from fresh the v5.0 : it correctly downloads the image and starts normally
### Anything in the Supervisor logs that might be useful for us?
```txt
# Refresh repository
22-01-21 20:24:27 INFO (MainThread) [supervisor.store] Loading add-ons from store: 144 all - 0 new - 0 remove
# Start addon update
22-01-21 20:24:52 INFO (SyncWorker_7) [supervisor.docker.interface] Updating image db21ed7f/aarch64-addon-updater:3.9 to ghcr.io/alexbelgium/addons_updater-aarch64:5.0
22-01-21 20:24:52 INFO (SyncWorker_7) [supervisor.docker.addon] Starting build for db21ed7f/aarch64-addon-updater:5.0
22-01-21 20:27:02 INFO (SyncWorker_7) [supervisor.docker.interface] Cleaning addon_db21ed7f_updater application
22-01-21 20:27:02 INFO (MainThread) [supervisor.addons] Add-on 'db21ed7f_updater' successfully updated
22-01-21 20:27:02 WARNING (SyncWorker_5) [supervisor.docker.interface] Can't find ghcr.io/alexbelgium/addons_updater-aarch64 for cleanup
22-01-21 20:27:02 INFO (MainThread) [supervisor.host.apparmor] Adding/updating AppArmor profile: db21ed7f_updater
#Start of the addon
22-01-21 20:27:34 ERROR (SyncWorker_6) [supervisor.docker] Image ghcr.io/alexbelgium/addons_updater-aarch64:5.0 does not exist for addon_db21ed7f_updater
```
Edit 22-Feb: still the same on latest supervisor (I've added the "image" tag in the config.json of the addon before the repo refresh - which then shows the addon trying to local build instead of downloading the image, then trying to run out of the image it hasn't downloaded)
```
22-02-20 12:03:03 INFO (MainThread) [supervisor.host.apparmor] Adding/updating AppArmor profile: db21ed7f_webtop-kde
22-02-20 12:03:03 INFO (SyncWorker_4) [supervisor.docker.addon] Starting build for db21ed7f/aarch64-addon-webtop-kde:4.16-r0-ls43
22-02-20 12:08:49 INFO (SyncWorker_0) [supervisor.docker.addon] Build db21ed7f/aarch64-addon-webtop-kde:4.16-r0-ls43 done
22-02-20 12:08:49 INFO (MainThread) [supervisor.addons] Add-on 'db21ed7f_webtop-kde' successfully installed
22-02-20 12:08:49 INFO (SyncWorker_4) [supervisor.docker.addon] Build db21ed7f/aarch64-addon-webtop-kde:4.16-r0-ls43 done
22-02-20 12:08:49 INFO (MainThread) [supervisor.addons] Add-on 'db21ed7f_webtop-kde' successfully installed
22-02-20 12:14:06 INFO (MainThread) [supervisor.homeassistant.api] Updated Home Assistant API token
22-02-20 12:40:42 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/alexbelgium/hassio-addons repository
22-02-20 12:40:42 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/home-assistant/addons repository
22-02-20 12:40:43 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/hassio-addons/repository repository
22-02-20 12:40:43 INFO (MainThread) [supervisor.store.git] Update add-on https://github.com/sabeechen/hassio-google-drive-backup repository
22-02-20 12:40:46 INFO (MainThread) [supervisor.store] Loading add-ons from store: 142 all - 0 new - 0 remove
22-02-20 12:40:54 INFO (SyncWorker_2) [supervisor.docker.interface] Removing image db21ed7f/aarch64-addon-webtop-kde with latest and 4.16-r0-ls43
22-02-20 12:40:54 INFO (SyncWorker_5) [supervisor.docker.addon] Starting build for db21ed7f/aarch64-addon-webtop-kde:4.16-r0-ls43
22-02-20 12:40:56 INFO (SyncWorker_5) [supervisor.docker.addon] Build db21ed7f/aarch64-addon-webtop-kde:4.16-r0-ls43 done
22-02-20 12:40:56 INFO (MainThread) [supervisor.addons] Add-on 'db21ed7f_webtop-kde' successfully rebuilt
22-02-20 12:41:04 ERROR (SyncWorker_5) [supervisor.docker] Image ghcr.io/alexbelgium/webtop-kde-aarch64:4.16-r0-ls43 does not exist for addon_db21ed7f_webtop-kde
22-02-20 12:41:04 INFO (SyncWorker_5) [supervisor.resolution.module] Create new issue IssueType.MISSING_IMAGE - ContextType.ADDON / db21ed7f_webtop-kde
22-02-20 12:41:04 INFO (SyncWorker_5) [supervisor.resolution.module] Create new suggestion SuggestionType.EXECUTE_REPAIR - ContextType.ADDON / db21ed7f_webtop-kde
```
### Additional information
_No response_
I’ve also posted on discord, no response… Discord Is there no possibility of user input on bugs ? It seems this bug is ignored regardless of where I post about it…
GSzabados
(Gábor Szabados)
October 25, 2022, 9:48am
4
You need @CentralCommand to look at this. He is one of the supervisor devs.
1 Like
Hey sorry about that. That one was added around when I joined Nabu Casa so I was a bit distracted with the queued up tasks. Then it kind of slipped my list. Anyway just put in a PR that should fix it:
home-assistant:main
← home-assistant:fix-addon-image-change-on-update
opened 04:42PM - 25 Oct 22 UTC
<!--
You are amazing! Thanks for contributing to our project!
Please, DO N… OT DELETE ANY TEXT from this template! (unless instructed).
-->
## Proposed change
When an addon is updated `need_build` is determined by looking at the current config of the addon. Which means if the `image` was added or removed as part of the update it doesn't work.
If the image was added in the update you get #3414 (we build an image and then fail on run). If the image was removed in the update then the image pull most likely fails since the author probably didn't publish it with the new version (no issue for this currently but it is a bug).
Fixes it by looking at the store config during update to determine if we need to build an image or not.
## Type of change
<!--
What type of change does your PR introduce to Home Assistant?
NOTE: Please, check only 1! box!
If your PR requires multiple boxes to be checked, you'll most likely need to
split it into multiple PRs. This makes things easier and faster to code review.
-->
- [ ] Dependency upgrade
- [x] 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
<!--
Details are important, and help maintainers processing your PR.
Please be sure to fill out additional details, if applicable.
-->
- This PR fixes or closes issue: fixes #3414
- This PR is related to issue:
- Link to documentation pull request:
- Link to cli pull request:
## Checklist
<!--
Put an `x` in the boxes that apply. You can also fill these out after
creating the PR. If you're unsure about any of them, don't hesitate to ask.
We're here to help! This is simply a reminder of what we are going to look
for before merging your code.
-->
- [x] The code change is tested and works locally.
- [x] Local tests pass. **Your PR cannot be merged unless tests pass**
- [x] There is no commented out code in this PR.
- [x] I have followed the [development checklist][dev-checklist]
- [x] The code has been formatted using Black (`black --fast supervisor tests`)
- [x] Tests have been added to verify that the new code works.
If API endpoints of add-on configuration are added/changed:
- [ ] Documentation added/updated for [developers.home-assistant.io][docs-repository]
<!--
Thank you for contributing <3
Below, some useful links you could explore:
-->
[dev-checklist]: https://developers.home-assistant.io/docs/en/development_checklist.html
[docs-repository]: https://github.com/home-assistant/developers.home-assistant
4 Likes
Thanks so much!! I’ve seen your comment on GitHub and hadn’t yet installed root ssh access on my HA os. I’ll look at it, or test the dev channel as you proposed.
Have a great day!
2 Likes
I’ve tested your procedure by manually updating the supervisor and it works great, thanks!
3 Likes