Dashboard - fails to load on multilple instances
- [x] I have read the contributing guide lines at https://github.com/opnsense/core/blob/master/CONTRIBUTING.md
- [x] I am convinced that my issue is new after having checked both open and closed issues.
Describe the bug
Most dashboard widgets revert to 'Failed to Load widget' in the event that multiple sessions to the dashboard are open.
To Reproduce
View the Dashboard in a browser. Simultaneously view the Dashboard in another browser or from another device / mobile device.
Expected behavior Dashboard would remain operational on both browser sessions.
Software version used and hardware type if relevant, e.g.:
OPNsense 24.7 (amd64). Intel® Xeon™ E3-1225V5 3.3Ghz Quad Core Network Intel® I210-AT
This https://github.com/opnsense/core/commit/724f8494d64074e0384b9f593e699daf2d84d604 should improve the situation, but is not the complete fix (it needs some safety fences as well).
You can apply the patch and restart the webserver using:
opnsense-patch 724f8494d
configctl webgui restart
Leaving the ticket open.
Nice work thank you!
This patch fixed it for me as well. Had no idea you could do patches like that in opnsense what an amazing project.
Unfortunately the patch only helps when initially restarting the web service, and only with a few widgets. Very soon after the service is restarted, widgets fail to load again. With a large number of widgets (13 in my case) many do not load even after restarting the web service. I've added a CPU but that doesn't appear to have helped. I can try adding memory but it's only using 969MB of 4GB.
Maybe this helps, but I don't know the implications:
https://forum.opnsense.org/index.php?topic=41729.msg205557#msg205557
That helped a lot. The value of 10000 (ms) in /usr/local/opnsense/www/js/widgets/BaseWidget.js might be a little high - mine are responding within about 1500ms so, for me, a good value is 2000.
As far as implications of a longer timeout, I could see, from an operational firewall perspective, if the UI makes multiple requests when there are outstanding requests that haven't timed out, it would result in resource starvation. Whether that would affect the operation of the firewall or just the webgui service, I do not know.
Perhaps making it configurable would be a good idea, I doubt we'd reach some consensus about which value is good considering all the factors involved., However, the currently hardcoded 1000ms clearly is not a good one.
I am still having issues with the services widget. It loads on refresh and dissapear with the errors after about 10 seconds
Maybe this helps, but I don't know the implications:
https://forum.opnsense.org/index.php?topic=41729.msg205557#msg205557
Setting the value mentioned in the link to 2000 fixed the issue for me as well. Probably because this is a slower system.
EDIT: the patch proposed by @AdSchellevis was not required.
@AdSchellevis's patch fixes the problem when too many requests are made in parallel, like when you have more than one dashboard open or or many widgets are active. The increased timeout helps with slow CPUs, so both changes are helpful.
For reference: https://github.com/opnsense/core/commit/973e744fb
Last Patch fixed it.
I don't know if its related but os-dmidecode doesn't show in the new dashboard widget selections.
no it doesn't os-dmidecode doesn't ship a new style widget, I don't think there is an active maintainer for the plugin.