ashemsay / restic_ynh

A Restic package for YunoHost
GNU Affero General Public License v3.0
3 stars 9 forks source link

Install failed - /var/log/restic_backup_restic.err already exists #18

Closed tomdereub closed 2 years ago

tomdereub commented 3 years ago

Describe the bug

I wanted to re-install restic from scratch, but install failed :

2021-06-07 11:35:01,836: DEBUG - + '[' 1 -gt 0 ']'
2021-06-07 11:35:01,836: DEBUG - ++ echo -
2021-06-07 11:35:01,836: DEBUG - + '[' - '!=' - ']'
2021-06-07 11:35:01,836: DEBUG - + local 'customtee=tee --append'
2021-06-07 11:35:01,837: DEBUG - + '[' 0 -eq 1 ']'
2021-06-07 11:35:01,837: DEBUG - + '[' -n /var/log/restic_backup_restic.err ']'
2021-06-07 11:35:01,837: DEBUG - + '[' '!' -f --logfile=/var/log/restic_backup_restic.err ']'
2021-06-07 11:35:01,837: DEBUG - ++ echo err
2021-06-07 11:35:01,837: DEBUG - + '[' err '!=' log ']'
2021-06-07 11:35:01,837: DEBUG - + local 'logfile=/var/log/restic_backup_restic.err/*.log'
2021-06-07 11:35:01,837: DEBUG - + local su_directive=
2021-06-07 11:35:01,837: DEBUG - + [[ -n '' ]]
2021-06-07 11:35:01,838: DEBUG - + cat
2021-06-07 11:35:01,839: DEBUG - ++ dirname '/var/log/restic_backup_restic.err/*.log'
2021-06-07 11:35:01,840: DEBUG - + mkdir --parents /var/log/restic_backup_restic.err
2021-06-07 11:35:01,841: WARNING - mkdir: impossible de créer le répertoire « /var/log/restic_backup_restic.err »: Le fichier existe
2021-06-07 11:35:01,842: DEBUG - + ynh_exit_properly
2021-06-07 11:35:01,842: DEBUG - + local exit_code=1
2021-06-07 11:35:01,843: DEBUG - + rm -rf /var/cache/yunohost/download/
2021-06-07 11:35:01,843: DEBUG - + '[' 1 -eq 0 ']'
2021-06-07 11:35:01,844: DEBUG - + trap '' EXIT
2021-06-07 11:35:01,844: DEBUG - + set +o errexit
2021-06-07 11:35:01,844: DEBUG - + set +o nounset
2021-06-07 11:35:01,844: DEBUG - + sleep 0.5
2021-06-07 11:35:02,346: DEBUG - + type -t ynh_clean_setup
2021-06-07 11:35:02,347: DEBUG - + exit 1
2021-06-07 11:35:03,349: ERROR - Impossible d’installer restic : Une erreur est survenue dans le script d’installation de l’application

Then I removed restic files from /var/log, and install has worked.

Context

Steps to reproduce

Install restic, use a bit, remove it, and try to install it again. Or just create a file : /var/log/restic_backup_restic.err.

Expected behavior

Install should be more robust, and don't stop just for a file already existing.

tomdereub commented 3 years ago

And it seems that /var/log/restic_backup_restic.err should be a file and not a directory, I get an error in the logs saying it's a directory.

tomdereub commented 2 years ago

I suggest to close this issue, it will probably be solved by this one : https://github.com/ashemsay/restic_ynh/issues/22.