Migration vers Stretch échouée : No such file or directory: '/etc/fail2ban/filter.d/yunohost.conf'

Bonjour !

Je viens de tenter la migration vers stretch, et au bout de quelques dizaines de minutes j’obtiens l’erreur suivante :

La migration 3 migrate_to_stretch a échoué avec l’exception [Errno 2] No such file or directory: ‘/etc/fail2ban/filter.d/yunohost.conf’, annulation

Je n’ai touché à rien depuis. Que dois-je faire pour sauver mon serveur ? :frowning:

Merci pour votre aide.

Salut,

eventuellement tu peux tenter de faire, depuis SSH en ligne de comande, un cp -r /etc/fail2ban.old /etc/fail2ban puis relancer la migration ?

Merci, effectivement après cette commande la migration n’a pas renvoyé de message d’erreur et le serveur apparaît bien sous Stretch et Yunohost 3.

Néanmoins l’application Rainloop me dit “serveur injoignable”, la commande “yunohost service status fail2ban” renvoie “active: failed” et lorsque j’essaie de faire les mises à jour via l’interface admin, j’obtiens le log suivant :

2018-07-01 12:50:24,537 ERROR moulinette.authenticator.ldap authenticate - unable to reach the server to authenticate

Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/moulinette/authenticators/ldap.py", line 79, in authenticate

    con.simple_bind_s(self.userdn, password)

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 207, in simple_bind_s

    

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 201, in simple_bind

    This function adds a new entry with a distinguished name

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 99, in _ldap_call

    pprint.pformat((args,kwargs))

SERVER_DOWN: {'desc': "Can't contact LDAP server"}

2018-07-01 12:50:24,539 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 12:50:24] "GET /users?locale=fr HTTP/1.1" 500 173 0.048465

2018-07-01 12:56:15,999 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 12:56:15] "GET /version?locale=fr HTTP/1.1" 200 357 1.550563

2018-07-01 12:56:16,002 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 12:56:16,004 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 12:56:16,053 ERROR    moulinette.authenticator.ldap authenticate - unable to reach the server to authenticate

Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/moulinette/authenticators/ldap.py", line 79, in authenticate

    con.simple_bind_s(self.userdn, password)

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 207, in simple_bind_s

    

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 201, in simple_bind

    This function adds a new entry with a distinguished name

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 99, in _ldap_call

    pprint.pformat((args,kwargs))

SERVER_DOWN: {'desc': "Can't contact LDAP server"}

2018-07-01 12:56:16,055 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 12:56:16] "GET /users?locale=fr HTTP/1.1" 500 173 0.053452

2018-07-01 12:57:02,903 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 12:57:02,906 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 12:57:02,985 ERROR    moulinette.authenticator.ldap authenticate - unable to reach the server to authenticate

Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/moulinette/authenticators/ldap.py", line 79, in authenticate

    con.simple_bind_s(self.userdn, password)

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 207, in simple_bind_s

    

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 201, in simple_bind

    This function adds a new entry with a distinguished name

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 99, in _ldap_call

    pprint.pformat((args,kwargs))

SERVER_DOWN: {'desc': "Can't contact LDAP server"}

2018-07-01 12:57:02,989 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 12:57:02] "GET /users?locale=fr HTTP/1.1" 500 173 0.087624

2018-07-01 12:57:04,556 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 12:57:04] "GET /version?locale=fr HTTP/1.1" 200 357 1.560815

2018-07-01 12:59:32,716 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 12:59:32] "GET /version?locale=fr HTTP/1.1" 200 357 1.550187

2018-07-01 12:59:32,719 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 12:59:32,721 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 12:59:32,765 ERROR    moulinette.authenticator.ldap authenticate - unable to reach the server to authenticate

Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/moulinette/authenticators/ldap.py", line 79, in authenticate

    con.simple_bind_s(self.userdn, password)

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 207, in simple_bind_s

    

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 201, in simple_bind

    This function adds a new entry with a distinguished name

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 99, in _ldap_call

    pprint.pformat((args,kwargs))

SERVER_DOWN: {'desc': "Can't contact LDAP server"}

2018-07-01 12:59:32,767 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 12:59:32] "GET /users?locale=fr HTTP/1.1" 500 173 0.048896

2018-07-01 14:40:28,026 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:40:28] "GET /version?locale=fr HTTP/1.1" 200 357 1.571597

2018-07-01 14:40:28,029 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:40:28,031 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:40:28,079 ERROR    moulinette.authenticator.ldap authenticate - unable to reach the server to authenticate

Traceback (most recent call last):

  File "/usr/lib/python2.7/dist-packages/moulinette/authenticators/ldap.py", line 79, in authenticate

    con.simple_bind_s(self.userdn, password)

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 207, in simple_bind_s

    

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 201, in simple_bind

    This function adds a new entry with a distinguished name

  File "/usr/lib/python2.7/dist-packages/ldap/ldapobject.py", line 99, in _ldap_call

    pprint.pformat((args,kwargs))

SERVER_DOWN: {'desc': "Can't contact LDAP server"}

2018-07-01 14:40:28,081 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:40:28] "GET /users?locale=fr HTTP/1.1" 500 173 0.052661

