[SOLVED] Firewall Log Widget not working...bug? (21.1.7_1)

Started by gpb, June 26, 2021, 01:02:33 AM

Previous topic - Next topic
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!
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

Hi
is the data displayed in the Firewall: Log Files: Live View?
any errors in browser dev console?

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!
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

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.


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.

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. 

HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

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.

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)

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.

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.
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

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

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!
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

June 26, 2021, 10:16:33 PM #12 Last Edit: June 26, 2021, 10:39:39 PM by Fright
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

That's great, thanks for taking time to investigate.   :)
HP T730/AMD  RX-427BB/8GB/500GB SSD
HP NC365T 4-PORT

@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