Bug 12397 - Misconfigured entries in file /var/ipfire/main/hosts causes unbound to not restart (after updating IPFire)
Summary: Misconfigured entries in file /var/ipfire/main/hosts causes unbound to not re...
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: IPFire
Classification: Unclassified
Component: --- (show other bugs)
Version: 2
Hardware: all All
: - Unknown - Minor Usability
Assignee: Assigned to nobody - feel free to grab it and work on it
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-05-02 07:51 UTC by Michael
Modified: 2024-02-24 18:02 UTC (History)
4 users (show)

See Also:
adolf.belka: needinfo+


Attachments
unbound errors while restarting ipfire after update to core 141 from core 139 (8.49 KB, image/png)
2020-05-05 13:37 UTC, Michael
Details
unbound.conf (20.89 KB, image/jpeg)
2020-05-05 13:52 UTC, Michael
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michael 2020-05-02 07:51:40 UTC
Hi,

as already expressed in a community posting https://community.ipfire.org/t/issues-with-hosts-while-upgrading-from-139-to-144/2133
misconfigured entries in file /var/ipfire/main/hosts stopped unbound from restarting.

The cause for this issue was within the file /var/ipfire/main/hosts and precisely a missing value (on/off) at the end of each line.

Before and with core 139, entires like 
on,172.18.0.100,Dreckspatz,
on,172.18.0.103,HandySamsungS3Mini,
on,185.60.216.19,static,xx.fbcdn.net,

did not stop unbound from restarting. 

After upgrading to core 144 and rebooting IPFire, unbound failed to restart and DNS queries failed.

After changing the file /var/ipfire/main/hosts manually and adding the value ON to the end of each line, unbound successully restarted, e.g.
on,172.18.0.100,Dreckspatz,on
on,172.18.0.103,HandySamsungS3Mini,on
on,185.60.216.19,static,xx.fbcdn.net,on

Pls, see community posting for more details.

Michael
Comment 1 Michael Tremer 2020-05-04 14:49:05 UTC
What does unbound log why it does not want to start?

Do you see any error messages?
Comment 2 Michael 2020-05-05 13:37:27 UTC
Created attachment 752 [details]
unbound errors while restarting ipfire after update to core 141 from core 139
Comment 3 Michael 2020-05-05 13:43:53 UTC
I've just restarted a VM with core 139 and performed the following steps.

1) Copied those lines into /var/ipfire/main/hosts

on,172.18.0.100,Dreckspatz,
on,172.18.0.103,HandySamsungS3Mini,
on,185.60.216.19,static,xx.fbcdn.net,

2) run commands 
/usr/local/bin/rebuildhosts
/usr/local/bin/unboundctrl restart

3) Updated to core 141 and restarted as required

4) while restarting (during shutdown) I got errors as attached in image above

I've attached a second screenshot of the file /etc/unbound/hosts.conf which seems to be corrupt.

A ping or dig command fails now after those errors. dig tells me "no servers could be readched".

After wiping /var/ipfire/main/hosts and rebuilding the hosts file and restarting unbound, DNS works correctly.

Michael
Comment 4 Michael 2020-05-05 13:52:17 UTC
Created attachment 753 [details]
unbound.conf
Comment 5 Michael Tremer 2020-05-05 18:29:29 UTC
Is that file always corrupted in the same way?
Comment 6 Adolf Belka 2020-09-08 13:08:59 UTC
This information doesn't address the cause of the bug but it might be useful as information from a system not having any problems with DNS after any of the Core Updates.

Having seen this bug I checked my /var/ipfire/main/hosts file and found that some of my entries had "on" at the end of the line but some had nothing.
In the WebUI all the host entries have PTR marked as yes.
The entries that were missing "on" at the end were the ones that have been defined for a long time. The ones with "on" at the end are relatively more recent host entries.

Going into the WebUI, I clicked edit on all the entries without "on" and then pressed update without changing anything. This resulted in the entries in hosts now all having "on" at the end of them.
Comment 7 Michael Tremer 2020-10-05 15:34:58 UTC
I believe this depends on the browser. In the shell scripts we shouldn't normally check for "not off". This isn't pretty, but is basically the way this was designed - in the 90s.

I am not sure what I can do about this bug now. But I would like some stable DNS :)
Comment 8 Rob Hills 2022-01-08 15:58:50 UTC
I am new to ipFire, having installed it a couple of months ago.  I had configured host names for a number of computers on my green network in the ipFire Hosts file and this was working well prior to the most recent upgrade.

I can no longer access the web interface via my ipFire computer name, I have to resort to its ip address.

However, unlike the OP, my unbound seems to start up and restart without any errors.

also, my /var/ipfire/main/hosts seems to contain valid data, specifically each line has "on" at the start and the end.

So, it appears that I have the same symptoms as the OP, but not necessarily the same cause.

Is there more information I can provide to help get to the bottom of this problem?
Comment 9 Adolf Belka 2024-01-09 22:01:41 UTC
(In reply to Rob Hills from comment #8)
> I am new to ipFire, having installed it a couple of months ago.  I had
> configured host names for a number of computers on my green network in the
> ipFire Hosts file and this was working well prior to the most recent upgrade.
> 
> I can no longer access the web interface via my ipFire computer name, I have
> to resort to its ip address.
> 
> However, unlike the OP, my unbound seems to start up and restart without any
> errors.
> 
> also, my /var/ipfire/main/hosts seems to contain valid data, specifically
> each line has "on" at the start and the end.
> 
> So, it appears that I have the same symptoms as the OP, but not necessarily
> the same cause.
> 
> Is there more information I can provide to help get to the bottom of this
> problem?

This looks to be a different bug to this one which is about unbound not restarting.

Your bug is that the WUI is not accessible via the host name, only by the IP.

Is this bug still a problem with Core Update 182?
Comment 10 Adolf Belka 2024-01-09 22:02:43 UTC
@ Michael (original bug reporter).

Is your bug of unbound not restarting still occurring with Core Update 182"?
Comment 11 Adolf Belka 2024-02-24 18:02:50 UTC
As there has been no further feedback on either of the two bug descriptions in this report for the last 45 days and the problem was originally raised for updating from CU139 to CU141 and we are now on CU183 this bug will be closed.

If the bug is still valid then it can be reopened together with supporting data from the current released version.