Can't restore backup (Nextcloud) - wrong json or archive / outdated restore script

Tu devrais peut être essayer d’extraire le info.json avec la commande tar pour qu’on vois à quoi il ressemble

EDIT: Oublis je viens de voir qu’il est en haut…

1 Like

I suggest you to try again with this working archive and to disable the installation of php7.3 by disabling the helper

cp /usr/share/yunohost/helpers.d/php /root/php.bkp
echo "ynh_install_php () { true }" >> /usr/share/yunohost/helpers.d/php

Then you try to restore your archive (potentially by installing php manually with apt before).
Then

cp /root/php.bkp /usr/share/yunohost/helpers.d/php 
1 Like

Et ben en fait je ne relis même pas le fil que je fais pour documenter le problème, j’avais moi-même oublié que j’avais une archive “fonctionnelle” :sweat_smile:

I still have:

Attention : Do not use ynh_install_php to install php7.3

:frowning:

Ben à la place de faire ça, remplace dans le fichier ynh_install_php () { [...] } par ynh_install_php () { true }

Still the same error :sweat_smile:

Even if I deleted the whole function content… :thinking:

cat /usr/share/yunohost/helpers.d/php | yunopaste

?

https://paste.yunohost.org/umomeziyix

I doesn’t understand how you could get the same error. Maybe the helpers are in archive (i d’ont remember if we backup the helpers or not)?

Oh, good point… I’ll check.

There is no helper in the backup.

Maybe I can add a debug warning in the helper, just to see if I changed to correct file ?

I did that. It doesn’t seem to use that helper…

Ok I found the issue: while using the web admin to upgrade an app (and while I did forget that i changed that helper… :sweat_smile:), I saw that error:

/usr/share/yunohost/helpers.d/php: line 582: syntax error : premature end of file

Line 582 is the very end of the file

I must have made a mistake… is there a way to check bash syntax automatically ?

edit: I found the issue.

Nextcloud did restore ! :rocket: :rocket: :rocket: :rocket: :rocket:
Thanks a lot @ljf !! :cupid: :fireworks: :rocket:

Ok now I have an internal server error, but one step at a time :sweat_smile: :joy:

edit 2: it was a /data directory owner error (wallabag2 instead of nextcloud), upgrade worked :slight_smile:

2 Likes

For the record: I had to do it again for… some reasons :slight_smile:

And :

This was not my fault ^^
That’s that line that is responsible for that issue.

So if anyone goes into such a problem in the future : don’t use this one, but the second technique :

And now if I try to upgrade it (from v18) it fails : Variable $ynh_php_version wasn't initialized when trying to replace __YNH_PHP_VERSION__ in /etc/nginx/conf.d/.

I don’t know where to fix that…