OPNsense Forum

Archive => 21.1 Legacy Series => Topic started by: gpb on June 26, 2021, 01:02:33 AM

Title: [SOLVED] Firewall Log Widget not working...bug? (21.1.7_1)
Post by: gpb on June 26, 2021, 01:02:33 AM
Is anyone having issues with the firewall log widget no longer populating?  Mine is blank, has been since upgrading.  Checked settings for it (i.e., interfaces, filters), changed themes, verified there are log records to display, ran health audit, but nothing.  In the webgui log I can see the data is being requested, "configd.py[57004]   [cbdb2625-352b-4fce-a587-1ed355d12979] request filter log output".

Anything else to check?  Thx!
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: Fright on June 26, 2021, 07:37:38 AM
Hi
is the data displayed in the Firewall: Log Files: Live View?
any errors in browser dev console?
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: gpb on June 26, 2021, 03:09:16 PM
Was just answering these questions, with screenshots and such.  Noticed that for some reason the interfaces selected was now limited to WAN only (yesterday I absolutely for sure selected all three of my interfaces (wan/lan/vlan10)).  Selecting the other interfaces now populates properly.  Honest...I was very careful to verify this wasn't a user error...but I guess until more evidence, it is.  :/

Thanks!
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1) (SOLVED)
Post by: IsaacFL on June 26, 2021, 03:36:13 PM
I had the same thing yesterday.  I was re-configuring one of the interfaces and the firewall widget had no entries.  The actual live log was updating. It had been working fine before.

I tried multiple things and it just seemed to start working (I restarted unbound last) and it is still ok today.

Title: Re: Firewall Log Widget not working...bug? (21.1.7_1) (SOLVED)
Post by: IsaacFL on June 26, 2021, 03:45:06 PM
I just rebooted my router and the Firewall Widget issue is back. 

So not sure what I did yesterday that fixed it.  Just restarting unbound did not fix it which I wasn't really expecting it to.
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: gpb on June 26, 2021, 03:51:20 PM
Is the widget losing the interface selection?  When was troubleshooting this yesterday, all interfaces were selected, in testing, I deselected all, unchecked/rechecked filters and saved, then un-did those changes so everything was again selected without success.  This morning only the WAN interface was selected (the logging records in my case are geoip related outbound from lan/vlan).

One change I did make was updated ntopNG...and I hadn't been running that until recently.  I don't know why that would be related (doubt it is), but aside from that and 21.1.7 update, I haven't changed anything. 

Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: IsaacFL on June 26, 2021, 03:58:32 PM
All of the widget options seem ok.

I can un-select an interface and re-select and still not working.  Tried changing random parameters such as number of lines, unchecking Pass, no difference.

What I was working on yesterday, was I have installed an external NAT64 server, so added a new gateway and route to it. Also enabled DNS64 on unbound.

Don't see how that would impact Firewall widget.
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: IsaacFL on June 26, 2021, 05:13:16 PM
I don't know how to read errors, but F12 in Edge Chrome shows:

(index):3005 Uncaught TypeError: Cannot read property 'length' of undefined
    at Object.<anonymous> ((index):3005)
    at Function.each (jquery-3.5.1.min.js:2)
    at (index):2995
    at Object.complete (opnsense.js?v=6743abf9e798d91f:242)
    at c (jquery-3.5.1.min.js:2)
    at Object.fireWith (jquery-3.5.1.min.js:2)
    at l (jquery-3.5.1.min.js:2)
    at XMLHttpRequest.<anonymous> (jquery-3.5.1.min.js:2)
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: IsaacFL on June 26, 2021, 05:22:23 PM
on Line 3005 in case 'icon' subject line is:
                                            popContent += record.label.length > 0 ? " Label: " + record.label : '';

Browser seems to have a problem with the record.label.length not being defined.
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: gpb on June 26, 2021, 05:43:56 PM
Looks like good info, I can't even find that code on my side.  Though I had a thought...since this now seems to be browser related (a guess), and others including me had problems with the upgrade process and needing to flush the cache...well...did you try that?  I did that a couple times yesterday but didn't seem to work...yet suddenly now it is. 

Maybe @Fright can provide some insight if he's involved on the coding side.
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: Fright on June 26, 2021, 06:58:12 PM
useful info, thanks!
can you confirm that this did not happen on 21.1.6?
if so, at first glance it looks like a small regression after https://github.com/opnsense/core/commit/01031b4e546300e09a26598fbb011da78f05ed5f .
I'll try to reproduce this and take a closer look
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: gpb on June 26, 2021, 09:20:56 PM
I can't confirm, I never saw it prior to 21.1.7, but it seems intermittent as it is now working fine for me.  Thx!
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: Fright on June 26, 2021, 10:16:33 PM
I think I found it.
I was able to reproduce the above error (after a while the widget starts displaying records again) if the widget displays a large number of rows (i set it to 20), change the fw-rule parameters and return to the dashboard.
in this case, for the old records, the line in the filter.log file contains the "old" hash, and the "md5-to-descripton" array in running_conf_descr in read_log.py contains the "new" hash. As a result, api returns a record without a 'label' at all.
I will try to suggest a fix tomorrow
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: gpb on June 26, 2021, 10:57:38 PM
That's great, thanks for taking time to investigate.   :)
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: Fright on June 27, 2021, 03:55:50 PM
@AdSchellevis has already merged the commit
opnsense-patch 97643a3
should fix the 'undefined label' issue
hope this is the only reason for the empty widget
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1)
Post by: gpb on June 28, 2021, 03:13:06 PM
@Fright, again thanks for taking care of this so quickly.  I applied the patch but my system had started behaving properly so can't confirm the patch worked (I assume you did since you were able to reproduce it).  I was waiting for @IsaacFL to report back, but I'll mark this as solved.

:)
Title: Re: Firewall Log Widget not working...bug? (21.1.7_1) (SOLVED)
Post by: IsaacFL on June 28, 2021, 03:32:15 PM
Mine has started working on its own also, so haven't applied the patch.
Title: Re: [SOLVED] Firewall Log Widget not working...bug? (21.1.7_1)
Post by: IsaacFL on July 05, 2021, 03:56:39 AM
I was doing some firewall changes today and the widget acted up again.  I applied the patch and it seems to have fixed it.