Unbound 100% CPU usage on one core after 23.1.3 update

Started by opnfwb, March 10, 2023, 10:24:14 PM

Previous topic - Next topic
I'm experiencing an odd issue where Unbound is showing 100% CPU use on one of the cores of my system. Top screenshot is attached as well. Unbound logging is also not functional at this time, the graph will display but it is not showing current results. No changes were made to Unbound config or the rest of the OPNsense install besides the upgrade.

Based on the screenshot it appears to be an issue with the Unbound logger?

Just to update on this:

I am not using DNSBL however, that appears to have been related to the issue in my case.

I had to go to DNSBL and select a Blocklist from the drop down, then hit apply. This seemed to trigger a download of the list and after that, Unbound CPU usage from the Unbound logger.py module dropped back to normal.

My unbound logs still show many attempts at downloading a dnsblmodule even though I have the service disabled. I tried to enable/disable the service just to see if this would resolve the issue but it does not. Unbound reporting is still not working even after the CPU usage dropped.

Quoteunbound logs still show many attempts at downloading a dnsblmodule even though I have the service disabled.
i dont see this in the provided log.
something happened with the logging backend so the dnsbl_module can not connect with the logger.
coud you try to hit Apply in Services: Unbound DNS: Advanced to reload Unbound?

I went to Services/Unbound/Advanced and hit apply. This unfortunately didn't resolve the issue and Unbound is back to using 100% of one CPU core.

You're right about the logs, I confused a message that I saw in the logs for downloading a blocklist when I enabled/disabled the block list with the remainder of the messages. I am seeing a lot of log spam for "no logging backend found" from the dnsbl module. This behaviour didn't start for me until after I rebooted with 23.1.3.

Screenshots attached of the current Unbound log after hitting the Apply button.

hm. Weird. but there is no open pipe error from logger also..logger db broken?
can you try to reset db in Reporting: Settings -> Reset DNS data please?

We must have the same thought. Before I saw your reply I just tried this and it worked!

I unchecked "enable local gathering of statistics" and clicked save. Then I clicked the button to reset DNS data. Then I re-checked the statistics and clicked save again.

Unbound logging is now working and there is no 100% cpu usage from the logger.py script.

I'm still not sure what caused the issue? I have an identical OPNsense machine configured with all of the same settings running as a VM in my LAB. It also updated to 23.1.3 at the same time and has been fine with no issues.

In any case, thank you for your time and help on this!

glad if fixed!
QuoteI'm still not sure what caused the issue?
all the errors in logs indicate that the problem was at the logger db preparation step. if the OPNSense was updated from version 23.1_6, i could assume that it was a long index drop (although it was too long, of course ..), otherwise I have no versions of what exactly could happen to the db. unfortunately, I don't have enough knowledge to make assumptions without stable reproducibility of the error, and I won't be able to create such conditions ..