Help with fail2ban and application

,

Hello all,
thanks for the great apps and help. I was able to have my own space on the web.
I’m hosting my yuno on a kimsufi and I have a small problem of my own with fail2ban and yunohost.
I installed yunohost and some application (nextcloud,wiki,etc…) and I decided to modify fai2ban configuration . i added the permanent ban solution (even at a restart). it’s working fine but when I try to upgrade yuno it fail because fail2ban use too much time for the command sysctl fail2ban restart.
Do you if there is a workaround (sysctl fail2ban stop and sysctl fail2ban start take less time)?
I know this not realy a yuno problem but if someone could help it would be great :slight_smile:

My YunoHost server

Hardware: kimsufi ks7
YunoHost version: 3.8.4.8 (but problem is present on all version )
I have access to my server : Through SSH | through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : yes
If yes, please explain:
fail2ban permanent-persistent-bans/

Description of my issue

upgrade all application

[Error] Upgrade failed.
/usr/share/yunohost/helpers.d/logging: line 20: message: unbound variable
Jun 16 22:29:23 systemd[1]: Reload failed for Fail2Ban Service.
Jun 16 22:29:23 systemd[1]: fail2ban.service: Reload operation timed out. Killing reload process.
Jun 16 22:27:53 systemd[1]: Reloading Fail2Ban Service.
Jun 16 22:22:22 systemd[1]: Reloaded Fail2Ban Service.
Jun 16 22:22:00 systemd[1]: Reloading Fail2Ban Service.
Jun 16 22:21:59 systemd[1]: Started Fail2Ban Service.
Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting in daemon mode
Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting Fail2ban v0.9.6
[Error] Jun 16 22:21:38 systemd[1]: Starting Fail2Ban Service...
See "systemctl status fail2ban.service" and "journalctl -xe" for details.
Job for fail2ban.service failed.

You shared only an extract of the log where the issue happens … Can you please provide the full log, otherwise we have no context to understand what’s happening …

could you tell me to upload the log ?
if i copy/paste it say too much caracter if i upload the file it say i don’t have the right :frowning: :pensive:
thnaks for the help

Bonjour,

yunohost embarque la version 0.9.6 de Fail2Ban et le tutoriel que tu as mis en lien est obsolète, il concerne uniquement les versions antérieures à 0.9. Depuis la version 0.9, seul le bantime = -1 est suffisant. Commence déjà par annuler les autres modifications que tu aurais pu faire dans le fichier action.d/iptables-multiport.conf et relance F2B avec:

yunohost service restart fail2ban

Done but always the same problem :frowning:

2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + ynh_handle_getopts_args --service_name=fail2ban --action=reload ‘–line_match=(Started|Reloaded) Fail2Ban Service’ --log_path=systemd
2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + set +o xtrace
2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + service_name=fail2ban
2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + action=reload
2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + line_match=’(Started|Reloaded) Fail2Ban Service’
2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + length=20
2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + log_path=systemd
2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + timeout=300
2020-06-16 22:27:53,828 DEBUG yunohost.hook - [18416.7] + [[ -n (Started|Reloaded) Fail2Ban Service ]]
2020-06-16 22:27:53,829 DEBUG yunohost.hook - [18416.7] ++ mktemp
2020-06-16 22:27:53,829 DEBUG yunohost.hook - [18416.7] + local templog=/tmp/tmp.5iQ5ONEdP0
2020-06-16 22:27:53,829 DEBUG yunohost.hook - [18416.7] + ‘[’ systemd == systemd ‘]’
2020-06-16 22:27:53,829 DEBUG yunohost.hook - [18416.7] + local pid_tail=27340
2020-06-16 22:27:53,829 DEBUG yunohost.hook - [18416.7] + ‘[’ reload == reload ‘]’
2020-06-16 22:27:53,829 DEBUG yunohost.hook - [18416.7] + action=reload-or-restart
2020-06-16 22:27:53,829 DEBUG yunohost.hook - [18416.7] + journalctl --unit=fail2ban --follow --since=-0 --quiet
2020-06-16 22:27:53,829 DEBUG yunohost.hook - [18416.7] + systemctl reload-or-restart fail2ban
2020-06-16 22:29:23,912 DEBUG yunohost.hook - [18416.7] + ynh_exec_err journalctl --quiet --no-hostname --no-pager --lines=20 --unit=fail2ban
2020-06-16 22:29:23,912 WARNING yunohost.hook - [18416.7] Job for fail2ban.service failed.
2020-06-16 22:29:23,913 DEBUG yunohost.hook - [18416.7] ++ eval journalctl --quiet --no-hostname --no-pager --lines=20 --unit=fail2ban
2020-06-16 22:29:23,913 WARNING yunohost.hook - [18416.7] See “systemctl status fail2ban.service” and “journalctl -xe” for details.
2020-06-16 22:29:23,913 DEBUG yunohost.hook - [18416.7] +++ journalctl --quiet --no-hostname --no-pager --lines=20 --unit=fail2ban
2020-06-16 22:29:23,914 WARNING yunohost.hook - [18416.7] [Error] Jun 16 22:21:38 systemd[1]: Starting Fail2Ban Service…
2020-06-16 22:29:23,914 DEBUG yunohost.hook - [18416.7] + ynh_print_err ‘Jun 16 22:21:38 systemd[1]: Starting Fail2Ban Service…
2020-06-16 22:29:23,914 WARNING yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting Fail2ban v0.9.6
2020-06-16 22:29:23,915 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting Fail2ban v0.9.6
2020-06-16 22:29:23,915 WARNING yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting in daemon mode
2020-06-16 22:29:23,916 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting in daemon mode
2020-06-16 22:29:23,916 WARNING yunohost.hook - [18416.7] Jun 16 22:21:59 systemd[1]: Started Fail2Ban Service.
2020-06-16 22:29:23,916 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:59 systemd[1]: Started Fail2Ban Service.
2020-06-16 22:29:23,917 WARNING yunohost.hook - [18416.7] Jun 16 22:22:00 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,917 DEBUG yunohost.hook - [18416.7] Jun 16 22:22:00 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,917 WARNING yunohost.hook - [18416.7] Jun 16 22:22:22 systemd[1]: Reloaded Fail2Ban Service.
2020-06-16 22:29:23,918 DEBUG yunohost.hook - [18416.7] Jun 16 22:22:22 systemd[1]: Reloaded Fail2Ban Service.
2020-06-16 22:29:23,918 WARNING yunohost.hook - [18416.7] Jun 16 22:27:53 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,918 DEBUG yunohost.hook - [18416.7] Jun 16 22:27:53 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,919 WARNING yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: fail2ban.service: Reload operation timed out. Killing reload process.
2020-06-16 22:29:23,919 DEBUG yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: fail2ban.service: Reload operation timed out. Killing reload process.
2020-06-16 22:29:23,919 WARNING yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: Reload failed for Fail2Ban Service.
2020-06-16 22:29:23,920 DEBUG yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: Reload failed for Fail2Ban Service.’
2020-06-16 22:29:23,920 WARNING yunohost.hook - [18416.7] /usr/share/yunohost/helpers.d/logging: line 20: message: unbound variable
2020-06-16 22:29:23,920 DEBUG yunohost.hook - [18416.7] + local legacy_args=m
2020-06-16 22:29:23,921 DEBUG yunohost.hook - [18416.7] + args_array=([m]=message=)
2020-06-16 22:29:23,921 DEBUG yunohost.hook - [18416.7] + local -A args_array
2020-06-16 22:29:23,921 DEBUG yunohost.hook - [18416.7] + local message
2020-06-16 22:29:23,921 DEBUG yunohost.hook - [18416.7] + ynh_handle_getopts_args ‘Jun 16 22:21:38 systemd[1]: Starting Fail2Ban Service…
2020-06-16 22:29:23,921 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting Fail2ban v0.9.6
2020-06-16 22:29:23,922 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting in daemon mode
2020-06-16 22:29:23,922 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:59 systemd[1]: Started Fail2Ban Service.
2020-06-16 22:29:23,922 DEBUG yunohost.hook - [18416.7] Jun 16 22:22:00 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,922 DEBUG yunohost.hook - [18416.7] Jun 16 22:22:22 systemd[1]: Reloaded Fail2Ban Service.
2020-06-16 22:29:23,922 DEBUG yunohost.hook - [18416.7] Jun 16 22:27:53 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,923 DEBUG yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: fail2ban.service: Reload operation timed out. Killing reload process.
2020-06-16 22:29:23,923 DEBUG yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: Reload failed for Fail2Ban Service.’
2020-06-16 22:29:23,923 DEBUG yunohost.hook - [18416.7] + set +o xtrace
2020-06-16 22:29:23,923 DEBUG yunohost.hook - [18416.7] + echo ‘! Helper used in legacy mode !’
2020-06-16 22:29:23,924 DEBUG yunohost.hook - [18416.7] + set +x
2020-06-16 22:29:23,924 DEBUG yunohost.hook - [18416.7] + ynh_print_log ‘[Error] Jun 16 22:21:38 systemd[1]: Starting Fail2Ban Service…
2020-06-16 22:29:23,924 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting Fail2ban v0.9.6
2020-06-16 22:29:23,924 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting in daemon mode
2020-06-16 22:29:23,924 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:59 systemd[1]: Started Fail2Ban Service.
2020-06-16 22:29:23,925 DEBUG yunohost.hook - [18416.7] Jun 16 22:22:00 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,925 DEBUG yunohost.hook - [18416.7] Jun 16 22:22:22 systemd[1]: Reloaded Fail2Ban Service.
2020-06-16 22:29:23,925 DEBUG yunohost.hook - [18416.7] Jun 16 22:27:53 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,925 DEBUG yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: fail2ban.service: Reload operation timed out. Killing reload process.
2020-06-16 22:29:23,926 DEBUG yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: Reload failed for Fail2Ban Service.’
2020-06-16 22:29:23,926 DEBUG yunohost.hook - [18416.7] + echo -e ‘[Error] Jun 16 22:21:38 systemd[1]: Starting Fail2Ban Service…
2020-06-16 22:29:23,926 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting Fail2ban v0.9.6
2020-06-16 22:29:23,926 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:51 fail2ban-client[723]: 2020-06-16 22:21:51,400 fail2ban.server [1018]: INFO Starting in daemon mode
2020-06-16 22:29:23,926 DEBUG yunohost.hook - [18416.7] Jun 16 22:21:59 systemd[1]: Started Fail2Ban Service.
2020-06-16 22:29:23,927 DEBUG yunohost.hook - [18416.7] Jun 16 22:22:00 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,927 DEBUG yunohost.hook - [18416.7] Jun 16 22:22:22 systemd[1]: Reloaded Fail2Ban Service.
2020-06-16 22:29:23,927 DEBUG yunohost.hook - [18416.7] Jun 16 22:27:53 systemd[1]: Reloading Fail2Ban Service.
2020-06-16 22:29:23,927 DEBUG yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: fail2ban.service: Reload operation timed out. Killing reload process.
2020-06-16 22:29:23,928 DEBUG yunohost.hook - [18416.7] Jun 16 22:29:23 systemd[1]: Reload failed for Fail2Ban Service.’
2020-06-16 22:29:23,928 DEBUG yunohost.hook - [18416.7] + ‘[’ -e systemd ‘]’
2020-06-16 22:29:23,928 DEBUG yunohost.hook - [18416.7] + ynh_die
2020-06-16 22:29:23,928 DEBUG yunohost.hook - [18416.7] + local legacy_args=mc
2020-06-16 22:29:23,928 DEBUG yunohost.hook - [18416.7] + args_array=([m]=message= [c]=ret_code=)
2020-06-16 22:29:23,929 DEBUG yunohost.hook - [18416.7] + local -A args_array
2020-06-16 22:29:23,929 DEBUG yunohost.hook - [18416.7] + local message
2020-06-16 22:29:23,929 DEBUG yunohost.hook - [18416.7] + local ret_code
2020-06-16 22:29:23,929 DEBUG yunohost.hook - [18416.7] + ynh_handle_getopts_args
2020-06-16 22:29:23,929 DEBUG yunohost.hook - [18416.7] + set +o xtrace
2020-06-16 22:29:23,930 DEBUG yunohost.hook - [18416.7] + ret_code=1
2020-06-16 22:29:23,930 DEBUG yunohost.hook - [18416.7] ++ ynh_exit_properly
2020-06-16 22:29:23,930 DEBUG yunohost.hook - [18416.7] ++ local exit_code=1
2020-06-16 22:29:23,930 DEBUG yunohost.hook - [18416.7] ++ ‘[’ 1 -eq 0 ‘]’
2020-06-16 22:29:23,931 DEBUG yunohost.hook - [18416.7] ++ trap ‘’ EXIT
2020-06-16 22:29:23,931 DEBUG yunohost.hook - [18416.7] ++ set +o errexit
2020-06-16 22:29:23,931 DEBUG yunohost.hook - [18416.7] ++ set +o nounset
2020-06-16 22:29:23,931 DEBUG yunohost.hook - [18416.7] ++ sleep 0.5
2020-06-16 22:29:24,432 DEBUG yunohost.hook - [18416.7] ++ type -t ynh_clean_setup
2020-06-16 22:29:24,433 WARNING yunohost.hook - [18416.7] [Error] Upgrade failed.
2020-06-16 22:29:24,433 DEBUG yunohost.hook - [18416.7] ++ ynh_clean_setup
2020-06-16 22:29:24,434 DEBUG yunohost.hook - [18416.7] ++ ynh_exec_warn_less ynh_secure_remove --file=/tmp/owncloud_post_migration.sh
2020-06-16 22:29:24,434 DEBUG yunohost.hook - [18416.7] ++ eval ynh_secure_remove --file=/tmp/owncloud_post_migration.sh
2020-06-16 22:29:24,434 DEBUG yunohost.hook - [18416.7] +++ ynh_secure_remove --file=/tmp/owncloud_post_migration.sh
2020-06-16 22:29:24,435 DEBUG yunohost.hook - [18416.7] +++ local legacy_args=f
2020-06-16 22:29:24,435 DEBUG yunohost.hook - [18416.7] +++ args_array=([f]=file=)
2020-06-16 22:29:24,435 DEBUG yunohost.hook - [18416.7] +++ local -A args_array
2020-06-16 22:29:24,436 DEBUG yunohost.hook - [18416.7] +++ local file
2020-06-16 22:29:24,436 DEBUG yunohost.hook - [18416.7] +++ ynh_handle_getopts_args --file=/tmp/owncloud_post_migration.sh
2020-06-16 22:29:24,436 DEBUG yunohost.hook - [18416.7] +++ set +o xtrace
2020-06-16 22:29:24,437 DEBUG yunohost.hook - [18416.7] +++ local ‘forbidden_path= /var/www /home/yunohost.app’
2020-06-16 22:29:24,437 DEBUG yunohost.hook - [18416.7] +++ ‘[’ 1 -ge 2 ‘]’
2020-06-16 22:29:24,437 DEBUG yunohost.hook - [18416.7] +++ [[ -z /tmp/owncloud_post_migration.sh ]]
2020-06-16 22:29:24,437 DEBUG yunohost.hook - [18416.7] +++ [[ /var/www /home/yunohost.app =~ /tmp/owncloud_post_migration.sh ]]
2020-06-16 22:29:24,438 DEBUG yunohost.hook - [18416.7] +++ [[ /tmp/owncloud_post_migration.sh =~ ^/[[:alnum:]]+$ ]]
2020-06-16 22:29:24,438 DEBUG yunohost.hook - [18416.7] +++ [[ h = / ]]
2020-06-16 22:29:24,438 DEBUG yunohost.hook - [18416.7] +++ ‘[’ -e /tmp/owncloud_post_migration.sh ‘]’
2020-06-16 22:29:24,438 DEBUG yunohost.hook - [18416.7] +++ ynh_print_info ‘–message=’’’/tmp/owncloud_post_migration.sh’’’ wasn’’‘t deleted because it doesn’’‘t exist.’
2020-06-16 22:29:24,439 DEBUG yunohost.hook - [18416.7] +++ local legacy_args=m
2020-06-16 22:29:24,439 DEBUG yunohost.hook - [18416.7] +++ args_array=([m]=message=)
2020-06-16 22:29:24,439 DEBUG yunohost.hook - [18416.7] +++ local -A args_array
2020-06-16 22:29:24,440 DEBUG yunohost.hook - [18416.7] +++ local message
2020-06-16 22:29:24,440 DEBUG yunohost.hook - [18416.7] +++ ynh_handle_getopts_args ‘–message=’’’/tmp/owncloud_post_migration.sh’’’ wasn’’‘t deleted because it doesn’’‘t exist.’
2020-06-16 22:29:24,440 DEBUG yunohost.hook - [18416.7] +++ set +o xtrace
2020-06-16 22:29:24,441 DEBUG yunohost.hook - [18416.7] +++ echo ‘’’’/tmp/owncloud_post_migration.sh’’’ wasn’’‘t deleted because it doesn’’‘t exist.’
2020-06-16 22:29:24,441 DEBUG yunohost.hook - [18416.7] ++ ynh_restore_upgradebackup
2020-06-16 22:29:24,441 DEBUG yunohost.hook - [18416.7] ++ ynh_print_err ‘–message=Upgrade failed.’
2020-06-16 22:29:24,441 DEBUG yunohost.hook - [18416.7] ++ local legacy_args=m
2020-06-16 22:29:24,442 DEBUG yunohost.hook - [18416.7] ++ args_array=([m]=message=)
2020-06-16 22:29:24,442 DEBUG yunohost.hook - [18416.7] ++ local -A args_array
2020-06-16 22:29:24,442 DEBUG yunohost.hook - [18416.7] ++ local message
2020-06-16 22:29:24,442 DEBUG yunohost.hook - [18416.7] ++ ynh_handle_getopts_args ‘–message=Upgrade failed.’
2020-06-16 22:29:24,443 DEBUG yunohost.hook - [18416.7] ++ set +o xtrace
2020-06-16 22:29:24,443 DEBUG yunohost.hook - [18416.7] ++ ynh_print_log ‘[Error] Upgrade failed.’
2020-06-16 22:29:24,443 DEBUG yunohost.hook - [18416.7] ++ echo -e ‘[Error] Upgrade failed.’
2020-06-16 22:29:24,444 DEBUG yunohost.hook - [18416.7] ++ local app_bck=nextcloud
2020-06-16 22:29:24,444 DEBUG yunohost.hook - [18416.7] ++ NO_BACKUP_UPGRADE=0
2020-06-16 22:29:24,444 DEBUG yunohost.hook - [18416.7] ++ ‘[’ 0 -eq 0 ‘]’
2020-06-16 22:29:24,444 DEBUG yunohost.hook - [18416.7] ++ yunohost backup list
2020-06-16 22:29:24,445 DEBUG yunohost.hook - [18416.7] ++ grep --quiet nextcloud-pre-upgrade1
2020-06-16 22:29:24,746 DEBUG yunohost.hook - [18416.7] ++ yunohost app remove nextcloud
2020-06-16 22:29:24,746 INFO yunohost.hook - [18416.7] ‘/tmp/owncloud_post_migration.sh’ wasn’t deleted because it doesn’t exist.
2020-06-16 22:29:24,947 DEBUG yunohost.hook - [18416.7] Removing the app ‘nextcloud’…

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