YunoHost-Apps / etherpad_mypads_ynh

Etherpad MyPads package for YunoHost
http://etherpad.org/
GNU General Public License v3.0
16 stars 13 forks source link

Backup script fail (and breaks the upgrade process) #54

Closed SiM closed 6 years ago

SiM commented 6 years ago

When I try to do a backup, it fails. (Same with webadmin and within the app upgrade process)

My YNH version is 3.2.1 and I have installed etherpad_mypads without mypads plugin.

Log :

yunohost backup create --apps etherpad_mypads --debug 117 DEBUG loading actions map namespace 'yunohost'
128 DEBUG extra parameter classes loaded: ['ask', 'password', 'required', 'pattern'] 129 DEBUG initializing base actions map parser for cli
129 DEBUG registering new callback action 'yunohost.utils.packages.ynh_packages_version' to ['-v', '--version']
179 DEBUG lock has been acquired
218 DEBUG loading python module yunohost.backup took 0.038s
218 INFO processing action [14002.1]: yunohost.backup.create with args={'description': None, 'apps': ['etherpad_mypads'], 'system': None, 'output_directory': None, 'methods': None, 'no_compress': F alse, 'name': None}
218 DEBUG custom hook folder not found for action 'backup' in /etc/yunohost/hooks.d/
220 DEBUG Lancement du script de sauvegarde de l'application « etherpad_mypads »...
226 DEBUG Exécution de la commande « sh -c YNH_APP_INSTANCE_NUMBER=1 YNH_CWD=/home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup YNH_STDINFO=/tmp/tmp9iVBWq/stdinfo YNH_BACKUP_CSV= /tmp/backupcsv_xDVOW9 YNH_BACKUP_DIR=/home/yunohost.backup/tmp/20180921-092612 YNH_APP_INSTANCE_NAME=etherpad_mypads YNH_APP_ID=etherpad_mypads YNH_APP_BACKUP_DIR=/home/yunohost.backup/tmp/20180921- 092612/apps/etherpad_mypads/backup BASH_XTRACEFD=7 /bin/bash -x "/tmp/backup_6yQgZi" /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup etherpad_mypads 7>&1 »...
226 DEBUG About to run the command '['sh', '-c', 'YNH_APP_INSTANCE_NUMBER=1 YNH_CWD=/home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup YNH_STDINFO=/tmp/tmp9iVBWq/stdinfo YNH_BACK UP_CSV=/tmp/backupcsv_xDVOW9 YNH_BACKUP_DIR=/home/yunohost.backup/tmp/20180921-092612 YNH_APP_INSTANCE_NAME=etherpad_mypads YNH_APP_ID=etherpad_mypads YNH_APP_BACKUP_DIR=/home/yunohost.backup/tmp/20 180921-092612/apps/etherpad_mypads/backup BASH_XTRACEFD=7 /bin/bash -x "/tmp/backup_6yQgZi" /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup etherpad_mypads 7>&1']'
234 DEBUG + '[' '!' -e _common.sh ']'
235 DEBUG + cp ../settings/scripts/_common.sh ./_common.sh
235 DEBUG + chmod a+rx _common.sh
235 DEBUG + source _common.sh
235 DEBUG ++ n_install_dir=/opt/node_n
235 DEBUG ++ node_version_path=/opt/node_n/n/versions/node
235 DEBUG ++ export N_PREFIX=/opt/node_n
236 DEBUG ++ N_PREFIX=/opt/node_n
236 DEBUG + source /usr/share/yunohost/helpers
236 DEBUG +++ run-parts --list /usr/share/yunohost/helpers.d 336 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null) [172/509] 336 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/backend ']'
336 DEBUG ++ . /usr/share/yunohost/helpers.d/backend
336 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null) 337 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/filesystem ']'
337 DEBUG ++ . /usr/share/yunohost/helpers.d/filesystem
337 DEBUG +++ CAN_BIND=1
337 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
337 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/ip ']'
337 DEBUG ++ . /usr/share/yunohost/helpers.d/ip
337 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
337 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/mysql ']' 337 DEBUG ++ . /usr/share/yunohost/helpers.d/mysql
337 DEBUG +++ MYSQL_ROOT_PWD_FILE=/etc/yunohost/mysql
337 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
338 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/network ']'
338 DEBUG ++ . /usr/share/yunohost/helpers.d/network
338 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null) 338 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/nodejs ']'
338 DEBUG ++ . /usr/share/yunohost/helpers.d/nodejs
338 DEBUG +++ n_install_dir=/opt/node_n
338 DEBUG +++ node_version_path=/opt/node_n/n/versions/node 338 DEBUG +++ export N_PREFIX=/opt/node_n
338 DEBUG +++ N_PREFIX=/opt/node_n
338 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
338 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/package ']'
339 DEBUG ++ . /usr/share/yunohost/helpers.d/package
339 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
339 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/print ']'
339 DEBUG ++ . /usr/share/yunohost/helpers.d/print
339 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
339 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/psql ']'
339 DEBUG ++ . /usr/share/yunohost/helpers.d/psql
339 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
339 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/setting ']'
339 DEBUG ++ . /usr/share/yunohost/helpers.d/setting
339 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
340 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/string ']'
340 DEBUG ++ . /usr/share/yunohost/helpers.d/string
340 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null)
340 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/system ']'
340 DEBUG ++ . /usr/share/yunohost/helpers.d/system
340 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null) 340 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/user ']' [129/509] 340 DEBUG ++ . /usr/share/yunohost/helpers.d/user
340 DEBUG ++ for helper in $(run-parts --list /usr/share/yunohost/helpers.d 2>/dev/null) 340 DEBUG ++ '[' -r /usr/share/yunohost/helpers.d/utils ']' 340 DEBUG ++ . /usr/share/yunohost/helpers.d/utils
341 DEBUG + ynh_abort_if_errors
341 DEBUG + set -eu
341 DEBUG + trap ynh_exit_properly EXIT
341 DEBUG + app=etherpad_mypads
341 DEBUG ++ ynh_app_setting_get etherpad_mypads final_path
341 DEBUG ++ sudo yunohost app setting etherpad_mypads final_path --output-as plain --quiet 541 DEBUG + final_path=/var/www/etherpad_mypads
542 DEBUG ++ ynh_app_setting_get etherpad_mypads domain
542 DEBUG ++ sudo yunohost app setting etherpad_mypads domain --output-as plain --quiet
742 DEBUG + domain=agora-dev.tera.coop
743 DEBUG ++ ynh_app_setting_get etherpad_mypads db_name
743 DEBUG ++ sudo yunohost app setting etherpad_mypads db_name --output-as plain --quiet 943 DEBUG + db_name=etherpad_mypads
943 DEBUG + CHECK_SIZE /var/www/etherpad_mypads
943 DEBUG + file_to_analyse=/var/www/etherpad_mypads
944 DEBUG ++ cut -f1
944 DEBUG ++ du --summarize /var/www/etherpad_mypads
1044 DEBUG + backup_size=139876
1044 DEBUG ++ sed 1d
1044 DEBUG ++ df --output=avail /home/yunohost.backup
1044 DEBUG + free_space=158528424
1045 DEBUG + '[' 158528424 -le 139876 ']'
1045 DEBUG + ynh_backup /var/www/etherpad_mypads
1045 DEBUG + local SRC_PATH=/var/www/etherpad_mypads
1045 DEBUG + local DEST_PATH=
1045 DEBUG + local IS_BIG=0
1045 DEBUG + BACKUP_CORE_ONLY=0
1045 DEBUG + '[' 0 == 1 ']'
1045 DEBUG + [[ -e /var/www/etherpad_mypads ]]
1045 DEBUG ++ realpath /var/www/etherpad_mypads
1045 DEBUG + SRC_PATH=/var/www/etherpad_mypads
1045 DEBUG + [[ -z '' ]]
1046 DEBUG + DEST_PATH=var/www/etherpad_mypads
1046 DEBUG + [[ ! -e var/www/etherpad_mypads ]]
1046 DEBUG + local REL_DIR=/apps/etherpad_mypads/backup
1046 DEBUG + REL_DIR=/apps/etherpad_mypads/backup/
1046 DEBUG + DEST_PATH=/apps/etherpad_mypads/backup/var/www/etherpad_mypads
1046 DEBUG + DEST_PATH=apps/etherpad_mypads/backup/var/www/etherpad_mypads 1046 DEBUG ++ echo /var/www/etherpad_mypads [86/509] 1046 DEBUG ++ sed -r 's/"/\"\"/g'
1046 DEBUG + local SRC=/var/www/etherpad_mypads 1046 DEBUG ++ sed -r 's/"/\"\"/g'
1046 DEBUG ++ echo apps/etherpad_mypads/backup/var/www/etherpad_mypads 1046 DEBUG + local DEST=apps/etherpad_mypads/backup/var/www/etherpad_mypads 1047 DEBUG + echo '"/var/www/etherpad_mypads","apps/etherpad_mypads/backup/var/www/etherpad_mypads"'
1047 DEBUG ++ dirname /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup/var/www/etherpad_mypads
1047 DEBUG + mkdir -p /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup/var/www 1047 DEBUG + ynh_backup /etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf 1047 DEBUG + local SRC_PATH=/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf 1047 DEBUG + local DEST_PATH=
1047 DEBUG + local IS_BIG=0
1047 DEBUG + BACKUP_CORE_ONLY=0
1063 DEBUG + '[' 0 == 1 ']'
1064 DEBUG + [[ -e /etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf ]] 1064 DEBUG ++ realpath /etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf 1064 DEBUG + SRC_PATH=/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf 1064 DEBUG + [[ -z '' ]]
1064 DEBUG + DEST_PATH=etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf 1064 DEBUG + [[ ! -e etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf ]]
1064 DEBUG + local REL_DIR=/apps/etherpad_mypads/backup 1064 DEBUG + REL_DIR=/apps/etherpad_mypads/backup/
1064 DEBUG + DEST_PATH=/apps/etherpad_mypads/backup/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf
1064 DEBUG + DEST_PATH=apps/etherpad_mypads/backup/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf
1065 DEBUG ++ echo /etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf
1065 DEBUG ++ sed -r 's/"/\"\"/g'
1065 DEBUG + local SRC=/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf
1065 DEBUG ++ echo apps/etherpad_mypads/backup/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf
1065 DEBUG ++ sed -r 's/"/\"\"/g'
1065 DEBUG + local DEST=apps/etherpad_mypads/backup/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf
1065 DEBUG + echo '"/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf","apps/etherpad_mypads/backup/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf"'
1065 DEBUG ++ dirname /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup/etc/nginx/conf.d/agora-dev.tera.coop.d/etherpad_mypads.conf
1065 DEBUG + mkdir -p /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup/etc/nginx/conf.d/agora-dev.tera.coop.d
1065 DEBUG + ynh_mysql_dump_db etherpad_mypads
1065 DEBUG ++ sudo cat /etc/yunohost/mysql
1066 DEBUG + mysqldump -u root -p*** --single-transaction --skip-dump-date etherpad_mypads
2268 DEBUG + CHECK_SIZE db.sql
2268 DEBUG + file_to_analyse=db.sql
2268 DEBUG ++ du --summarize db.sql
2268 DEBUG ++ cut -f1
2268 DEBUG + backup_size=86308
2268 DEBUG ++ sed 1d
2268 DEBUG ++ df --output=avail /home/yunohost.backup [43/509] 2269 DEBUG + free_space=158442084
2269 DEBUG + '[' 158442084 -le 86308 ']'
2269 DEBUG + ynh_backup /etc/logrotate.d/etherpad_mypads
2269 DEBUG + local SRC_PATH=/etc/logrotate.d/etherpad_mypads
2269 DEBUG + local DEST_PATH=
2269 DEBUG + local IS_BIG=0
2269 DEBUG + BACKUP_CORE_ONLY=0
2269 DEBUG + '[' 0 == 1 ']'
2269 DEBUG + [[ -e /etc/logrotate.d/etherpad_mypads ]]
2269 DEBUG ++ realpath /etc/logrotate.d/etherpad_mypads
2269 DEBUG + SRC_PATH=/etc/logrotate.d/etherpad_mypads
2270 DEBUG + [[ -z '' ]]
2270 DEBUG + DEST_PATH=etc/logrotate.d/etherpad_mypads
2270 DEBUG + [[ ! -e etc/logrotate.d/etherpad_mypads ]]
2270 DEBUG + local REL_DIR=/apps/etherpad_mypads/backup
2270 DEBUG + REL_DIR=/apps/etherpad_mypads/backup/
2271 DEBUG + DEST_PATH=/apps/etherpad_mypads/backup/etc/logrotate.d/etherpad_mypads
2271 DEBUG + DEST_PATH=apps/etherpad_mypads/backup/etc/logrotate.d/etherpad_mypads
2271 DEBUG ++ sed -r 's/"/\"\"/g'
2271 DEBUG ++ echo /etc/logrotate.d/etherpad_mypads
2271 DEBUG + local SRC=/etc/logrotate.d/etherpad_mypads
2271 DEBUG ++ echo apps/etherpad_mypads/backup/etc/logrotate.d/etherpad_mypads
2271 DEBUG ++ sed -r 's/"/\"\"/g'
2271 DEBUG + local DEST=apps/etherpad_mypads/backup/etc/logrotate.d/etherpad_mypads
2272 DEBUG + echo '"/etc/logrotate.d/etherpad_mypads","apps/etherpad_mypads/backup/etc/logrotate.d/etherpad_mypads"'
2272 DEBUG ++ dirname /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup/etc/logrotate.d/etherpad_mypads
2272 DEBUG + mkdir -p /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup/etc/logrotate.d
2272 DEBUG + ynh_backup /etc/systemd/system/etherpad_mypads.service
2272 DEBUG + local SRC_PATH=/etc/systemd/system/etherpad_mypads.service
2272 DEBUG + local DEST_PATH=
2272 DEBUG + local IS_BIG=0
2272 DEBUG + BACKUP_CORE_ONLY=0
2272 DEBUG + '[' 0 == 1 ']'
2272 DEBUG + [[ -e /etc/systemd/system/etherpad_mypads.service ]]
2272 DEBUG ++ realpath /etc/systemd/system/etherpad_mypads.service
2273 DEBUG + SRC_PATH=/etc/systemd/system/etherpad_mypads.service
2273 DEBUG + [[ -z '' ]]
2273 DEBUG + DEST_PATH=etc/systemd/system/etherpad_mypads.service
2273 DEBUG + [[ ! -e etc/systemd/system/etherpad_mypads.service ]]
2273 DEBUG + local REL_DIR=/apps/etherpad_mypads/backup
2273 DEBUG + REL_DIR=/apps/etherpad_mypads/backup/
2273 DEBUG + DEST_PATH=/apps/etherpad_mypads/backup/etc/systemd/system/etherpad_mypads.service
2273 DEBUG + DEST_PATH=apps/etherpad_mypads/backup/etc/systemd/system/etherpad_mypads.service 2273 DEBUG + DEST_PATH=apps/etherpad_mypads/backup/etc/systemd/system/etherpad_mypads.service [0/509] 2273 DEBUG ++ echo /etc/systemd/system/etherpad_mypads.service
2374 DEBUG ++ sed -r 's/"/\"\"/g'
2374 WARNING Source path '/etc/fail2ban/jail.d/etherpad_mypads.conf' does not exist
2374 DEBUG + local SRC=/etc/systemd/system/etherpad_mypads.service
2374 WARNING !!
2374 DEBUG ++ echo apps/etherpad_mypads/backup/etc/systemd/system/etherpad_mypads.service
2374 WARNING etherpad_mypads's script has encountered an error. Its execution was cancelled.
2374 DEBUG ++ sed -r 's/"/\"\"/g'
2374 WARNING !!
2375 DEBUG + local DEST=apps/etherpad_mypads/backup/etc/systemd/system/etherpad_mypads.service 2375 WARNING
2375 DEBUG + echo '"/etc/systemd/system/etherpad_mypads.service","apps/etherpad_mypads/backup/etc/systemd/system/etherpad_mypads.service"'
2375 DEBUG ++ dirname /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup/etc/systemd/system/etherpad_mypads.service
2375 DEBUG + mkdir -p /home/yunohost.backup/tmp/20180921-092612/apps/etherpad_mypads/backup/etc/systemd/system
2375 DEBUG + ynh_backup /etc/fail2ban/jail.d/etherpad_mypads.conf
2375 DEBUG + local SRC_PATH=/etc/fail2ban/jail.d/etherpad_mypads.conf
2375 DEBUG + local DEST_PATH=
2375 DEBUG + local IS_BIG=0
2375 DEBUG + BACKUP_CORE_ONLY=0
2376 DEBUG + '[' 0 == 1 ']'
2376 DEBUG + [[ -e /etc/fail2ban/jail.d/etherpad_mypads.conf ]] 2376 DEBUG + echo 'Source path '\''/etc/fail2ban/jail.d/etherpad_mypads.conf'\'' does not exist' 2376 DEBUG + return 1
2376 DEBUG + ynh_exit_properly
2376 DEBUG + local exit_code=1
2376 DEBUG + '[' 1 -eq 0 ']'
2376 DEBUG + trap '' EXIT
2376 DEBUG + set +eu
2376 DEBUG + echo -e '!!\n etherpad_mypads'\''s script has encountered an error. Its execution was cancelled.\n!!'
2376 DEBUG + type -t ynh_clean_setup
2376 DEBUG + ynh_die
2377 DEBUG + echo ''
2377 DEBUG + exit 1
2530 ERROR Impossible de sauvegarder l'application « etherpad_mypads » Traceback (most recent call last):
File "/usr/lib/moulinette/yunohost/backup.py", line 683, in _collect_app_files
raise_on_error=True, chdir=tmp_app_bkp_dir, env=env_dict)
File "/usr/lib/moulinette/yunohost/hook.py", line 394, in hook_exec
errno.EIO, m18n.n('hook_exec_failed', path=path))
MoulinetteError: [Errno 5] Échec de l’exécution du script « /tmp/backup_6yQgZi »
2532 DEBUG action [14002.1] executed in 2.314s
2532 DEBUG lock has been released
2532 ERROR Il n'y a rien à sauvegarder

maniackcrudelis commented 6 years ago

2376 DEBUG + echo 'Source path '''/etc/fail2ban/jail.d/etherpad_mypads.conf''' does not exist'

That's a known issue with the migration from jessie to stretch. You can create a blank file to fix the backup. An upgrade of etherpad will then recreate the file.

SiM commented 6 years ago

Thank you, after creating /etc/fail2ban/filter.d/etherpad_mypads.conf and `/etc/fail2ban/jail.d/etherpad_mypads.conf, backup is working !