Update to NextCloud 20 failed, restore failure

:uk:/:us:

My YunoHost server

Hardware: Raspberry Pi at home
YunoHost version: 4.1.4.4
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 ? : no

Description of my issue

Hello,

I tried to update NextCloud to version 20. It failed after a long long time. My NextCloud updates are always slow. It was supposed to roll back. NextCloud was displayed as installed but I had a “forbidden” message. I tried to manually restore NextCloud, but thre restoration fails ;-(

The web admin was complaining about an illegal character. It was in a row related to the “rss” app (some content from news papers). I could not copy the log because the web admin fails in timeout when I try to access logs. Neither does the command line sudo yunohost log list respond.

I don’t care about this rss app. So here are my options :

  1. How do I restore NextCloud without this app ?
    or
  2. How do I find the offending character and fix it. There might be several occurrences if the app or backup is buggy. I guess I can access those logs with strait command line ?

Any help appreciated (:uk: or :fr:)

Please go in Tools > Logs and share the corresponding log

The problem is :

  • The logs menu does not answer in the web admin
  • The logs menu does not answer in command line (I mean yunohost tools log)

Hmokay, what do you mean it “does not answer in command line” 
 do you mean the command hangs forever and returns nothing ?

If that’s what happens, can you share the output of : ps -ef | grep -C3 yunohost

Yes it runs forever and returns nothing. Right now, since I did try to access logs about 1 hour ago, the disk is busy but the server does not answer. The ssh command does not fail. It just hangs. So either I wait for a while or I go for a hard reboot but I wish I could avoid this.

root       294     2  0 09:11 ?        00:00:00 [brcmf_wdog/mmc1]
root       336     1  1 09:11 ?        00:00:02 /usr/sbin/haveged --Foreground --verbose=1 -w 1024
root       370     1  0 09:11 ?        00:00:00 /usr/sbin/rsyslogd -n -iNONE
avahi      371     1  0 09:11 ?        00:00:00 avahi-daemon: running [yunohost.local]
root       375     1  0 09:11 ?        00:00:00 /usr/sbin/alsactl -E HOME=/run/alsa -s -n 19 -c rdaemon
root       383     1  0 09:11 ?        00:00:00 /lib/systemd/systemd-logind
message+   384     1  0 09:11 ?        00:00:00 /usr/bin/dbus-daemon --system --address=systemd: --nofork --nopidfile --systemd-activation --syslog-only
--
root       606     2  0 09:11 ?        00:00:00 [kworker/u9:2-hci0]
root       608     1  0 09:11 ?        00:00:00 /usr/lib/bluetooth/bluetoothd
root       639     1  0 09:11 ?        00:00:00 /sbin/dhcpcd -q -w
root       658     1  1 09:11 ?        00:00:02 /usr/bin/python2 /usr/bin/yunohost-api
root       667     1  0 09:11 ?        00:00:00 /usr/bin/python3 /usr/share/unattended-upgrades/unattended-upgrade-shutdown --wait-for-signal
root       668     1  0 09:11 ?        00:00:00 php-fpm: master process (/etc/php/7.3/fpm/php-fpm.conf)
root       671     1  3 09:11 ?        00:00:04 /usr/bin/python3 /usr/bin/fail2ban-server -xf start
--
admin     1717  1696  0 09:13 ?        00:00:00 sshd: admin@pts/0
admin     1718  1717  7 09:13 pts/0    00:00:00 -bash
admin     1730  1718  0 09:13 pts/0    00:00:00 ps -ef
admin     1731  1718  0 09:13 pts/0    00:00:00 grep --color=auto -C3 yunohost

I have tried to upgrade again : it migrates to 20.0, then automatically to 20.4 (about 1 hour) and fails with this:

Info: Now upgrading nextcloud...
Info: [....................] > Loading installation settings...
Info: [+...................] > Ensuring downward compatibility...
Info: [#++++++++...........] > Backing up the app before upgrading (may take a while)...
Info: [#########++.........] > Upgrading dependencies...
Info: [###########+........] > Making sure dedicated system user exists...
Info: [############........] > Upgrading PHP-FPM configuration...
Info: [############+.......] > Upgrading NGINX web server configuration...
Info: The service nginx has correctly executed the action reload-or-restart.
Info: [#############+......] > Upgrading Nextcloud...
Info: Upgrade to nextcloud 20.0.0
Info: '/tmp/tmp.XQ12ojv5jD' wasn't deleted because it doesn't exist.
Warning:  Starting ...
Warning:     0/0 [>---------------------------]   0% Starting ...
Info: Upgrade to nextcloud 20.0.4
Info: '/tmp/tmp.bvRc6F4wqj' wasn't deleted because it doesn't exist.
Warning:     0/0 [->--------------------------]   0% Starting ...
Warning:     0/0 [>---------------------------]   0%
Warning: In Connection.php line 72:
Warning:   Failed to connect to the database: An exception occurred in driver: SQLSTATE[HY000] [2002] Connection refused
Warning: db:add-missing-primary-keys
Warning: [Error] Upgrade failed.
Info: '/tmp/owncloud_post_migration.sh' wasn't deleted because it doesn't exist.
Warning: 230950 /!\ Packagers! You are probably using a lua regex. You should use a PCRE regex instead.
Warning: 301546 ERROR 2013 (HY000) at line 1692: Lost connection to MySQL server during query
Warning: 303479 Could not restore nextcloud
Warning: Traceback (most recent call last):
Warning:   File "/usr/lib/moulinette/yunohost/backup.py", line 1388, in _restore_app
Warning:     env=env_dict)[0]
Warning:   File "/usr/lib/moulinette/yunohost/hook.py", line 362, in hook_exec
Warning:     raise YunohostError('hook_exec_failed', path=path)
Warning: YunohostError: Could not run script: /tmp/restore9hjepR/restore
Warning: 304035 Here's an extract of the logs before the crash. It might help debugging the error:
Warning: 319396 E: Unable to locate package nextcloud-ynh-deps
Warning: 353503 The user nextcloud was not found
Warning: 357912 Nothing was restored
Warning: The app was restored to the way it was before the failed upgrade.
Error: Could not upgrade nextcloud: An error occurred inside the app upgrade script
Info: The operation 'Upgrade the 'nextcloud' app' could not be completed. Please share the full log of this operation using the command 'yunohost log display 20210115-084930-app_upgrade-nextcloud --share' to get help
Warning: Here's an extract of the logs before the crash. It might help debugging the error:
Info: DEBUG - 74944 + echo 'Backing up data directory...'
Info: DEBUG - 74945 + ynh_backup --src_path=/home/yunohost.app/nextcloud/data --is_big
Info: DEBUG - 75154 + dest_path=
Info: DEBUG - 75155 + is_big=1
Info: DEBUG - 75155 + not_mandatory=0
Info: DEBUG - 75156 + BACKUP_CORE_ONLY=1
Info: DEBUG - 75157 + test -n nextcloud
Info: DEBUG - 75157 ++ ynh_app_setting_get --app=nextcloud --key=do_not_backup_data
Info: DEBUG - 75262 ++ [[ do_not_backup_data =~ (unprotected|protected|skipped)_ ]]
Info: DEBUG - 75263 ++ ynh_app_setting get nextcloud do_not_backup_data
Info: DEBUG - 75666 + do_not_backup_data=
Info: DEBUG - 75666 + '[' 1 -eq 1 ']'
Info: DEBUG - 75667 + '[' 0 -eq 1 ']'
Info: DEBUG - 75667 + '[' 1 -eq 1 ']'
Info: DEBUG - 75668 + '[' 1 -eq 1 ']'
Info: DEBUG - 75668 + ynh_print_info '--message=/home/yunohost.app/nextcloud/data will not be saved, because '\''BACKUP_CORE_ONLY'\'' is set.'
Info: DEBUG - 75670 + echo '/home/yunohost.app/nextcloud/data will not be saved, because '\''BACKUP_CORE_ONLY'\'' is set.'
Info: DEBUG - 75671 + return 0
Info: DEBUG - 75671 + ynh_print_info '--message=Backup script completed for nextcloud. (YunoHost will then actually copy those files to the archive).'
Info: DEBUG - 75674 + echo 'Backup script completed for nextcloud. (YunoHost will then actually copy those files to the archive).'
Info: DEBUG - 75674 + ynh_exit_properly
Error: The app 'nextcloud' failed to upgrade, and as a consequence the following apps' upgrades have been cancelled: nextcloud, rainloop, grav
Warning: unable to upgrade apps: The operation 'Upgrade the 'nextcloud' app' could not be completed. Please share the full log of this operation using the command 'yunohost log display 20210115-084930-app_upgrade-nextcloud --share' to get help
Error: Some apps could not be upgraded

Shared full log at https://paste.yunohost.org/raw/vemusuvavi

If I run yunohost backup restore nextcloud-pre-upgrade2 it restores NextCloud 
 but it’s unusable. The pages are broken. I don’t know if either some css or some javascript is missing but the layout is a mess. It’s unusable.

So right now I’m stuck without NextCloud. No way to upgrade, no way to restore :cry:

Hello, I have the same problem.
I updated Nextcloud from 19 to 20 and Nextvloud was removed from applications. I tried to restore the backup nextcloud-pre-upgrade1 but there is an error:

Fichier YAML corrompu en lecture depuis /etc/ssowat/conf.json.persistent (raison : while scanning for the next token found character ‘\t’ that cannot start any token in “”, line 2, column 25: “theme” : “default”, ^)

`

Tu dois Ă©diter le fichier /etc/ssowat/conf.json.persistent avec

nano /etc/ssowat/conf.json.persistent

et apparement il y a une tabulation au lieu d’espaces quelque part 


OK. J’ai installĂ© un NextCloud 20 Ă  cĂŽtĂ© mais ça ne m’avance pas beaucoup si je ne sais pas restaurer les donnĂ©es de mon NextCloud 19. RĂ©ussir Ă  restaurer, upgrader serait quand mĂȘme mieux qu’une reprise manuelle de toutes les donnĂ©es.

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