Latest Yunohost Update broke Dnsmasq on my Server

My YunoHost server

Hardware: computer
YunoHost version: 4.3.4
I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If yes, please explain:

Description of my issue

I upgraded yunohost system today, and then internet wasn’t working on a desktop computer on my network. I use PiHole so I figured something went wrong with Yunohost and I started investigating.

$ sudo yunohost --version
yunohost: 
  repo: stable
  version: 4.3.4
yunohost-admin: 
  repo: stable
  version: 4.3.2.3
moulinette: 
  repo: stable
  version: 4.3.2.2
ssowat: 
  repo: stable
  version: 4.3.2.2

After upgrading, there was problems with internet on my desktop computer on the same network. I checked the yunohost services and dnsmasq has failed.

$ sudo yunohost service status
dnsmasq: 
  configuration: valid
  description: Handles domain name resolution (DNS)
  last_state_change: 2021-11-27 15:28:04
  start_on_boot: enabled
  status: failed

I tried restarting dnsmasq, but that didn’t work.

$ sudo yunohost service restart dnsmasq
Job for dnsmasq.service failed because the control process exited with error code.
See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
Warning: Could not execute the command 'systemctl restart dnsmasq'
Error: Could not restart the service 'dnsmasq'

Recent service logs:-- Logs begin at Fri 2021-11-19 13:15:01 CST, end at Sat 2021-11-27 15:46:04 CST. --
Nov 24 22:31:05 systemd[1]: Stopping dnsmasq - A lightweight DHCP and caching DNS server...
Nov 24 22:31:05 dnsmasq[17993]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf
Nov 24 22:31:05 systemd[1]: dnsmasq.service: Succeeded.
Nov 24 22:31:05 systemd[1]: Stopped dnsmasq - A lightweight DHCP and caching DNS server.
Nov 24 22:31:05 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Nov 24 22:31:05 dnsmasq[18025]: dnsmasq: syntax check OK.
Nov 24 22:31:06 dnsmasq[18036]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf
Nov 24 22:31:06 systemd[1]: Started dnsmasq - A lightweight DHCP and caching DNS server.
Nov 27 15:28:03 systemd[1]: Stopping dnsmasq - A lightweight DHCP and caching DNS server...
Nov 27 15:28:04 dnsmasq[14085]: /etc/resolvconf/update.d/libc: Warning: /etc/resolv.conf is not a symbolic link to /etc/resolvconf/run/resolv.conf
Nov 27 15:28:04 systemd[1]: dnsmasq.service: Succeeded.
Nov 27 15:28:04 systemd[1]: Stopped dnsmasq - A lightweight DHCP and caching DNS server.
Nov 27 15:28:04 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Nov 27 15:28:04 dnsmasq[14124]: dnsmasq: syntax check OK.
Nov 27 15:28:04 dnsmasq[14125]: dnsmasq: bad option at line 22 of /etc/dnsmasq.d/wg.arkadi.one
Nov 27 15:28:04 dnsmasq[14125]: bad option at line 22 of /etc/dnsmasq.d/wg.arkadi.one
Nov 27 15:28:04 systemd[1]: dnsmasq.service: Control process exited, code=exited, status=1/FAILURE
Nov 27 15:28:04 dnsmasq[14125]: FAILED to start up
Nov 27 15:28:04 systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Nov 27 15:28:04 systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
Nov 27 15:46:04 systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Nov 27 15:46:04 dnsmasq[15588]: dnsmasq: syntax check OK.
Nov 27 15:46:04 dnsmasq[15589]: dnsmasq: bad option at line 22 of /etc/dnsmasq.d/wg.arkadi.one
Nov 27 15:46:04 systemd[1]: dnsmasq.service: Control process exited, code=exited, status=1/FAILURE
Nov 27 15:46:04 dnsmasq[15589]: bad option at line 22 of /etc/dnsmasq.d/wg.arkadi.one
Nov 27 15:46:04 systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Nov 27 15:46:04 dnsmasq[15589]: FAILED to start up
Nov 27 15:46:04 systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.

I checked what the file it is complaning about it. I don’t know anything about dnsmasq so I don’t know what’s wrong.

Also, I haven’t made any tweaks to Wireguard or Pihole for the last month so I’m not sure how the file is suddenly not valid.

line 21-24 of /etc/dnsmasq.d/wg.arkadi.one
interface-name=wg.arkadi.one,veth5a4e3a9
22 veth6342377
23 interface-name=xmpp-upload.wg.arkadi.one,veth5a4e3a9
24 veth6342377

I tried restarting the service, but still has an error.
I tried rebooting, but the problem persists.

Any idea what happened?

1 Like

Sorry I posted without read first your post ; same error :

I cannot replicate your issue after upgrading my server.

I guess you should not have interface names like that alone in the file.
Can you first regenerate the dns config? sudo yunohost tools regen-conf dnsmasq

If it’s still failing, try removing line 22 and 23 with the weird veth and restart the service.

1 Like

hello, I have the same error here …

Someone has found a solution, or wants clarification because it is beyond my competence ???

Come on, I have suggested a solution right before your message.

