HomeAssistant-Config
HomeAssistant-Config copied to clipboard
Update failed - Step "Wait for backup complete" failed - UndefinedError: 'pending_update_list' is undefined**
Hello, unfortunately I have had the problem for months that this blueprint does not work for me.
I have reimported the BluePrint and also changed the settings (created a new automation), but unfortunately this has not changed anything.
With one step I always get:
Error: In 'template' condition: UndefinedError: 'pending_update_list' is undefined
From Systemlog:
``Logger: homeassistant.components.automation.xsystem_automatisches_update_system Quelle: components/automation/init.py:776 Integration: Automatisierung (Dokumentation, Probleme) Erstmals aufgetreten: 05:00:51 (1 Vorkommnisse) Zuletzt protokolliert: 05:00:51
Error while executing automation automation.xsystem_automatisches_update_system: In 'template' condition: UndefinedError: 'pending_update_list' is undefined`
`Logger: homeassistant.components.automation.xsystem_automatisches_update_system Quelle: helpers/script.py:2026 Integration: Automatisierung (Dokumentation, Probleme) Erstmals aufgetreten: 05:00:51 (4 Vorkommnisse) Zuletzt protokolliert: 05:00:51
xSYSTEM - Automatisches Update System: Backup: If at step 3: If at step 3: Error executing script. Error for wait_template at pos 1: In 'template' condition: UndefinedError: 'pending_update_list' is undefined xSYSTEM - Automatisches Update System: Backup: If at step 3: Error executing script. Error for if at pos 3: In 'template' condition: UndefinedError: 'pending_update_list' is undefined xSYSTEM - Automatisches Update System: Backup: Error executing script. Error for if at pos 3: In 'template' condition: UndefinedError: 'pending_update_list' is undefined xSYSTEM - Automatisches Update System: Error executing script. Error for if at pos 8: In 'template' condition: UndefinedError: 'pending_update_list' is undefined`
And the entire script aborts. I have deliberately not installed the latest HA version as I still need something to test. I usually keep my versions up to date manually, but this time I didn't do it because I want to tackle the problem with the AutoUpdate.
Here is my current starting situation. If any information is missing, please let me know.
Here the code:
alias: xSYSTEM - Automatisches Update System description: "" use_blueprint: path: edwardtfn/auto_update_scheduled.yaml input: schedule_entity: schedule.automatisches_update_zeitfenster actions_pre_restart: - metadata: {} data: title: HA Reboot message: Das System wird aufgrund von Updates {{ updates_list }} rebootet action: notify.mail_chris actions_pos_update: - metadata: {} data: title: HA Update complete message: >- Der automatische Updateprozess ist durchgelalufen. Bitte prüfen ob alles läuft. Geupdated wurde: {{ updates_list }} action: notify.mail_chris restart_type: core verbose_logging_bool: true
Pending Updates:
I would be very happy if the problem can be solved. Since the error looks to me like it comes from the blueprint, I unfortunately need a little help here. Many thanks in advance!
I believe that is fixed now. Could you please reload the blueprint and try again?
I believe that is fixed now. Could you please reload the blueprint and try again?
Oh, that was fast. Sorry, I didn't expect you to fix the error so quickly. I did a re-import but currently have no more updates open as I installed them yesterday. But the next update should be released in the next few days. I'll test it then and get back to you, I promise.
Good morning,
So there was one today, for the ESP. Unfortunately, it didn't go through, even though the email notification suggested otherwise.:
Unfortunately, an update is still available:
But I could no longer find an error message in the system log.
However, I must mention that this morning, when the process would have run automatically, the ESP update was also not yet available. I started the automation manually.
Here the trace:
.....
What other data do you need from me? Or do you have all the information you need ?
Good Morning,
So this morning two update processes started automatically in the scheduled time window:
The first one updated ESPHome and Zigbee. This also worked technically, but unfortunately update_list does not seem to be output. Here are two screens, one shows the output and the other the config in the BP.
Then the update process started again, this time the mail output was correct, but it was not updated:
What data / traces do you still need for further analysis?
But thank you very much for your work. If the notifications work properly now, I'll be happy. I already know that the ESP firmwares don't run through, or should that actually work too?
I will take a look... I've never used the post-update myself, so I will try that. Probably the variable is being update during the update, so it is complete on pre-update (where I'm using) but not at the post-update.
I believe that is fixed now and updates_list should be working fine at any point.
I've also created a new var pending_updates_list which will contain at any point the items pending updates (due to a failure?).
Thank you very much, I have done a re-import and am waiting for the next run. Currently only the ESP firmware is still open but I think there will be an HA update in the next few days. I'll get back to you and report back.
HA v2024.10.0 will come later today. 😉
HA v2024.10.0 will come later today. 😉
Great, then we'll have the next real test tomorrow.
Good morning,
The current situation is as follows:
Yesterday (as you announced) the new core release was published.
The core update was also installed automatically this morning, but the output is incorrect:
I have not received a message about the core installation. Below you can see how I was shown that only the Alexa update was installed.
Which is unfortunately wrong. Yes, there is a new update, but it has not been installed.
Systemlog ist clean.
do you need more information ?
unfortunately i don't know the best way to make the whole trace available to you. if that helps you, please tell me the best way to do it.
The challenge is about using the post-update message. It will work fine for updated that won't restart HA, but when an update restarts it automatically, the script is interrupted before the message is sent, then when it restarts that update is not in the list anymore.
Have you considered sending the message in the pre-update, then use the post-update only for the pending_updates_list to inform whatever failed?
OK, I'll try, but of course it won't be as “beautiful”. I'll report back tomorrow on how the Alexa update has performed.
But I still have two questions:
- why has the Alexa update not been installed? The time window was not exhausted.
- why am I not getting this message?
- why has the Alexa update not been installed?
Looks like something is broken with that integration: https://community.home-assistant.io/t/psa-alexa-media-player-v4-13-3-breaks-all-versions-of-home-assistant/778171 I would suggest you pausing its update until HA v2024.10.1 is out.
2. why am I not getting this message?
updates_list is a list, while that field expects a string.
Please try this:
message: 'Your custom message {{ updates_list | join(", ") }}'
- why has the Alexa update not been installed?
Looks like something is broken with that integration: https://community.home-assistant.io/t/psa-alexa-media-player-v4-13-3-breaks-all-versions-of-home-assistant/778171 I would suggest you pausing its update until HA v2024.10.1 is out.
Thanks for the info, I have clicked on skip update. It would be annoying if it didn't work again, I was disturbed long enough ;-)
- why am I not getting this message?
updates_listis a list, while that field expects a string.Please try this:
message: 'Your custom message {{ updates_list | join(", ") }}'
OK, I have made an adjustment. We'll see more next time. Thank you !
I'll get back to you when there's something new
There is a little news, today the update of Battery Notes has been executed. :-) :-)
I have followed your advice and will now be informed in advance:
But unfortunately I did not receive a reboot message again. Set up as follows:
The system log is clean and the traces show no errors. I'm just not quite sure which is the part for the reboot notification.
I'm just not quite sure which is the part for the reboot notification.
Home Assistant updated will behave in one of the 3 ways:
- Update with no need to reboot
- Update with "pending reboot" - The update will be completed during the next reboot
- Update with automatic reboot (most of the core updates, like HA core, supervisor, OS, etc.).
For 1, no "Pre-restart actions" will be executed, those will be executed only when an update of type 2 is pending restart and you select in your blueprint to force the restart.
However, the updates of type 3 will reboot automatically and we don't have control of that, so most likely that will stop the blueprint abruptly and no further (or pending) actions will be executed, bypassing the Pre-restart actions.
OK, thanks for the clarification. Then I would say the issue is closed. The main thing that works now is that the updates are carried out. And I can also live with the notification in advance.
So thank you very much for your time and your work. 👍
@edwardtfn -
Hello, unfortunately I have to get in touch again.
The update has not been working for days, but when I look at the trace I can't find any errors, the script runs without errors according to the trace. In the system logs no error is recognizable for me. What data can I provide or where can I look to find the error?
Here are two more of my mail notifications, where you can also see that the script ran, but did not install anything.
Here is the current status. Unfortunately unchanged.
I will now start the update process by hand, please let me know if you want me to pull a new version from git to test.
Unfortunately I haven't had a chance to look at this yet. It was a quite busy week, but I will try to find some time this weekend and come back to you.
Unfortunately I haven't had a chance to look at this yet. It was a quite busy week, but I will try to find some time this weekend and come back to you.
Thanks for the feedback, I'll update manually again until I hear something new from you. It's really strange that it's not working again.
Unfortunately I haven't had a chance to look at this yet. It was a quite busy week, but I will try to find some time this weekend and come back to you.
Hi @edwardtfn, have you the time to take a closer look? Do you need any more data from me ?
Today I'm quite happy that the automatic update didn't work ;-)
But do you have any idea when you have time for bugfixing ?
Any news ?
I'm quite advanced with testing a new version that will solve this. I still need to get s bit more confidence in the new code, but I believe I'm quite close to a release. I will keep you updated.
I'm quite advanced with testing a new version that will solve this. I still need to get s bit more confidence in the new code, but I believe I'm quite close to a release. I will keep you updated.
Is there anything new? Or should I just close the issue because no more changes are being made?