OPNsense Forum

English Forums => 24.7, 24.10 Production Series => Topic started by: +DS_DV+ on July 28, 2024, 12:40:09 PM

Title: Suggestion to add reastart ability for Failed to Load widget
Post by: +DS_DV+ on July 28, 2024, 12:40:09 PM
Hi OPNSense Devs,
first let me say i really like the new Dashboard <3

Sadly tho i fail to load every widget :/
Some of them always show the red exclamation mark and the message "Failed to load widget".
Since i run a pretty "low spec" Zotac ZBOX Ci323 and a few CI327 with intel n3000 series CPUS i suspect its due to them timing out while initialization?

The workaround is after the Dashboard is loaded to remove the failed widget and re-add it.

Therefor i would really love not only the "remove X" for each widget in the top right corner but also suggest a "reload arrow" in the top left corner of each widget so we can attempt to 'restart' single widgets which failed to load widgets (:

with kind regards
Title: Re: Suggestion to add reastart ability for Failed to Load widget
Post by: doktornotor on July 28, 2024, 01:12:44 PM
I don't think manually reloading randomly failing widgets is a solution for anything. This needs a serious rework to get back to previously working state, not claiming "oh your firewall box/client you are viewing from is too slow to handle dashboard widgets". Yeah, it can handle IPS and lots of other services at 250 Mbps - but all of a sudden cannot handle widgets with default install nothing added and running - just a box used for testing the dashboard. C'mon...  :-X
Title: Re: Suggestion to add reastart ability for Failed to Load widget
Post by: doktornotor on July 28, 2024, 06:13:10 PM
You can try this, definitely helped here (thanks to meyergru (https://forum.opnsense.org/index.php?topic=41729.msg205555#msg205555)).

--- /usr/local/opnsense/www/js/widgets/BaseWidget.js    2024-07-26 08:22:07.000000000 +0200
+++ /usr/local/opnsense/www/js/widgets/BaseWidget.js    2024-07-28 17:34:42.671882000 +0200
@@ -37,7 +37,7 @@
         this.cachedData = {};

         /* Connection timeout params */
-        this.timeoutPeriod = 1000;
+        this.timeoutPeriod = 10000;
         this.retryLimit = 3;
         this.eventSourceRetryCount = 0; // retrycount for $.ajax is managed in its own scope



BTW, some sort of retry seems to be already there (https://github.com/opnsense/core/blob/2e5b38603bcfbb528f633d6f2afaf4983e7a1676/src/opnsense/www/js/widgets/BaseWidget.js#L138-L171) - limited to 3 attempts and apparently doing nothing particularly useful for people who happen to hit this issue with widgets timeout.
Title: Re: Suggestion to add reastart ability for Failed to Load widget
Post by: Patrick M. Hausen on July 28, 2024, 08:14:26 PM
I wonder what unit this is. With milliseconds 1000 would still be a whole second. But microseconds? Hardly, that would result in a 1 ms timeout. So what is it?
Title: Re: Suggestion to add reastart ability for Failed to Load widget
Post by: doktornotor on July 28, 2024, 08:26:16 PM
It's multiplied by 1000 somewhere else... I frankly hate this whole JS thing with passion.

https://github.com/opnsense/core/blob/stable/24.7/src/opnsense/www/js/opnsense_widget_manager.js#L480
Title: Re: Suggestion to add reastart ability for Failed to Load widget
Post by: Patrick M. Hausen on July 28, 2024, 08:34:22 PM
One tick is 100 nanoseconds, a tenth of a microsecond. So 1.000.000 is 100 milliseconds - which is a value in the right order of magnitude and might still be too short for slower devices.

TIL. Things you never thought you might be asking.
Title: Re: Suggestion to add reastart ability for Failed to Load widget
Post by: doktornotor on July 28, 2024, 08:38:47 PM
Well, they apparently cannot decide neither on the desired timeout, nor on units. As it is nowthis.timeoutPeriod = 1000; in the discussed file is 1 second.

https://github.com/opnsense/core/commit/2296c2f5ea4358e3b93ef7c95e39861ae872df7b
Title: Re: Suggestion to add reastart ability for Failed to Load widget
Post by: Grossartig on August 02, 2024, 08:49:39 PM
For me, every single widget fails to load. If I'm lucky, one or two show up after several refreshes. Then it goes back to none at all.

Nevermind, I didn't realize a further update was available after upgrading. 24.7_9 seems to fix it (mostly, anyway). Apologies for bringing this back to the top.