sudo yunohost tools regen-conf dnsmasq
Success! Configuration updated for 'dnsmasq'
Warning: Job for dnsmasq.service failed because the control process exited with                                                        error code.
Warning: See "systemctl status dnsmasq.service" and "journalctl -xe" for details                                                   
Error: Could not run script: /usr/share/yunohost/hooks/conf_regen/43-dnsmasq
systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2021-11-27 12:53:26 UTC; 3min 20s ago
  Process: 3484 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
  Process: 3490 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=1/FAILURE)
  • I tried deleting line from wg.arkadi.one, and restarting dnsmasq. Then it complains that web.arkadi.one has the same veth thing in it. Looks like many of the dnsmasq files have random things it like that.
  • Then I tried your suggestion to regenerate the files:
$ sudo yunohost tools regen-conf dnsmasq
Warning: The configuration file '/etc/dnsmasq.conf' has been manually modified and will not be updated
Warning: The configuration file '/etc/dnsmasq.d/wg.arkadi.one' has been manually modified and will not be updated
Warning: The configuration file '/etc/dnsmasq.d/01-pihole.conf' has been manually modified and will not be updated
Info: The configuration file '/etc/dnsmasq.d/02-interfaces.conf' is expected to be deleted by regen-conf (category dnsmasq) but was kept back.
Warning: Job for dnsmasq.service failed because the control process exited with error code.
Warning: See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
Error: Could not run script: /usr/share/yunohost/hooks/conf_regen/43-dnsmasq
dnsmasq: 
  applied: 
    /etc/dnsmasq.d/arkadi.one: 
      status: updated
    /etc/dnsmasq.d/blog.arkadi.one: 
      status: updated
    /etc/dnsmasq.d/chantel.arkadi.one: 
      status: updated
    /etc/dnsmasq.d/photos.arkadi.one: 
      status: updated
    /etc/dnsmasq.d/searx.arkadi.one: 
      status: updated
    /etc/dnsmasq.d/send.arkadi.one: 
      status: updated
    /etc/dnsmasq.d/web.arkadi.one: 
      status: updated
    /etc/resolv.dnsmasq.conf: 
      status: updated
  pending: 
    /etc/dnsmasq.conf: 
      status: modified
    /etc/dnsmasq.d/01-pihole.conf: 
      status: modified
    /etc/dnsmasq.d/02-interfaces.conf: 
      status: unmanaged
    /etc/dnsmasq.d/wg.arkadi.one: 
      status: modified

Still doesn’t start dnsmasq.

I forced it to update files, but it still puts weird interfaces in there that stop dnsmasq from restarting.

$ sudo yunohost tools regen-conf dnsmasq --force
Success! Configuration updated for 'dnsmasq'
Warning: Job for dnsmasq.service failed because the control process exited with error code.
Warning: See "systemctl status dnsmasq.service" and "journalctl -xe" for details.
Error: Could not run script: /usr/share/yunohost/hooks/conf_regen/43-dnsmasq
dnsmasq: 
  applied: 
    /etc/dnsmasq.conf: 
      status: force-updated
    /etc/dnsmasq.d/01-pihole.conf: 
      status: force-updated
    /etc/dnsmasq.d/02-interfaces.conf: 
      status: force-removed
    /etc/dnsmasq.d/wg.arkadi.one: 
      status: force-updated
    /etc/resolv.dnsmasq.conf: 
      status: updated
  pending: 

$ sudo systemctl status dnsmasq.service
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
   Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2021-11-27 21:07:03 CST; 1min 53s ago
  Process: 14831 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)
  Process: 14832 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=1/FAILURE)

Nov 27 21:07:03 arkadi.one systemd[1]: Starting dnsmasq - A lightweight DHCP and caching DNS server...
Nov 27 21:07:03 arkadi.one dnsmasq[14831]: dnsmasq: syntax check OK.
Nov 27 21:07:03 arkadi.one dnsmasq[14832]: dnsmasq: bad option at line 22 of /etc/dnsmasq.d/wg.arkadi.one
Nov 27 21:07:03 arkadi.one systemd[1]: dnsmasq.service: Control process exited, code=exited, status=1/FAILURE
Nov 27 21:07:03 arkadi.one dnsmasq[14832]: bad option at line 22 of /etc/dnsmasq.d/wg.arkadi.one
Nov 27 21:07:03 arkadi.one systemd[1]: dnsmasq.service: Failed with result 'exit-code'.
Nov 27 21:07:03 arkadi.one dnsmasq[14832]: FAILED to start up
Nov 27 21:07:03 arkadi.one systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.

Thank you both for testing. Dnsmasq handling has indeed been tweaked with this version, and the culprit may be that line:

The interfaces list may not be parsed/split correctly. Can you run ls -m /sys/class/net | sed s/,//g and share the output?

Hello,

I have a similar problem since installing the latest version of YunoHost (4.3.4). I also use PiHole (ad blocking and hairpinning)! After uninstalling PiHole (5.4) and reinstalling PiHole (3.3.1), the problem seems to be gone!

@arkadi : Which version of PiHole do you use?

/etc/dnsmasq.conf :

domain-needed
expand-hosts
localise-queries



interface=lo

resolv-file=/etc/resolv.dnsmasq.conf
#pihole# cache-size=256conf-dir=/etc/dnsmasq.d/

ls -m /sys/class/net | sed s/,//g :

enp1s0 enp2s0 lo

Thank you for your help!

Hello,
I have the same error on line 28.
And on line 28 of the file “/etc/dnsmasq.d/www.monsiteweb.fr”, if I count the empty lines, I find “ip6tnl0”.
Same thing in my file “/etc/dnsmasq.d/monsiteweb.fr”.
I made a backup of my file (in my home folder) and I try by deleting the two lines “ip6tnl0” in the files www.monsite.fr and monsite.fr.
They don’t seem to fit with the rest of the file.

Oh!!!
It works!!

Cool …

A+
Cyril

1 Like

@Cyril @Maknho @arkadi @R-0ne Could you please return the result of those commands and give details on which equipment you are and if you have pi-hole or not:

ls /sys/class/net
ls -m /sys/class/net | sed s/,//g

Output of ls /sys/class/net

docker0  hassio  veth3182c80  veth83f26f0  veth9849b33  wg0
eth0     lo      veth81ff465  veth8a599ac  vethc40c764

Output of ls -m /sys/class/net | sed s/,//g

docker0 eth0 hassio lo veth3182c80 veth81ff465 veth83f26f0 veth8a599ac
veth9849b33 vethc40c764 wg0

No pi-hole and I am on an Odroid N2+

:~$ ls /sys/class/net                                                                                                                                                                            
bond0  bonding_masters  dummy0  eno1  erspan0  gre0  gretap0  ifb0  ifb1  ip6tnl0  lo  sit0  teql0  tunl0
:~$ ls -m /sys/class/net | sed s/,//g                                                                                                                                                            
bond0 bonding_masters dummy0 eno1 erspan0 gre0 gretap0 ifb0 ifb1 ip6tnl0 lo sit0 teql0 tunl0                                                                                                                        

No pi-hole
I’m on a kimsuffi VPN ( Debian 9 “Stretch” (64bits) Serveur KS-7 - Intel i3-2130 - 8GB DDR3 1333 MHz - 2To SATA )

Could you also run this command :

python3 -c "for int in '$(ls -m /sys/class/net | sed s/,//g)'.strip().split(' '): print(f"'"'"> {int}"'"'")"
:~$ python3 -c "for int in '$(ls -m /sys/class/net | sed s/,//g)'.strip().split(' '): print(f"'"'"> {int}"'"'")"                                                                                 
> bond0                                                                                                                                                                                                             
> bonding_masters                                                                                                                                                                                                   
> dummy0                                                                                                                                                                                                            
> eno1                                                                                                                                                                                                              
> erspan0                                                                                                                                                                                                           
> gre0                                                                                                                                                                                                              
> gretap0                                                                                                                                                                                                           
> ifb0                                                                                                                                                                                                              
> ifb1                                                                                                                                                                                                              
> ip6tnl0                                                                                                                                                                                                           
> lo                                                                                                                                                                                                                
> sit0                                                                                                                                                                                                              
> teql0                                                                                                                                                                                                             
> tunl0
# python3 -c "for int in '$(ls -m /sys/class/net | sed s/,//g)'.strip().split(' '): print(f"'"'"> {int}"'"'")"

  File "<string>", line 1
    for int in 'docker0 eth0 hassio lo veth3182c80 veth81ff465 veth83f26f0 veth8a599ac
                                                                                     ^
SyntaxError: EOL while scanning string literal
FAIL
1 Like

To @Maknho and @Cyril try this:

python3 -c "for int in '$(ip -j addr show | jq -r '[.[].ifname]|join(" ")')'.split(' '): print(f"'"'"> {int}"'"'")"

@ljf

# python3 -c "for int in '$(ip -j addr show | jq -r '[.[].ifname]|join(" ")')'.split(' '): print(f"'"'"> {int}"'"'")"
> lo
> eth0
> hassio
> docker0
> veth9849b33
> vethc40c764
> veth81ff465
> veth83f26f0
> veth8a599ac
> veth3182c80
> wg0

@ljf

:~$ python3 -c "for int in '$(ip -j addr show | jq -r '[.[].ifname]|join(" ")')'.split(' '): print(f"'"'"> {int}"'"'")"
> lo                                                                                                                                                                                                                
> bond0                                                                                                                                                                                                             
> dummy0                                                                                                                                                                                                            
> ifb0                                                                                                                                                                                                              
> ifb1                                                                                                                                                                                                              
> eno1                                                                                                                                                                                                              
> teql0                                                                                                                                                                                                             
> tunl0                                                                                                                                                                                                             
> gre0                                                                                                                                                                                                              
> gretap0                                                                                                                                                                                                           
> erspan0                                                                                                                                                                                                           
> sit0                                                                                                                                                                                                              
> ip6tnl0

Ok thanks to you, i will try to make a fix with that, i was not aware of setup with too much network interfaces and of this strange bug with return line in ls -m /sys/class/net

2 Likes