[SOLVED] Yunohost injoignable après màj échouée de Nextcloud

,

Je vais regarder ça de près, histoire de plus avoir de problèmes…

Pour vérifier si tes fichiers sont encore sur ton serveur, regarde le contenu de ton dossier /home/yunohost.app/nextcloud

:wink:

1 Like

J’ai l’impression de voir les fichiers (via SSH/ligne de commande, Nautilus ne veut pas trop se connecter, mais c’est un autre problème) !! :smile:

Du coup comment éviter que à la réinstallation de nextcloud, celle-ci n’écrase pas les données (utilisateurs et fichiers) existants ?

Pour ma part, à l’époque j’avais utilisé la méthode “oldschool débutant” (la seule que je connaissais et qui est “fiable”) :

  • j’ai renommé le dossier nextcloud en nextcloud-old
  • puis j’ai réinstallé nextcloud
  • enfin j’ai copié-coller le contenu du dossier “old” dans le nouveau.

(bien entendu, à la fin, j’ai réimporté mes agendas et contacts)
Voilà, j’espère avoir pu t’aider :wink:

1 Like

ça me paraît pas mal… Je vais essayer de cette manière, mais… demain matin !
Assez geeké pour aujourd’hui !

En tout cas merci à @Sango et @Maniack_Crudelis pour l’aide précieuse !

1 Like

Before reinstalling all the app.
You have a backup, made before the upgrade.
By restoring it, you will take back your nextcloud like it was.
I’ll explain to you how to do it later this evening… I’m busy right now…

1 Like

Can’t wait ! But I can wait ! :wink:

OK, so, now that your admin panel is back, let’s use it.

Go to “Backup”, “Local archives”, and then look for a backup named nextcloud-pre-upgradeX, by the way checked the dates and try with the more recent one.

Restore this backup and see if it’s work.

Hello !
When I click on “Local Archives” it stucks for few minutes and returns :

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/moulinette/interfaces/api.py", line 405, in process
ret = self.actionsmap.process(arguments, timeout=30, route=_route)
  File "/usr/lib/python2.7/dist-packages/moulinette/actionsmap.py", line 519, in process
return func(**arguments)
  File "/usr/lib/moulinette/yunohost/backup.py", line 2196, in backup_list
d[a] = backup_info(a, human_readable=human_readable)
  File "/usr/lib/moulinette/yunohost/backup.py", line 2238, in backup_info
tar.extract('info.json', path=info_dir)
  File "/usr/lib/python2.7/tarfile.py", line 2109, in extract
tarinfo = self.getmember(member)
  File "/usr/lib/python2.7/tarfile.py", line 1827, in getmember
tarinfo = self._getmember(name)
  File "/usr/lib/python2.7/tarfile.py", line 2396, in _getmember
members = self.getmembers()
  File "/usr/lib/python2.7/tarfile.py", line 1838, in getmembers
self._load()        # all members, we first have to
  File "/usr/lib/python2.7/tarfile.py", line 2419, in _load
tarinfo = self.next()
  File "/usr/lib/python2.7/tarfile.py", line 2350, in next
self.fileobj.seek(self.offset - 1)
  File "/usr/lib/python2.7/gzip.py", line 443, in seek
self.read(1024)
  File "/usr/lib/python2.7/gzip.py", line 268, in read
self._read(readsize)
  File "/usr/lib/python2.7/gzip.py", line 315, in _read
self._read_eof()
  File "/usr/lib/python2.7/gzip.py", line 354, in _read_eof
hex(self.crc)))
IOError: CRC check failed 0x8eedbd3cL != 0x3e57205aL

By the command line I found a pre-upgrade archive .tar.gz and a pre-upgrade .info.json.

What’s next ? Do I need to fix backup tool in the first place ?

Could you show me what gives sudo ls -alh /home/yunohost.backup/archives/ ?

total 105G
drwxr-x--- 2 root root 4.0K Dec 15 21:33 .
drwxr-xr-x 4 root root 4.0K Nov  8  2017 ..
-rw-r--r-- 1 root root 1.9K Nov  9  2017 20171108-181649.info.json
-rw-r--r-- 1 root root  99G Nov  9  2017 20171108-181649.tar.gz
-rw-r--r-- 1 root root 4.8G Nov 29  2017 20171129-215819.tar.gz
-rw-r--r-- 1 root root  284 Dec 15 21:29 jirafeau-pre-upgrade2.info.json
-rw-r--r-- 1 root root 146M Dec 15 21:29 jirafeau-pre-upgrade2.tar.gz
-rw-r--r-- 1 root root  322 Dec 15 09:01 nextcloud-pre-upgrade2.info.json
-rw-r--r-- 1 root root 131M Dec 15 09:01 nextcloud-pre-upgrade2.tar.gz
-rw-r--r-- 1 root root  253 Mar 27  2018 rainloop-before-upgrade.info.json
-rw-r--r-- 1 root root 5.9M Mar 27  2018 rainloop-before-upgrade.tar.gz
-rw-r--r-- 1 root root  284 Dec 15 21:33 ttrss-pre-upgrade2.info.json
-rw-r--r-- 1 root root  11M Dec 15 21:33 ttrss-pre-upgrade2.tar.gz
-rw-r--r-- 1 root root  266 Mar 27  2018 wordpress-pre-upgrade1.info.json
-rw-r--r-- 1 root root  24M Mar 27  2018 wordpress-pre-upgrade1.tar.gz