2018-07-01 14:42:26,210 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:42:26] "GET /version?locale=fr HTTP/1.1" 200 357 1.094042

2018-07-01 14:42:26,302 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:42:26,306 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:42:26] "GET /users?locale=fr HTTP/1.1" 401 150 0.089117

2018-07-01 14:42:26,435 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:42:26] "GET /installed HTTP/1.1" 200 159 0.002176

2018-07-01 14:42:35,105 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:42:35,313 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:42:35] "POST /login HTTP/1.1" 200 410 0.212342

2018-07-01 14:42:36,393 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:42:36] "GET /version?locale=fr HTTP/1.1" 200 357 1.016751

2018-07-01 14:42:36,401 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:42:36,403 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:42:36,538 INFO     moulinette.actionsmap process - processing action [631.1]: yunohost.user.list

2018-07-01 14:42:36,542 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:42:36] "GET /users?locale=fr HTTP/1.1" 200 638 0.142553

2018-07-01 14:42:36,692 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:42:36,694 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:42:37,073 INFO     moulinette.actionsmap process - processing action [631.2]: yunohost.tools.diagnosis

2018-07-01 14:42:39,341 ERROR    moulinette.core translate - unable to retrieve key 'service_description_minidlna' for default locale 'en'

None

2018-07-01 14:42:40,933 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:42:40] "GET /diagnosis?locale=fr HTTP/1.1" 200 1713 4.241948

2018-07-01 14:42:43,716 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:42:43,722 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:42:43,941 INFO     moulinette.actionsmap process - processing action [631.3]: yunohost.tools.update

2018-07-01 14:42:52,106 SUCCESS  yunohost.app success - [631.3] La liste d’applications yunohost a été récupérée

2018-07-01 14:42:52,292 INFO     geventwebsocket.handler log_request - 127.0.0.1 - - [2018-07-01 14:42:52] "PUT /update HTTP/1.1" 200 2354 8.578541

2018-07-01 14:43:03,027 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:43:03,033 WARNING  moulinette.authenticator.ldap is_authenticated - Error during ldap authentication process: 'NoneType' object has no attribute 'whoami_s'

2018-07-01 14:43:03,224 INFO     moulinette.actionsmap process - processing action [631.4]: yunohost.tools.upgrade

2018-07-01 14:43:06,094 INFO     yunohost.tools tools_upgrade - [631.4] Mise à jour des paquets...

2018-07-01 14:43:45,946 WARNING  yunohost.tools tools_upgrade - [631.4] unable to upgrade packages: installArchives() failed

2018-07-01 14:43:45,948 ERROR    yunohost.tools tools_upgrade - [631.4] Impossible de mettre à jour tous les paquets 

Que faire ? Merci pour votre aide précieuse.

Est-ce que tu peux tenter de relancer le serveur ldap avec systemctl restart slapd ? (Ensuite éventuellement un systemctl restart yunohost-api)

Pour fail2ban, que raconte journalctl -u fail2ban ?

Alors, j’ai passé les 2 commandes, je me suis reconnecté à l’interface admin et désormais elle me dit que le serveur est à jour. Rainloop me renvoie toujours la même erreur.

Pour fail2ban, la commande renvoie en boucle :

Jul 01 14:41:38 0428.fr systemd[1]: Starting Fail2Ban Service…
Jul 01 14:41:39 0428.fr fail2ban-client[1322]: ERROR Failed during configuration: While reading from ‘/etc/fail2ban/jail.conf’ [line 155]: option ‘port’ in
Jul 01 14:41:49 0428.fr systemd[1]: fail2ban.service: Control process exited, code=exited status=255
Jul 01 14:41:49 0428.fr systemd[1]: Failed to start Fail2Ban Service.
Jul 01 14:41:49 0428.fr systemd[1]: fail2ban.service: Unit entered failed state.
Jul 01 14:41:49 0428.fr systemd[1]: fail2ban.service: Failed with result ‘exit-code’.
Jul 01 14:41:49 0428.fr systemd[1]: fail2ban.service: Service hold-off time over, scheduling restart.
Jul 01 14:41:49 0428.fr systemd[1]: Stopped Fail2Ban Service.

L’erreur est peut être liée à ce que tu m’as demandé de faire pendant la migration (copier/coller de l’ancien dossier etc/fail2ban).

Merci !

Okay, ouipe c’est effectivement peut-être lié…

Est-ce que tu peux faire :

mv /etc/fail2ban /etc/fail2ban.old2
dpkg -i --force-confmiss /var/cache/apt/archives/fail2ban*.deb
yunohost service regen-conf fail2ban --force
systemctl restart fail2ban

La seconde commande me renvoie :

dpkg: error: cannot access archive ‘/var/cache/apt/archives/fail2ban*.deb’: No such file or directory

Hm on va faire comme ça alors :wink: :

wget http://ftp.fr.debian.org/debian/pool/main/f/fail2ban/fail2ban_0.9.6-2_all.deb
dpkg -i --force-confmiss fail2ban_0.9.6-2_all.deb

(puis les deux autres commandes)

root@XXX:~# yunohost service status fail2ban
active: active

