When the upgrade fails, inform the user

it would be nice if there is a big fat warning after logging in like "Unable to upgrade. Error xyz".

echo "BIG RED WARNING" > /etc/banner
auc -n -y

i assume you missed the title.
It would be nice if there is a big fat warning when the upgrade failed and the system rebooted without upgrading so the user knows that there was no successful upgrade.

also, "auc" is not a command my openwrt installation knows.

auc command is sysupgrade on steroids.
i just set a BIG RED WARNING into default login banner, if upgrade succeeds it puts new default banner in place, if it fails the BIG RED WARNING remains there.
I am no expert in terminal artworks.

ah ok, but when i use the web ui (luci) i have no such option. i dont use command line to perform the upgrade, i use luci.
when it succeeds, are you absolutely sure the banner is overwritten? i would assume it keeps the configuration (including the banner).
also, the banner is not shown in luci, right? i mean login to luci, not login to ssh.

I dont insist you try to see.....
For luci you need to change javascripts to show some flag.

thats the logical consequence, yeah. maybe by creating a file in ~./upgrade_failed or so and show that in the frontend if it exists.

Upgrades are relatively infrequent, and performed by the user. With that in mind, is there any reason that simply looking at the version number is not sufficient? In the case of any stable release build, it's pretty easy... like 23.05.2 > 23.05.3, and you should know what you just downloaded for installation. Admittedly, if you're working with snapshots, it's less obvious, but just look at the last few digits before the upgrade and compare what you see after.

Yes, it's overwritten by default as the banner contains the current version. The exception is if you add the banner file to the /etc/sysupgrade.conf configuration to save it.

1 Like

if it fails, kill uhttpd ?

2 Likes

I bisected about 20 images and had the wierd problem that i was unable to re-produce an error. Then i remembered, that luci does not report any problems when upgrading failed and i have to check myself the version. I was afraid and checked the version and i am now at main without any problems, so its all good. But i dont know any software that does not report when an upgrade failed.
I often upgrade (about 2 times a week) and tbh i never checked the version string, except when i test and dont forget to check it.
imho: i dont know any software that does not report a failed upgrade. So at least for me, this would be a nice feature.

Not sure how this should help in my scenario. Can you explain this a bit more?

Why? There's 0 reason for such frequent 'upgrades'.

If something's off, in this case, the webui, you'll investigate?

1 Like

i upgrade when something is available for testing for the banana pi r4.

when i can, yes. at the moment i test a lot the banana pi r4 and try to figure out why something is broken. i never had to deal with investigating anything related to the webui. more like e.g. autonegotiation problems for the network adapters, wifi problems (compatibility) etc.
before that i investigated a lot in uboot for the clearfog and even created a PR (yay). but i replaced that with the r4.

That's a lot of images...

Doesn't seem unreasonable to me that you should check the version. Even if an "upgrade failed" warning did exist, you'd still be wise to verify the version number in case something went wrong with the notification.

You would be a significant edge case.... I'd guess that people upgrade when there is a new stable release -- so maybe a few times a year. Probably most are much less frequent than that, unless they are using snapshots and actually need to upgrade (such as to install new packages and the like).

That said, you can certainly code something up and setup a PR.

Maybe. But as mentioned, i dont know any software that does not report an error when the upgrade failed. And as i use the webui, i would expect the error message in the webui.

There is no stable release for the r4 yet :wink:

I will see what i can do, but i never had to do with the web ui.

yes, thats why i was afraid as sh... when i was unable to reproduce the error and remembered that i see no error in luci when an upgrade failed :wink:

And that's twice a week? Seems unlikely...

1 Like

In rare instances, I've had a failed upgrade. On most occasions, the devices reboot anyway. How would the web GUI "know" there was a failure and that it's NOT running the desired version? :thinking:

Client - side code (then how does the code know what version the image was - does that exist)?

Lastly, can't one simply login to the web GUI and verify the version (analogous to seeing the version banner when SSHing in)?