Fail2ban error - unable to update or install anything

Bonjour à tous, et merci beaucoup pour cet outils qui permet à presque tous de devenir autonome !

Matériel: Raspberry Pi 4B ram 4Go à la maison
Version de YunoHost: 11.2.7
J’ai accès à mon serveur : En SSH et Par la webadmin
Êtes-vous dans un contexte particulier ou avez-vous effectué des modificiations particulières sur votre instance ? : oui
Je viens de créer mon serveur. Je suis donc en train d’installer les applications/services que j’aimerais héberger. ça a bug en pemier avec Lufi : https://paste.yunohost.org/raw/yovutiduwu
ensuite avec lstu : https://paste.yunohost.org/raw/bapumarale
puis depuis ajourd’hui fail2ban dans le diag ne marche plus. J’ai quand même essayé d’installer jitsy : https://paste.yunohost.org/raw/yepiqawola.

J’ai fait une authentification SSH avec un port avant.

J’ai déjà installé peertube, owntracks, nextcloud & dollibar

Description du problème

J’essaye donc juste d’installer les apps mentionnées ci-dessus + quelques une autres dans un premier temps. Création de sous-domaines, installation des certificats. J’ai tenté de redémarrer fail2ban, sans succès.
log du diagnostique
https://paste.yunohost.org/raw/uditamejub
J’ai du coup sorti le log via la commande SSH :

Fail2ban Log
  - Traceback (most recent call last):
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 653, in __flushBan
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 637, in flush
  -     return self._executeOperation('<actionflush>', 'flushing', family=family, afterExec=_afterFlush)
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 476, in _executeOperation
  -     raise RuntimeError("Error %s action %s/%s: %r" % (operation, self._jail, self._name, err))
  - RuntimeError: Error flushing action Jail('recidive')/iptables-allports: 'Script error'
  - 
  - During handling of the above exception, another exception occurred:
  - 
  - Traceback (most recent call last):
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/jailthread.py", line 69, in run_with_except_hook
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 368, in run
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 666, in __flushBan
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 690, in consistencyCheck
  -     if started and not self._invariantCheck(family, beforeRepair):
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 916, in _invariantCheck
  -     if beforeRepair and not beforeRepair():
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 663, in _beforeRepair
  - AttributeError: 'Actions' object has no attribute '_logSys'
  - 2023-12-01 19:54:20,699 fail2ban.jail           [563]: INFO    Jail 'recidive' stopped
  - 2023-12-01 19:54:20,703 fail2ban.utils          [563]: ERROR   7f883f8f10 -- exec: iptables -w -n -L INPUT | grep -q 'f2b-pam-generic[ \t]'
  - 2023-12-01 19:54:20,703 fail2ban.utils          [563]: ERROR   7f883f8f10 -- returned 1
  - 2023-12-01 19:54:20,703 fail2ban                [563]: CRITICAL Unhandled exception in Fail2Ban:
  - Traceback (most recent call last):
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 653, in __flushBan
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 637, in flush
  -     return self._executeOperation('<actionflush>', 'flushing', family=family, afterExec=_afterFlush)
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 476, in _executeOperation
  -     raise RuntimeError("Error %s action %s/%s: %r" % (operation, self._jail, self._name, err))
  - RuntimeError: Error flushing action Jail('pam-generic')/iptables-allports: 'Script error'
  - 
  - During handling of the above exception, another exception occurred:
  - 
  - Traceback (most recent call last):
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/jailthread.py", line 69, in run_with_except_hook
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 368, in run
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 666, in __flushBan
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 690, in consistencyCheck
  -     if started and not self._invariantCheck(family, beforeRepair):
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 916, in _invariantCheck
  -     if beforeRepair and not beforeRepair():
  -   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 663, in _beforeRepair
  - AttributeError: 'Actions' object has no attribute '_logSys'
  - 2023-12-01 19:54:20,708 fail2ban.jail           [563]: INFO    Jail 'pam-generic' stopped
  - 2023-12-01 19:54:20,709 fail2ban.jail           [563]: INFO    Jail 'yunohost' stopped
  - 2023-12-01 19:54:20,709 fail2ban.jail           [563]: INFO    Jail 'sasl' stopped
  - 2023-12-01 19:54:20,709 fail2ban.jail           [563]: INFO    Jail 'nextcloud' stopped
  - 2023-12-01 19:54:20,710 fail2ban.database       [563]: INFO    Connection to database closed.
  - 2023-12-01 19:54:20,711 fail2ban.server         [563]: INFO    Exiting Fail2ban
journalctl: 
  - -- Journal begins at Tue 2022-12-06 18:45:10 GMT, ends at Sat 2023-12-02 08:36:00 GMT. --
  - Dec 01 19:54:21 fail2ban-server[563]:     raise RuntimeError("Error %s action %s/%s: %r" % (operation, self._jail, self._name, err))
  - Dec 01 19:54:21 fail2ban-server[563]: RuntimeError: Error flushing action Jail('pam-generic')/iptables-allports: 'Script error'
  - Dec 01 19:54:21 fail2ban-server[563]: During handling of the above exception, another exception occurred:
  - Dec 01 19:54:21 fail2ban-server[563]: Traceback (most recent call last):
  - Dec 01 19:54:21 fail2ban-server[563]:   File "/usr/lib/python3/dist-packages/fail2ban/server/jailthread.py", line 69, in run_with_except_hook
  - Dec 01 19:54:21 fail2ban-server[563]:   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 368, in run
  - Dec 01 19:54:21 fail2ban-server[563]:   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 666, in __flushBan
  - Dec 01 19:54:21 fail2ban-server[563]:   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 690, in consistencyCheck
  - Dec 01 19:54:21 fail2ban-server[563]:     if started and not self._invariantCheck(family, beforeRepair):
  - Dec 01 19:54:21 fail2ban-server[243726]: 2023-12-01 19:54:21,161 fail2ban                [243726]: ERROR   No module named 'fail2ban.server.server'
  - Dec 01 19:54:20 systemd[1]: fail2ban.service: Consumed 2min 59.760s CPU time.
  - Dec 01 19:54:21 fail2ban-server[563]:   File "/usr/lib/python3/dist-packages/fail2ban/server/action.py", line 916, in _invariantCheck
  - Dec 01 19:54:21 fail2ban-server[563]:     if beforeRepair and not beforeRepair():
  - Dec 01 19:54:21 fail2ban-server[563]:   File "/usr/lib/python3/dist-packages/fail2ban/server/actions.py", line 663, in _beforeRepair
  - Dec 01 19:54:21 fail2ban-server[563]: AttributeError: 'Actions' object has no attribute '_logSys'
  - Dec 01 19:54:20 systemd[1]: Starting Fail2Ban Service...
  - Dec 01 19:54:20 systemd[1]: Started Fail2Ban Service.
  - Dec 01 19:54:21 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
  - Dec 01 19:54:21 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
  - Dec 01 19:54:36 systemd[1]: Starting Fail2Ban Service...
  - Dec 01 19:54:36 systemd[1]: Started Fail2Ban Service.
  - Dec 01 19:54:36 fail2ban-server[243914]: 2023-12-01 19:54:36,968 fail2ban                [243914]: ERROR   No module named 'fail2ban.server.server'
  - Dec 01 19:54:37 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
  - Dec 01 19:54:37 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
  - Dec 01 19:55:09 systemd[1]: Starting Fail2Ban Service...
  - Dec 01 19:55:09 systemd[1]: Started Fail2Ban Service.
  - Dec 01 19:55:09 fail2ban-server[245846]: 2023-12-01 19:55:09,944 fail2ban                [245846]: ERROR   No module named 'fail2ban.server.server'
  - Dec 01 19:55:10 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
  - Dec 01 19:55:10 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
  - Dec 01 19:55:23 systemd[1]: Starting Fail2Ban Service...
  - Dec 01 19:55:23 systemd[1]: Started Fail2Ban Service.
  - Dec 01 19:55:23 fail2ban-server[246021]: 2023-12-01 19:55:23,551 fail2ban                [246021]: ERROR   No module named 'fail2ban.server.server'
  - Dec 01 19:55:23 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
  - Dec 01 19:55:23 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
  - Dec 02 07:21:55 systemd[1]: fail2ban.service: Unit cannot be reloaded because it is inactive.
  - Dec 02 07:22:08 systemd[1]: Starting Fail2Ban Service...
  - Dec 02 07:22:08 systemd[1]: Started Fail2Ban Service.
  - Dec 02 07:22:08 fail2ban-server[266599]: 2023-12-02 07:22:08,832 fail2ban                [266599]: ERROR   No module named 'fail2ban.server.server'
  - Dec 02 07:22:08 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
  - Dec 02 07:22:08 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
  - Dec 02 07:22:49 systemd[1]: Starting Fail2Ban Service...
  - Dec 02 07:22:49 systemd[1]: Started Fail2Ban Service.
  - Dec 02 07:22:50 fail2ban-server[266666]: 2023-12-02 07:22:50,249 fail2ban                [266666]: ERROR   No module named 'fail2ban.server.server'
  - Dec 02 07:22:50 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
  - Dec 02 07:22:50 systemd[1]: fail2ban.service: Failed with result 'exit-code'.
  - Dec 02 08:29:03 systemd[1]: Starting Fail2Ban Service...
  - Dec 02 08:29:03 systemd[1]: Started Fail2Ban Service.
  - Dec 02 08:29:04 fail2ban-server[270196]: 2023-12-02 08:29:04,199 fail2ban                [270196]: ERROR   No module named 'fail2ban.server.server'
  - Dec 02 08:29:04 systemd[1]: fail2ban.service: Main process exited, code=exited, status=255/EXCEPTION
  - Dec 02 08:29:04 systemd[1]: fail2ban.service: Failed with result 'exit-code'.```

Salut,

Il y a manifestement un soucis avec la jail pam-generic

Je tenterais de faire un yunohost tools regen-conf -nd pour voir ce que ça sort.

Si rien de probant, peut-être tenter une réinstallation de fail2ban ?

Je note aussi pas mal d’erreurs de compilation dans tes logs LSTU et LUFI. Il semble manquer des dépendances. Example :

2023-12-01 19:22:53,679: DEBUG - Dec 01 19:22:53 carton[193848]: Can'\''t locate Compress/Raw/Zlib.pm in @INC (you may need to install the Compress::Raw::Zlib module)

Problème avec perl ? => perl - Can't load '/Compress/Raw/Zlib/Zlib.so' - Stack Overflow

Chez moi j’ai ça :

# apt-cache policy perl
perl:
  Installed: 5.32.1-4+deb11u2

Note : Ton mail est aussi blacklisté sur spamhouse, pense à le faire débannir chez eux.

[ERROR] Votre IP ou domaine xx.xx.xx.xx est sur liste noire sur Spamhaus ZEN
  - La raison de la liste noire est : "https://www.spamhaus.org/query/ip/xx.xx.xx.xx"
  - Après avoir identifié la raison pour laquelle vous êtes répertorié sur cette liste et l'avoir corrigée, n'hésitez pas à demander le retrait de votre IP ou de votre domaine sur https://www.spamhaus.org/zen/

Salut Kit !

Merci beaucoup pour ta vitesse de réponse.
Pour spamhaus, je suis au courant, je l’ai fait. Je pensais que c’était compliqué ! Merci ! Je vais surement prendre un vpn dans tout les cas pour avoir un IPv6 et le reverse DNS. Aujourd’hui je ne peux envoyer de mail comme j’ai l’impression que mon port 25 ne s’ouvre pas, pourtant je l’ai bien débloqué dans le routeur.

Quant à Perl, et bien… Je ne sais pas exactement ce qu’est perl (langage de programmation) ni comment ça marche du coup. Mais j’ai fait les solutions du stack. Rien ne marche. Je suis allé voir dans /lib, et je n’ai pas de perl. J’ai fait la commande

perl:

et je n’ai effectivement pas de perl !

correction : j’ai fait une installation de perl, et :

apt install perl
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
perl is already the newest version (5.32.1-4+deb11u2).
perl set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 7 not upgraded.

bon hormis ce soucis que je n’arrive pas trop à comprendre, j’ai essayé de réinstaller fail2ban via ces commandes : https://www.malekal.com/resoudre-les-problemes-ou-erreurs-installation-de-paquet-dpkg/

Et j’ai oublié de le mentionné (puisque j’avais oublié !) mais il affichait ça dans le terminal quand j’installais les app :

log DPKG
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Calculating upgrade... Done
The following packages will be upgraded:
  firmware-atheros firmware-libertas firmware-misc-nonfree firmware-realtek locales ncurses-term rpi-eeprom
7 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/69.6 MB of archives.
After this operation, 8,734 kB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 58221 files and directories currently installed.)
Preparing to unpack .../0-locales_2.31-13+rpt2+rpi1+deb11u7_all.deb ...
Unpacking locales (2.31-13+rpt2+rpi1+deb11u7) over (2.31-13+rpt2+rpi1+deb11u5) ...
dpkg: error processing archive /tmp/apt-dpkg-install-YSV2Sa/0-locales_2.31-13+rpt2+rpi1+deb11u7_all.deb (--unpack):
 unable to stat './usr/share/i18n/charmaps/EBCDIC-AT-DE-A.gz' (which was about to be installed): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../1-ncurses-term_6.2+20201114-2+deb11u2_all.deb ...
Unpacking ncurses-term (6.2+20201114-2+deb11u2) over (6.2+20201114-2) ...
dpkg: error processing archive /tmp/apt-dpkg-install-YSV2Sa/1-ncurses-term_6.2+20201114-2+deb11u2_all.deb (--unpack):
 unable to stat './usr/share/terminfo/a/aaa-40' (which was about to be installed): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../2-firmware-atheros_1%3a20230210-5~bpo11+1+rpt2_all.deb ...
Unpacking firmware-atheros (1:20230210-5~bpo11+1+rpt2) over (1:20221012-1~bpo11+1+rpt1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-YSV2Sa/2-firmware-atheros_1%3a20230210-5~bpo11+1+rpt2_all.deb (--unpack):
 unable to stat './lib/firmware/qca/crbtfw21.tlv' (which was about to be installed): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../3-firmware-libertas_1%3a20230210-5~bpo11+1+rpt2_all.deb ...
Unpacking firmware-libertas (1:20230210-5~bpo11+1+rpt2) over (1:20221012-1~bpo11+1+rpt1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-YSV2Sa/3-firmware-libertas_1%3a20230210-5~bpo11+1+rpt2_all.deb (--unpack):
 unable to stat './lib/firmware/mrvl/pcie8997_wlan_v4.bin' (which was about to be installed): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../4-firmware-misc-nonfree_1%3a20230210-5~bpo11+1+rpt2_all.deb ...
Unpacking firmware-misc-nonfree (1:20230210-5~bpo11+1+rpt2) over (1:20221012-1~bpo11+1+rpt1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-YSV2Sa/4-firmware-misc-nonfree_1%3a20230210-5~bpo11+1+rpt2_all.deb (--unpack):
 unable to stat './lib/firmware/nvidia/ga102/acr/ucode_ahesasc.bin' (which was about to be installed): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../5-firmware-realtek_1%3a20230210-5~bpo11+1+rpt2_all.deb ...
Unpacking firmware-realtek (1:20230210-5~bpo11+1+rpt2) over (1:20221012-1~bpo11+1+rpt1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-YSV2Sa/5-firmware-realtek_1%3a20230210-5~bpo11+1+rpt2_all.deb (--unpack):
 unable to stat './lib/firmware/rtl_bt/rtl8192ee_fw.bin' (which was about to be installed): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Preparing to unpack .../6-rpi-eeprom_16.1-1_arm64.deb ...
Unpacking rpi-eeprom (16.1-1) over (14.0-1) ...
dpkg: error processing archive /tmp/apt-dpkg-install-YSV2Sa/6-rpi-eeprom_16.1-1_arm64.deb (--unpack):
 unable to stat './lib/firmware/raspberrypi/bootloader/beta/pieeprom-2022-04-26.bin' (which was about to be installed): Bad message
dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
Job for rpi-eeprom-update.service failed because the control process exited with error code.
See "systemctl status rpi-eeprom-update.service" and "journalctl -xe" for details.
Errors were encountered while processing:
 /tmp/apt-dpkg-install-YSV2Sa/0-locales_2.31-13+rpt2+rpi1+deb11u7_all.deb
 /tmp/apt-dpkg-install-YSV2Sa/1-ncurses-term_6.2+20201114-2+deb11u2_all.deb
 /tmp/apt-dpkg-install-YSV2Sa/2-firmware-atheros_1%3a20230210-5~bpo11+1+rpt2_all.deb
 /tmp/apt-dpkg-install-YSV2Sa/3-firmware-libertas_1%3a20230210-5~bpo11+1+rpt2_all.deb
 /tmp/apt-dpkg-install-YSV2Sa/4-firmware-misc-nonfree_1%3a20230210-5~bpo11+1+rpt2_all.deb
 /tmp/apt-dpkg-install-YSV2Sa/5-firmware-realtek_1%3a20230210-5~bpo11+1+rpt2_all.deb
 /tmp/apt-dpkg-install-YSV2Sa/6-rpi-eeprom_16.1-1_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

je ne sais pas ce que c’est, mais il semble que dpkg n’arrive à rien faire…

J’ai lancé la regen-conf, mais ça n’a rien changé, il n’y a pas eu de message d’erreur.

idée de quoi faire ?

Attention, pour fail2ban l’app yunohost crée des jails spécifiques (notamment la jail yunohost, je ne suis pas certain qu’une installation manuelle par défaut fasse de même.

Si ton serveur n’est pas encore en production, mieux vaut peut-être réinstaller Debian puis le package Yunohost afin de repartir sur de bonnes bases (je sais, ce n’est pas une solution, mais je ne connais pas les spécificités pour Raspberry Pi auto-hébergé). Perso, je fais mes install via root au lieu de sudo pour éviter les problèmes de droits (ce n’est pas forcément la bonne méthode pour autant).

Tu as seulement les applis sus-mentionnées d’installées ?

Bon… Trop tard pour fail2ban, soit je réparre, soit je fais ce que tu proposes (ce que je n’ai pas arrêté de faire dans le passé, raison pourquoi j’avais abandonné, c’était une des premières version de Yunohost).

Je pense que je vais repartir sur une installation clean, si ça fonctionne. Je n’ai comme tu le dis : que ces applis, oui !

Cependant, j’aimerais vraiment progresser en ligne de commande / lecteur et révision de code. Et si quelqu’un a ce soucis, ça serait cool que ça soit résolu ^^’

Merci pour ton aide !

Okay.

Je reviens sur ce sujet, puisque je viens de comprendre d’où mon problème vient. Je ne l’avais pas noté la première fois… Mais voici ce qu’il s’été passé en upgrade : https://paste.yunohost.org/raw/rosiputowa

J’ai donc fait

apt-get update 

et relancé une MAJ. Et tout s’est bien passé sans encombre.

Problème résolu ! Il faut vraiment que je sois plus méticuleux.

Toujours penser à mettre à jour avant de faire une installation :slight_smile:
Tu peux utiliser les commandes yunohost tools update puis yunohost tools upgrade pour mettre à jour les paquets system ou apps.

Pense à taguer le topic comme résolu (en cliquant sur la petite coche sous ton message précédent).

1 Like

On a trouvé mon problème réel !

Ma carte SD était un peu ancienne et faisait des erreurs d’écriture pour les mises à jour.

Belle journée !

1 Like

Je utilise la torte de framboise sans la micro SD, ça marche plus bien in cette manière. Pardon pour mon terrible français.

pas de besoin de s’excuser ! c’est très cool de parler Français déjà !

How are you doing without any SD card ?

Comment fais tu sans carte sd ?

1 Like

ça marche plus vite sans la micro SD, et c’est plus stable. Et quand j’ai besoin de repristiner le back-up c’est plus facile aussi.

Mais comment tu fais sans la carte SD ?
J’ai perso mon debian sur la SD, comment tu installes ?

1 Like

I just flash the rpi4 image directly to the SSD or HDD and plug it to the rpi4.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.