Erreur dnsmasq sur un serveur OVH Kimsufi

Après une réinstallation complète en ssh sous root, j’ai toujours l’erreur suivante:
Erreur : Échec de l’exécution du script « /usr/share/yunohost/hooks/conf_regen/43-dnsmasq »
Quelqu’un aurait-il une idée? En vous remerciant

Salut,

est-ce qut tu peux donner le resultat de la commande suivante ?

yunohost service regen-conf dnsmasq --debug

Bonjour,
Voilà le résultat de la commande:

root@ns328884:~# yunohost service regen-conf dnsmasq --debug
154 DEBUG loading actions map namespace ‘yunohost’
217 DEBUG extra parameter classes loaded: [‘ask’, ‘password’, ‘required’, ‘pattern’]
217 DEBUG initializing base actions map parser for cli
221 DEBUG registering new callback action ‘yunohost.utils.packages.ynh_packages_version’ to [’-v’, ‘–version’]
452 DEBUG lock has been acquired
463 INFO processing action [10691.1]: yunohost.service.regen-conf with args={‘force’: False, ‘dry_run’: False, ‘with_diff’: False, ‘names’: [‘dnsmasq’], ‘list_pending’: False}
471 DEBUG custom hook folder not found for action ‘conf_regen’ in /etc/yunohost/hooks.d/
489 INFO Exécution de la commande « sh -c YNH_CWD=/usr/share/yunohost/hooks/conf_regen BASH_XTRACEFD=7 /bin/bash -x “./43-dnsmasq” pre 0 0 /home/yunohost.conf/pending/dnsmasq 7>&1 »…
510 INFO + set -e
513 INFO + FORCE=0
514 INFO + DRY_RUN=0
515 INFO + case “$1” in
516 INFO + do_pre_regen /home/yunohost.conf/pending/dnsmasq
518 INFO + pending_dir=/home/yunohost.conf/pending/dnsmasq
519 INFO + . /usr/share/yunohost/helpers.d/ip
519 INFO + cd /usr/share/yunohost/templates/dnsmasq
520 INFO + dnsmasq_dir=/home/yunohost.conf/pending/dnsmasq/etc/dnsmasq.d
521 INFO + mkdir -p /home/yunohost.conf/pending/dnsmasq/etc/dnsmasq.d
521 INFO + etcdefault_dir=/home/yunohost.conf/pending/dnsmasq/etc/default
522 INFO + mkdir -p /home/yunohost.conf/pending/dnsmasq/etc/default
523 INFO + cp plain/etcdefault /home/yunohost.conf/pending/dnsmasq/etc/default/dnsmasq
524 INFO + cp plain/dnsmasq.conf /home/yunohost.conf/pending/dnsmasq/etc/dnsmasq.conf
527 INFO + cat plain/resolv.dnsmasq.conf
528 INFO + grep '^nameserver’
529 INFO + shuf
533 INFO ++ curl -s -4 https://ip.yunohost.org
2169 INFO + ipv4=NNN.NNN.NNN.NNN
2171 INFO + ynh_validate_ip4 NNN.NNN.NNN.NNN
2172 INFO + ynh_validate_ip 4 NNN.NNN.NNN.NNN
2173 INFO + IP_ADDRESS_FAMILY=4
2173 INFO + IP_ADDRESS=NNN.NNN.NNN.NNN
2174 INFO + ‘[’ 4 == 4 ']'
2175 INFO + python /dev/stdin
2234 INFO ++ curl -s -6 https://ip6.yunohost.org
2392 INFO + ipv6=2001:41d0:a:6896::1
2393 INFO + ynh_validate_ip6 NNN:NNN:NNN:NNN
2395 INFO + ynh_validate_ip 6 NNN:NNN:NNN:NNN
2397 INFO + IP_ADDRESS_FAMILY=6
2398 INFO + IP_ADDRESS=NNN:NNN:NNN:NNN
2399 INFO + ‘[’ 6 == 4 ']'
2400 INFO + ‘[’ 6 == 6 ']'
2401 INFO + python /dev/stdin
2460 INFO ++ sudo yunohost domain list --output-as plain --quiet
6630 INFO + domain_list=domaine.tld
6632 INFO + for domain in '$domain_list’
6633 INFO + cat domain.tpl
6634 INFO + sed 's/{{ ip }}/NNN.NNN.NNN.NNN/g’
6635 INFO + sed 's/{{ domain }}/domaine.tld/g’
6639 INFO + [[ -n 2001:41d0:a:6896::1 ]]
6640 INFO + echo address=/domaine.tldz/NNN:NNN:NNN:NNN
6642 INFO ++ ls -1 /etc/dnsmasq.d
6643 INFO ++ awk '/^[^.]+.[^.]+.*$/ { print $1 }'
6647 INFO + conf_files=domaine.tld
6648 INFO + for domain in '$conf_files’
6649 INFO + [[domaine.tld =~ domaine.tld ]]
6649 INFO + exit 0
6738 INFO Application des configurations en attentes pour le service « dnsmasq »…
6855 DEBUG processing pending conf ‘/home/yunohost.conf/pending/dnsmasq/etc/resolv.dnsmasq.conf’ to system conf '/etc/resolv.dnsmasq.conf’
6857 INFO Le fichier de configuration « /etc/resolv.dnsmasq.conf » a été sauvegardé dans « /home/yunohost.conf/backup/etc/resolv.dnsmasq.conf-20170807.141855 »
6858 INFO Le fichier de configuration « /etc/resolv.dnsmasq.conf » a été mis à jour
6859 DEBUG processing pending conf ‘/home/yunohost.conf/pending/dnsmasq/etc/dnsmasq.d/domaine.tld’ to system conf '/etc/dnsmasq.d/domaine.tld’
6860 DEBUG > system conf is already up-to-date
6860 DEBUG processing pending conf ‘/home/yunohost.conf/pending/dnsmasq/etc/default/dnsmasq’ to system conf ‘/etc/default/dnsmasq’
6861 DEBUG > system conf is already up-to-date
6862 DEBUG processing pending conf ‘/home/yunohost.conf/pending/dnsmasq/etc/dnsmasq.conf’ to system conf ‘/etc/dnsmasq.conf’
6863 DEBUG > system conf is already up-to-date
6863 SUCCESS La configuration a été mise à jour pour le service « dnsmasq »
6864 DEBUG updating conf hashes for ‘dnsmasq’ with: {’/etc/dnsmasq.d/domaine.tld’: ‘4ec59f52b709d7fdd7f72a9539b486c5’, ‘/etc/resolv.dnsmasq.conf’: ‘fa873f793bd24a7e29135192910fdf8d’, ‘/etc/default/dnsmasq’: ‘ff5c2923b4d5e1e51ffd8d226c26fe2b’, ‘/etc/dnsmasq.conf’: ‘e99384d2e9cd9de9d8bbb4f1f831948d’}
7043 DEBUG custom hook folder not found for action ‘conf_regen’ in /etc/yunohost/hooks.d/
7044 INFO Exécution de la commande « sh -c YNH_CWD=/usr/share/yunohost/hooks/conf_regen BASH_XTRACEFD=7 /bin/bash -x “./43-dnsmasq” post 0 0 /etc/resolv.dnsmasq.conf 7>&1 »…
7062 INFO + set -e
7064 INFO + FORCE=0
7066 INFO + DRY_RUN=0
7067 INFO + case “$1” in
7068 INFO + do_post_regen /etc/resolv.dnsmasq.conf
7069 INFO + regen_conf_files=/etc/resolv.dnsmasq.conf
7070 INFO + [[ -z /etc/resolv.dnsmasq.conf ]]
7070 INFO + sudo service dnsmasq restart
7180 WARNING Job for dnsmasq.service failed. See ‘systemctl status dnsmasq.service’ and ‘journalctl -xn’ for details.
7274 ERROR Échec de l’exécution du script « /usr/share/yunohost/hooks/conf_regen/43-dnsmasq »
Traceback (most recent call last):
File “/usr/lib/moulinette/yunohost/hook.py”, line 278, in hook_callback
no_trace=no_trace, raise_on_error=True, user=“root”)
File “/usr/lib/moulinette/yunohost/hook.py”, line 376, in hook_exec
errno.EIO, m18n.n(‘hook_exec_failed’, path=path))
MoulinetteError: [Errno 5] Échec de l’exécution du script « /usr/share/yunohost/hooks/conf_regen/43-dnsmasq »
7278 DEBUG action [10691.1] ended after 6.815s
7280 DEBUG lock has been released
dnsmasq:
applied:
/etc/resolv.dnsmasq.conf:
status: updated
pending:
root@ns328884:~#

On retrouve effectivement le problème. Je précise que je suis sur un serveur kumsufi et mon registrar est bookmyname ou pour l’instant la seule configuration que j’ai effectuée est:

www 28800 A ipv4deMonServeurKimsufi

Et les dns par défaut son ceux de bookmyname:

nsa.bookmyname.com
nsb.bookmyname.com
nsc.bookmyname.com

En vous remerciant pour votre aide

Oké,

je pense pas que ce soit lié aux DNS en tant que telle, c’est surement juste un probleme de conf dans DNSmasq…

Que dit service dnsmasq status ? (Ou bien un tail -n50 /var/log/daemon.log après avoir fait un service dnsmasq restart)

Voilà pour la première commande:

root@ns328884:~# service dnsmasq status
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d
└─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
Active: failed (Result: exit-code) since lun. 2017-08-07 14:18:55 CEST; 45min ago
Process: 10738 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
Process: 10734 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

août 07 14:18:55 ns328884.ip-37-187-115.eu dnsmasq[10734]: dnsmasq: syntax c…
août 07 14:18:55 ns328884.ip-37-187-115.eu dnsmasq[10738]: dnsmasq: impossib…ée
août 07 14:18:55 ns328884.ip-37-187-115.eu systemd[1]: dnsmasq.service: cont…
août 07 14:18:55 ns328884.ip-37-187-115.eu systemd[1]: Failed to start dnsma…
août 07 14:18:55 ns328884.ip-37-187-115.eu systemd[1]: Unit dnsmasq.service …
Hint: Some lines were ellipsized, use -l to show in full.
root@ns328884:~#

Hm ouaip, les lignes sont tronquées … je crois qu’il faudrait la refaire avec l’option -l à la fin :confused:

root@ns328884:~# service dnsmasq status
● dnsmasq.service - dnsmasq - A lightweight DHCP and caching DNS server
Loaded: loaded (/lib/systemd/system/dnsmasq.service; enabled)
Drop-In: /run/systemd/generator/dnsmasq.service.d
└─50-dnsmasq-$named.conf, 50-insserv.conf-$named.conf
Active: failed (Result: exit-code) since lun. 2017-08-07 15:08:06 CEST; 50min ago
Process: 13030 ExecStart=/etc/init.d/dnsmasq systemd-exec (code=exited, status=2)
Process: 13027 ExecStartPre=/usr/sbin/dnsmasq --test (code=exited, status=0/SUCCESS)

août 07 15:08:06 ns328884.ip-37-187-115.eu dnsmasq[13027]: dnsmasq: syntax check OK.
août 07 15:08:06 ns328884.ip-37-187-115.eu dnsmasq[13030]: dnsmasq: impossible de créer une socket d’écoute pour port 53 : Adress…tilisée
août 07 15:08:06 ns328884.ip-37-187-115.eu systemd[1]: dnsmasq.service: control process exited, code=exited status=2
août 07 15:08:06 ns328884.ip-37-187-115.eu systemd[1]: Failed to start dnsmasq - A lightweight DHCP and caching DNS server.
août 07 15:08:06 ns328884.ip-37-187-115.eu systemd[1]: Unit dnsmasq.service entered failed state.
Hint: Some lines were ellipsized, use -l to show in full.
root@ns328884:~#

Okay, c’est bizarre on dirait que tu as déjà quelque chose qui tourne sur le port 53 … Est-ce que tu peux faire un netstat -tulpn | grep :53 | grep LISTEN ?

root@ns328884:~# netstat -tulpn | grep :53 | grep LISTEN
tcp 0 0 127.0.0.1:53 0.0.0.0:* LISTEN 16724/named
tcp6 0 0 ::1:53 :::* LISTEN 16724/named
root@ns328884:~#

Ok, on dirait que tu as un serveur bind qui tourne déjà sur ta machine … Est-ce que c’est normal ? Tu es parti de quoi avant d’installer YunoHost ?

Je suis parti d’une réinstallation sur mon kimsufi et j’ai simplement fait une installation de yunohost en root c’est tout

Hm okay… Du coup je pense qu’il faut que tu fasses un service bind9 stop (ou peut-être juste bind). Ensuite, retente un yunohost service regen-conf dnsmasq

1 Like

ok je viens de faire:
root@ns328884:~# service bind9 stop
root@ns328884:~# yunohost service regen-conf dnsmasq
Succès ! La configuration a été mise à jour pour le service « dnsmasq »
dnsmasq:
applied:
/etc/resolv.dnsmasq.conf:
status: updated
pending:
root@ns328884:~#

Je ne comprends pas je n’ai pas installé de service bind est-ce lié à l’installation fourni par kimsufi?

2 Likes

Oui, j’imagine… Je sais pas trop pourquoi ils installent ca par défaut mais bon :confused:. En tout cas maintenant tout devrait marcher :smile: :tada: !

Pour l’instant en tapant:
https://www.monsite.xyz/yunohost/admin
ou
https://monIPv4/yunohost/admin
J’arrive à un message d’avertissement:

Échec de la connexion sécurisée

Hmoui, c’est peut-être du au fait que tu utilises un certificat auto-signé… Tu peux regader pour ajouter un certificat Let’s Encrypt ici https://yunohost.org/#/certmanager_fr (depuis la ligne de commande, ou bien de puis l’interface d’admin, à laquelle tu devrais pouvoir accéder si tu ajoutes une exception pour le certif autosigné)

Je viens de faire:

root@ns328884:~# yunohost domain cert-status
certificates:
domaine.tld:
CA_type: Self-signed
summary: WARNING
validity: 3649
J’ai donc bien des certificats auto-signé

Puis ensuite j’ai tapé

root@ns328884:~# yunohost domain cert-install
Erreur : Certificate installation for wendling.xyz failed !
Exception: [Errno 22] Aucun enregistrement DNS « A » n’a été trouvé pour wendling.xyz. De devez faire pointer votre nom de domaine vers votre machine pour être capable d’installer un certificat Let’s Encrypt ! (Si vous savez ce que vous faites, utilisez --no-checks pour désactiver ces contrôles)
root@ns328884:~#

Pourtant la seule configuration que j’ai effectuée est chez mon registrar bookmyname est justement en champ en A:

www 28800 A ipv4deMonServeurKimsufi

Et les dns par défaut son ceux de bookmyname:

nsa.bookmyname.com
nsb.bookmyname.com
nsc.bookmyname.com

Une idée?

L’enregistrement www 28800 A ipv4deMonServeurKimsufi corresponds à www.wendling.xyz, pas à wendling.xyz.

Du coup :

  • soit tu rajoutes un enregistrement DNS @ 28800 A ipv4deMonServeurKimsufi (qui corresponds à wendling.xyz)
  • soit tu configures ton Yunohost pour gérer le domaine www.wendling.xyz (avec yunohost domain add www.wendling.xyz)

(Mais dans tous les cas, si tu veux utiliser ton instance yunohost via le domaine wendling.xyz, il faudra configurer le DNS correspondant)

Merci pour votre aide
J’ai choisi l’option de configurer Yunohost pour gérer le domaine. Donc je viens de faire:

root@ns328884:~# yunohost domain add www.domaine.tld
Mot de passe d’administration :
Succès ! Installation avec succès d’un certificat auto-signé pour le domaine www.domaine.tld !
Succès ! La configuration a été mise à jour pour le service « nginx »
Succès ! La configuration a été mise à jour pour le service « dnsmasq »
Succès ! La configuration a été mise à jour pour le service « metronome »
Succès ! Le domaine a été créé
root@ns328884:~#

Il reste votre dernière ligne qui me pose problème:
Mais dans tous les cas, si tu veux utiliser ton instance yunohost via le domaine wendling.xyz, il faudra configurer le DNS correspondant
Cela consiste à quoi faire?

C.f. le premier bullet point de mon message précédent :

  • rajouter un enregistrement DNS @ 28800 A ipv4deMonServeurKimsufi (qui corresponds à wendling.xyz)