Skip to content

fix: wait for the update check to finish instead of a fixed delay - #85

Merged
beeyev merged 1 commit into
beeyev:masterfrom
produmatico:fix/await-update-check
Aug 27, 2026
Merged

fix: wait for the update check to finish instead of a fixed delay#85
beeyev merged 1 commit into
beeyev:masterfrom
produmatico:fix/await-update-check

Conversation

@produmatico

Copy link
Copy Markdown
Contributor

/system package update check-for-updates runs asynchronously. The fixed
:delay 5s races it: on this fleet the check regularly needs longer, so
status is still finding out latest version... when it is read, and the run
aborts with Failed to check for new RouterOS version.

Poll for a terminal status instead, capped at 60 seconds. Keyed on the two END
states rather than the in-progress text, so an unknown status runs into the
timeout and is reported by the existing error branch instead of exiting early.

Verified on RouterOS 7.24 on CCR2004-16G-2S+, CRS328-24P-4S+, CRS312-4C+8XG and
a hAP ac, all in osupdate mode. scriptVersion deliberately left alone.

`check-for-updates` runs asynchronously. The fixed `:delay 5s` races it and
reports "Failed to check for new RouterOS version" whenever the check runs
long. Poll for a terminal status instead, capped at 60 seconds.
@beeyev

beeyev commented Aug 22, 2026

Copy link
Copy Markdown
Owner

Hey Markus!
thank you very much for a very nice improvement, may I ask you to also check if this works on the latest long term v6 fw version?

@produmatico

Copy link
Copy Markdown
Contributor Author

Hi Alexander, happy to check that - here are the results.

Tested on RouterOS 6 long-term, on CHR and on real hardware
(hAP ac, RB962UiGS-5HacT2HnT).

Update check, measured against the old code on the same device:

installed status returned :delay 5s this PR
6.49.13 New version is available 6.0s 3.0s
6.49.20 System is already up to date 6.0s 3.0s

The loop exited on its first read in both cases, so no extra wait
iterations. Both strings are the ones the script already compares against
further down, so this does not introduce a new assumption.

I also ran a full osupdate cycle on the hAP ac, channel long-term,
6.49.13 -> 6.49.20: step 1 backup + email + install, reboot, step 2
routerboard firmware 6.49.13 -> 6.49.20, reboot, step 3 final report.
It finished with script step: 3, RouterOS and firmware both on 6.49.20.

@beeyev
beeyev merged commit b7c8b91 into beeyev:master Aug 27, 2026
@beeyev

beeyev commented Aug 27, 2026

Copy link
Copy Markdown
Owner

Great!
thank you very much for your contribution, I appreciate it a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants