Failed to upgrade WordPress - Source path '/etc/fail2ban/...' does not exist (+thanks YNH !)

bug
fr

#1

:uk:/:us: english

My YunoHost server

Hardware: VPS Gandi
YunoHost version: 3.5.2.1

Description of my problem

Hi all,
After upgrading to latest YNH version, I tried to upgrade WordPress without success:

https://paste.yunohost.org/irevuyuzes.bash

It seems that the problem is:
Source path '\''/etc/fail2ban/filter.d/wordpress.conf'\'' does not exist

An error message in web admin interface says:
/usr/share/yunohost/helpers.d/filesystem: line 80: SRC_PATH: unbound variable

I checked the script /usr/share/yunohost/helpers.d/filesystem on the file system and we can see:

# ==============================================================================
# Format correctly source and destination paths
# ==============================================================================
# Be sure the source path is not empty
[[ -e "${src_path}" ]] || {
echo "Source path '${src_path}' does not exist" >&2
if [ "$not_mandatory" == "0" ]
then
        echo "Source path '${SRC_PATH}' does not exist" >&2
        # This is a temporary fix for fail2ban config files missing after the migration to stretch.
        if echo "${src_path}" | grep --quiet "/etc/fail2ban"
        then
                touch "${src_path}"
                echo "The missing file will be replaced by a dummy one for the backup !!!" >&2
        else
                return 1
        fi
else
        return 0
fi
}

It seems that the first ifcondition is not verified, maybe a problem with $not_mandatory variable ?
So I’ve created the two missing files:

$ sudo touch /etc/fail2ban/jail.d/wordpress.conf
$ sudo touch /etc/fail2ban/filter.d/wordpress.conf

and relaunch the upgrade and everything work fine.
Hope it’s useful.

Thanks again to all YNH community ! I run 2 VPS servers with 25 users since 2015 and improvements are incredibles, and it just works :smile:


:fr: français

Mon serveur Yunohost

Hardware: VPS Gandi
YunoHost version: 3.5.2.1

Description de mon problème

Salut,
Après avoir mis à jour vers la dernière version de YNH, j’ai essayé de mettre à jour WordPress sans succès :

https://paste.yunohost.org/irevuyuzes.bash

Le problème semble être :
Source path '\''/etc/fail2ban/filter.d/wordpress.conf'\'' does not exist

Un message d’erreur dans l’interface d’administration web :
/usr/share/yunohost/helpers.d/filesystem: line 80: SRC_PATH: unbound variable

Extrait du script /usr/share/yunohost/helpers.d/filesystem sur le système de fichiers :

# ==============================================================================
# Format correctly source and destination paths
# ==============================================================================
# Be sure the source path is not empty
[[ -e "${src_path}" ]] || {
echo "Source path '${src_path}' does not exist" >&2
if [ "$not_mandatory" == "0" ]
then
        echo "Source path '${SRC_PATH}' does not exist" >&2
        # This is a temporary fix for fail2ban config files missing after the migration to stretch.
        if echo "${src_path}" | grep --quiet "/etc/fail2ban"
        then
                touch "${src_path}"
                echo "The missing file will be replaced by a dummy one for the backup !!!" >&2
        else
                return 1
        fi
else
        return 0
fi
}

Il semble que le script ne passe pas dans le premier if, un problème avec la variabel $not_mandatory ?
Du coup j’ai créé les fichiers à la main :

$ sudo touch /etc/fail2ban/jail.d/wordpress.conf
$ sudo touch /etc/fail2ban/filter.d/wordpress.conf

et relancé la mise à jour qui se passe bien.
En espérant que ce soit utile.

En tout cas encore un grand merci à toute la communauté ! J’utilise deux serveurs YNH en production avec 25 utilisateurs en tout depuis 2015 et le rythme des améliorations est ahurissant, et puis juste ça marche ! :smile:


#2

Thanks @lops, you did good by adding files with touch. The script should have done it without error, but there was a remaining of a SRC_PATH in uppercase…
I fixed it.