Looks like all is ok, maybe the admin panel is failing because of your huge backup, or the missing info.json.

About nextcloud, you have a backup from yesterday morning, that’s the one from your upgrade.
Try to restore this one, should probably be ok now.

sudo yunohost backup restore nextcloud-pre-upgrade2 --force

Do you think I need to make a copy of

/home/yunohost.app/nextcloud/data

before trying to restore ?

It shouln’t be affected, but you can if you want.

It worked !
but…
Nextcloud returns a 502 Bad Gateway error…
I restarted nginx, rebooted and diagnosis is ok…

So I looked for a solution and Yunohost GUI invited me to update Nextcloud.
I tried again and same problem…

EDIT ------------
Here the log for Nextcloud update :

2018-12-16 18:06:51,846: WARNING - Data dir will not be saved, because backup_core_only is set.
2018-12-16 18:12:46,669: WARNING - 
2018-12-16 18:12:46,693: WARNING - Upgrade to nextcloud 13.0.0
2018-12-16 18:16:23,480: WARNING - Unable to upgrade Nextcloud
2018-12-16 18:16:23,572: WARNING - !!
2018-12-16 18:16:23,574: WARNING -   nextcloud's script has encountered an error. Its execution was cancelled.
2018-12-16 18:16:23,576: WARNING - !!
2018-12-16 18:16:23,577: WARNING - Upgrade failed.
2018-12-16 18:17:21,859: WARNING - Removing database nextcloud
2018-12-16 18:17:49,209: WARNING - Remove the user nextcloud
2018-12-16 18:24:13,707: WARNING - debconf: unable to initialize frontend: Dialog
2018-12-16 18:24:14,001: WARNING - debconf: (Dialog frontend will not work on a dumb terminal, an emacs shell buffer, or without a controlling terminal.)
2018-12-16 18:24:14,003: WARNING - debconf: falling back to frontend: Readline
2018-12-16 18:24:14,004: WARNING - debconf: unable to initialize frontend: Readline
2018-12-16 18:24:14,006: WARNING - debconf: (This frontend requires a controlling tty.)
2018-12-16 18:24:14,008: WARNING - debconf: falling back to frontend: Teletype
2018-12-16 18:24:14,009: WARNING - dpkg-preconfigure: unable to re-open stdin:
2018-12-16 18:25:44,413: WARNING - The app was restored to the way it was before the failed upgrade.
2018-12-16 18:25:44,540: ERROR - Impossible de mettre à jour nextcloud

END EDIT------------

I start again and now I have an old not working Nextcloud installation… In order to update I follow your post but no /temp in my fstab configuration :

proc            /proc           proc    defaults          0       0
/dev/mmcblk0p1  /boot           vfat    defaults          0       2
/dev/sda1       /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that

What can I do for a proper update ?
Thank you so much for your help !

First, be careful because each upgrade will remove a backup and create a new one.
So copy your backups in another directory to be able to restore them anyway.

Then, the backup was before the upgrade, so that’s your old version. Means you still have to upgrade. Except that was expecting it to work this time…

If your admin panel is still working, go to “Tools”, “Logs”, and look for the log of nextcloud’s upgrade.
If not, try in /var/log/yunohost/.

Also, you can check the nginx log, /var/log/DOMAIN.TLD-error.log

I understand, I’ll be careful…
Here de nextcloud upgrade log

and here the nginx log :

2018/12/17 06:45:13 [crit] 13658#13658: *766 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:45:14 [crit] 13654#13654: *770 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:45:19 [crit] 13658#13658: *773 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:45:19 [crit] 13657#13657: *775 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:50:49 [crit] 13657#13657: *777 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:50:52 [crit] 13654#13654: *779 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:50:52 [crit] 13658#13658: *781 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:50:52 [crit] 13658#13658: *783 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:51:43 [crit] 13658#13658: *785 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:51:49 [crit] 13658#13658: *787 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$
2018/12/17 06:53:34 [crit] 13658#13658: *792 connect() to unix:/run/php/php7.0-fpm-nextcloud.sock failed (2: No such file or directory) while connect$

2018-12-16 21:16:09,485: DEBUG - UnexpectedValueException: The files of the app “files_pdfviewer” were not correctly replaced before running the update

Looks like that’s because of this plugin, after a restoration of your “old” nextcloud, try to remove this plugin, either from the panel, if it works or by removing its directory.

1 Like

Yes !!!
It works !
I saw the files_pdfviewer error but I had no idea about uninstall or fix the bug…

I ran

sudo rm -rf /var/www/nextcloud/apps/files_pdfviewer/

to remove the app directory and relaunched a successful upgrade.

Thank you so much @Maniack_Crudelis and @Sango for your time, I fixed my problem and learned a lot !

with :heart:

1 Like

Hi there !

I want to mention that this helps me to backup/restore my nextcloud instance :slight_smile:
I have the same issue, and disabling PDF viewer solved the same problem.

Thanks guys !