-
Notifications
You must be signed in to change notification settings - Fork 256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
webui: fix and improve update check #1809
webui: fix and improve update check #1809
Conversation
4786e0b
to
0f8cdcd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When download.bareos.com is not reachable to get the version info, the AuthController crashes and you only get a blank page.
Error log:
[Fri May 23 21:20:48 2024] PHP Warning: Trying to access array offset on value of type int in /build/bareos/review-pr-1809/bareos/webui/vendor/Bareos/library/Bareos/Util.php on line 38
[Fri May 23 21:20:48 2024] PHP Fatal error: Uncaught Error: Cannot use a scalar value as an array in /build/bareos/review-pr-1809/bareos/webui/vendor/Bareos/library/Bareos/Util.php:39
Stack trace:
#0 /build/bareos/review-pr-1809/bareos/webui/module/Auth/src/Auth/Controller/AuthController.php(307): Bareos\Util::getNearestVersionInfo()
In getVersionInfo() from Util.php the variable $bareos_supported_versions contains the following in the error case:
a:3:{s:10:"readyState";i:4;s:6:"status";i:404;s:10:"statusText";s:5:"error";}
(output from serialize())
It probably expects a linear array of version info dictionaries.
Not sure why the status code is 404, because for this test the IP address of downloads.bareos.com was set to an unreachable IP address, so no HTTP request could have happened.
I improved the handling of retrieving the updates. After that, the problem did no longer occur in my environment. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that fixed it in my tests.
ad5dc4d
to
7311ab2
Compare
Thank you for contributing to the Bareos Project!
Before, the Bareos WebUI only displayed the clients update status, while the Director update status still used old, outdated code.
These changes now uses the same code and data to display the update status of the clients and the Director.
Please check
If you have any questions or problems, please give a comment in the PR.
Helpful documentation and best practices
Checklist for the reviewer of the PR (will be processed by the Bareos team)
Make sure you check/merge the PR using
devtools/pr-tool
to have some simple automated checks run and a proper changelog record added.General
Source code quality