Parfait :wink: Merci !
Si tu as une idée pour Rainloop je suis preneur. Eventuellement désinstaller et réinstaller l’application ? A condition que cela n’efface pas la configuration et les mails.

Hmmm je sais pas trop, tu peux préciser quand/comment l’erreur apparait ? :s

Sinon oui, réinstaller peut peut-être régler le probleme. Ca gardera les mails mais potentiellement ca supprimera quelques configuration de rainloop…

Tout simplement, lorsque je clique sur l’icône Rainloop depuis la page d’accueil du serveur, au lieu de me connecter directement, cela affiche la page de connexion de Rainloop. Lorsque je valide identifiant + mot de passe, Rainloop affiche un message d’erreur “serveur injoignable”.

Je ne sais pas trop quels logs pourraient m’aider, mais dans /var/log/mail.log, depuis la migration je note un message d’erreur récurrent :

dovecot: imap-login: Fatal: Invalid ssl_protocols setting: Unknown protocol ‘SSLv2’

1 Like

Arf oui en effet. (Btw merci pour l’explication claire de problème / contexte, ces jours-ci c’est difficile d’avoir des utilisateurs qui expliquent aussi clairement ce qu’il se passe …)

il Il faut peut-être que tu forces la mise à jour de dovecot.

Tu peux normalement voir si tu as fait des modifications manuelles avec :

yunohost service regen-conf dovecot --dry-run -d

Si les différences ne semblent pas importante (c’est très subjectif et technique…) tu peux forcer la regen avec :

yunohost service regen-conf dovecot --force

Voici le résultat de la commande :

root@XXX:~# yunohost service regen-conf dovecot --dry-run -d
Success! The configuration would have been updated for service ‘dovecot’
dovecot:
applied:
/etc/dovecot/dovecot.conf:
diff: @@ -16,7 +16,7 @@
ssl = yes
ssl_cert = </etc/yunohost/certs/XXX.fr/crt.pem
ssl_key = </etc/yunohost/certs/XXX.fr/key.pem
-ssl_protocols = !SSLv2 !SSLv3
+ssl_protocols = !SSLv3

passdb {
args = /etc/dovecot/dovecot-ldap.conf
status: updated
pending:

Qu’en penses-tu ? Merci !

Ah mais autant pour moi, on a oublié la suite de la résolution du problème plus général (j’aide un peu 3 personne en meme temps alors je m’emele les pinceaux :confused: )

Si j’ai bien suivi, tu es toujours dans un état intermédiaire (i.e. yunohost --version devrait te dire que tu es encore en 2.7).

Donc il faudrait relancer la migration avec yunohost migrations migrate (+ le --accept-disclaimer)

Non moi je suis bien passé en V3 (enfin il semblerait) :

root@XXX:~# yunohost --version
yunohost:
repo: stable
version: 3.0.0.1
yunohost-admin:
repo: stable
version: 3.0.0
moulinette:
repo: stable
version: 3.0.0
ssowat:
repo: stable
version: 3.0.0

:wink:

Hmmmm okay :thinking:

Bon dans ce cas peut-être qu’il faut juste lancer un yunohost service regen-conf, pas sur de savoir pourquoi il n’a pas été lancé pendant la mise à jour :thinking:

Excellent ! C’était bien la bonne commande à passer. Le problème est résolu.

Un grand merci à toi !

Si tu veux que je te transmette certains logs pour essayer de comprendre d’où vient le problème de base, n’hésite pas !

1 Like

Bonjour,
j’ai également ce message
La migration 3 migrate_to_stretch a échoué avec l’exception [Errno 2] No such file or directory: ‘/etc/fail2ban/filter.d/yunohost.conf’, annulation

et la commande
cp -r /etc/fail2ban.old /etc/fail2ban
ne change rien :confused:

sachant que:

yunohost --version
yunohost:
repo: now
version: 2.7.14.5
yunohost-admin:
repo: now
version: 2.7.14
moulinette:
repo: now
version: 2.7.14
ssowat:
repo: now
version: 2.7.14

et

lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.5 (stretch)
Release:	9.5
Codename:	stretch

et (apt upgrade ne fait la mise à jour de ces paquets)

**apt list --upgradable**
En train de lister... Fait
moulinette/stable 3.2.0 all [upgradable from: 2.7.14]
ssowat/stable 3.2.0 all [upgradable from: 2.7.14]
yunohost/stable 3.2.1 all [upgradable from: 2.7.14.5]
yunohost-admin/stable 3.2.1 all [upgradable from: 2.7.14]

que dois-je faire pour poursuivre la migration ?

Bonsoir @Wiilly ,

As-tu essayer la commande suivante :

apt dist-upgrade

ppr

bien sûr
mais ça ne fonctionne pas

apt dist-upgrade
Lecture des listes de paquets… Fait
Construction de l’arbre des dépendances
Lecture des informations d’état… Fait
Calcul de la mise à jour… Fait
Les paquets suivants ont été conservés :
moulinette ssowat yunohost yunohost-admin
0 mis à jour, 0 nouvellement installés, 0 à enlever et 4 non mis à jour.

:confused: