Diagnosis reports error on yunomdns

I have searched the forum for similar issues

on

This category is for general issues(=something is broken) regarding YunoHost, NOT apps.

on

This form is written in English but feel free to write in French if you’re more comfortable!

on

What type of hardware are you using

Virtual machine

What YunoHost version are you running

12.1.41.2

How are you able to access your server

SSH

Are you in a special context or did you perform specific tweaking on your YunoHost instance ?

No special context

Describe your issue

Diagnosis reports yunomdns service is not functional and it’s right.
The problem seems to be linked to the file /etc/yunohost/mdns.yml.

Share relevant logs or error messages

– Boot 803b4197f5c5414a9a2c5f5cc16f98aa –
sept. 09 12:19:53 systemd[1]: Started yunomdns.service - YunoHost mDNS service.
sept. 09 12:19:59 yunomdns[796]: Traceback (most recent call last):
sept. 09 12:19:59 yunomdns[796]: File “/usr/bin/yunomdns”, line 205, in
sept. 09 12:19:59 yunomdns[796]: sys.exit(0 if main() else 1)
sept. 09 12:19:59 yunomdns[796]: ^^^^^^
sept. 09 12:19:59 yunomdns[796]: File “/usr/bin/yunomdns”, line 86, in main
sept. 09 12:19:59 yunomdns[796]: with open(“/etc/yunohost/mdns.yml”, “r”) as f:
sept. 09 12:19:59 yunomdns[796]: ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sept. 09 12:19:59 yunomdns[796]: PermissionError: [Errno 13] Permission denied: ‘/etc/yunohost/mdns.yml’
sept. 09 12:20:00 systemd[1]: yunomdns.service: Main process exited, code=exited, status=1/FAILURE

Check the permissions and ownership of /etc/yunohost/mdns.yml

If needed, change them and restart yunomdns.

See:

You may also have to regen dnsmasq configuration.

yunohost tools regen-conf dnsmasq --force

Thank you.

Here are the commands I reproduced from the post and it fixes the problem.

root@shelf:~# cd /etc/yunohost/
root@shelf:/etc/yunohost# ls -la md*
-rw------- 1 root root 30 Nov 16  2021 mdns.yml
root@shelf:/etc/yunohost# chown mdns:mdns /etc/yunohost/mdns.yml
root@shelf:/etc/yunohost# chmod 600 /etc/yunohost/mdns.yml
root@shelf:/etc/yunohost# ls -la md*
-rw------- 1 mdns mdns 30 Nov 16  2021 mdns.yml
root@shelf:/etc/yunohost# yunohost tools regen-conf dnsmasq
SUCCESS Configuration updated for 'dnsmasq'
dnsmasq:
  applied:
    /etc/dnsmasq.d/spamhaus:
      status: updated
  pending:
root@shelf:/etc/yunohost# ls -la md*
-rw------- 1 mdns mdns 30 Nov 16  2021 mdns.yml
root@shelf:/etc/yunohost# systemctl restart yunomdns