Impossible to restore after a fail update of synapse (yuno testing 4.2.2)

My YunoHost server

Hardware: APU2D4 board (x86)
YunoHost version: 4.2.2 (testing)
I have access to my server : Through SSH | through the webadmin | direct access via keyboard / screen | …
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no
If yes, please explain:

Description of my issue

I am on testing 4.2.2, and everything looks fine but… I started the upgrade of Synapse today. It crashed. But when I tried to restore, yunohost told me :

This backup archive can not be restored because it comes from a too-old YunoHost version. 

Do you know a way to work around this ?

On the synapse sides, here are the lines when the upgrade failed :

2021-04-18 10:03:34,980: INFO - [##########++........] > Upgrading source files...
2021-04-18 10:03:34,983: DEBUG - + chown matrix-synapse:root -R /opt/yunohost/matrix-synapse
2021-04-18 10:03:35,479: DEBUG - ++ uname -m
2021-04-18 10:03:35,480: DEBUG - ++ grep arm
2021-04-18 10:03:35,494: DEBUG - + '[' -n '' ']'
2021-04-18 10:03:35,495: DEBUG - + export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/yunohost/matrix-synapse/.cargo/bin:/opt/yunohost/matrix-synapse/.local/bin:/usr/local/sbin
2021-04-18 10:03:35,496: DEBUG - + PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/opt/yunohost/matrix-synapse/.cargo/bin:/opt/yunohost/matrix-synapse/.local/bin:/usr/local/sbin
2021-04-18 10:03:35,496: DEBUG - + '[' -e /opt/yunohost/matrix-synapse/.rustup ']'
2021-04-18 10:03:35,497: DEBUG - + sudo -u matrix-synapse bash -c 'curl -sSf -L https://static.rust-lang.org/rustup.sh | sh -s -- -y --default-toolchain=stable --profile=minimal'
2021-04-18 10:03:35,606: WARNING - shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
2021-04-18 10:03:35,616: WARNING - job-working-directory: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
2021-04-18 10:03:35,621: WARNING - sh: 0: getcwd() failed: No such file or directory
2021-04-18 10:03:36,257: WARNING - info: downloading installer
2021-04-18 10:03:42,077: WARNING - error: No such file or directory (os error 2)
2021-04-18 10:03:42,139: DEBUG - + ynh_exit_properly
2021-04-18 10:03:42,140: DEBUG - + local exit_code=1
2021-04-18 10:03:42,141: DEBUG - + rm -rf /var/cache/yunohost/download/
2021-04-18 10:03:42,148: DEBUG - + '[' 1 -eq 0 ']'
2021-04-18 10:03:42,149: DEBUG - + trap '' EXIT
2021-04-18 10:03:42,150: DEBUG - + set +o errexit
2021-04-18 10:03:42,151: DEBUG - + set +o nounset
2021-04-18 10:03:42,152: DEBUG - + sleep 0.5
2021-04-18 10:03:42,658: DEBUG - + type -t ynh_clean_setup
2021-04-18 10:03:42,659: DEBUG - + ynh_clean_setup
2021-04-18 10:03:42,660: DEBUG - + ynh_clean_check_starting
2021-04-18 10:03:42,660: DEBUG - + '[' -n '' ']'
2021-04-18 10:03:42,661: DEBUG - + '[' -n '' ']'
2021-04-18 10:03:42,661: DEBUG - + ynh_restore_upgradebackup
2021-04-18 10:03:42,662: DEBUG - + ynh_print_err '--message=Upgrade failed.'
2021-04-18 10:03:42,704: DEBUG - + ynh_print_log '[Error] Upgrade failed.'
2021-04-18 10:03:42,705: DEBUG - + echo -e '[Error] Upgrade failed.'
2021-04-18 10:03:42,706: DEBUG - + local app_bck=synapse
2021-04-18 10:03:42,707: DEBUG - + NO_BACKUP_UPGRADE=0
2021-04-18 10:03:42,707: DEBUG - + '[' 0 -eq 0 ']'
2021-04-18 10:03:42,708: DEBUG - + ynh_backup_archive_exists synapse-pre-upgrade1
2021-04-18 10:03:42,709: WARNING - [Error] Upgrade failed.

In summary, I have two issues :

Any help will be much appreciated !

No one had come over my issue ?? :frowning_face:
I am still trying to figuring out if the problem comes from testing 4.2.2 or synapse, but I don’t really know where to start to look at.

I think it probably comes from 4.2.2

I made a small hotfix that may be related to this, but it’s not released yet … should be released in the next hours / days

Thanks @Aleks !
I just tried to upgrade TTRSS, and I came over the same issue. I will try the hot fix when released and I’ll let you know.

I had the same problem with my Nextcloud app. It seems the issue was in the nextcloud-pre-upgrade1.info.json.
The from_yunohost_version was set to “0:”. I just changed it manually to “4.2.2”, and ran

sudo yunohost backup restore nextcloud-pre-upgrade1

and my app was back.

I hope that it can solve your problem.

Edit : I don’t know how to solve the upgrade issue

1 Like

Thank you very much for your help @VingtTrois ! Indeed, I changed the from_yunohost_version as you suggested, and the restore command was able to go through.

Unfortunately, it stop after a while, with the following lines (before the critical error) :

2021-04-23 22:04:16,586: DEBUG -     running build_rust
2021-04-23 22:04:16,587: DEBUG - 
2021-04-23 22:04:16,587: DEBUG -         =============================DEBUG ASSISTANCE=============================
2021-04-23 22:04:16,588: DEBUG -         If you are seeing a compilation error please try the following steps to
2021-04-23 22:04:16,589: DEBUG -         successfully install cryptography:
2021-04-23 22:04:16,590: DEBUG -         1) Upgrade to the latest pip and try again. This will fix errors for most
2021-04-23 22:04:16,591: DEBUG -            users. See: https://pip.pypa.io/en/stable/installing/#upgrading-pip
2021-04-23 22:04:16,591: DEBUG -         2) Read https://cryptography.io/en/latest/installation.html for specific
2021-04-23 22:04:16,592: DEBUG -            instructions for your platform.
2021-04-23 22:04:16,592: DEBUG -         3) Check our frequently asked questions for more information:
2021-04-23 22:04:16,593: DEBUG -            https://cryptography.io/en/latest/faq.html
2021-04-23 22:04:16,594: DEBUG -         4) Ensure you have a recent Rust toolchain installed:
2021-04-23 22:04:16,594: DEBUG -            https://cryptography.io/en/latest/installation.html#rust
2021-04-23 22:04:16,595: DEBUG -         5) If you are experiencing issues with Rust for *this release only* you may
2021-04-23 22:04:16,596: DEBUG -            set the environment variable `CRYPTOGRAPHY_DONT_BUILD_RUST=1`.
2021-04-23 22:04:16,596: DEBUG -         =============================DEBUG ASSISTANCE=============================
2021-04-23 22:04:16,597: DEBUG - 
2021-04-23 22:04:16,598: DEBUG -     error: can't find Rust compiler
2021-04-23 22:04:16,598: DEBUG - 
2021-04-23 22:04:16,599: DEBUG -     If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
2021-04-23 22:04:16,600: DEBUG - 
2021-04-23 22:04:16,600: DEBUG -     To update pip, run:
2021-04-23 22:04:16,601: DEBUG - 
2021-04-23 22:04:16,602: DEBUG -         pip install --upgrade pip
2021-04-23 22:04:16,602: DEBUG - 
2021-04-23 22:04:16,603: DEBUG -     and then retry package installation.
2021-04-23 22:04:16,603: DEBUG - 
2021-04-23 22:04:16,604: DEBUG -     If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
2021-04-23 22:04:16,605: DEBUG - 
2021-04-23 22:04:16,606: DEBUG -     This package requires Rust >=1.41.0.
2021-04-23 22:04:16,607: DEBUG - 
2021-04-23 22:04:16,607: DEBUG -     ----------------------------------------
2021-04-23 22:04:16,608: DEBUG -   Rolling back uninstall of cryptography
2021-04-23 22:04:17,089: WARNING - Command "/opt/yunohost/matrix-synapse/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-pdhn7xvh/cryptography/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-lv_zy9ia/install-record.txt --single-version-externally-managed --compile --install-headers /opt/yunohost/matrix-synapse/include/site/python3.7/cryptography" failed with error code 1 in /tmp/pip-install-pdhn7xvh/cryptography/
2021-04-23 22:04:17,514: DEBUG - + ynh_exit_properly
2021-04-23 22:04:17,516: DEBUG - + local exit_code=1
2021-04-23 22:04:17,516: DEBUG - + rm -rf /var/cache/yunohost/download/
2021-04-23 22:04:17,525: DEBUG - + '[' 1 -eq 0 ']'
2021-04-23 22:04:17,526: DEBUG - + trap '' EXIT
2021-04-23 22:04:17,527: DEBUG - + set +o errexit
2021-04-23 22:04:17,527: DEBUG - + set +o nounset
2021-04-23 22:04:17,528: DEBUG - + sleep 0.5
2021-04-23 22:04:18,034: ERROR - Could not restore synapse: An error occured inside the app restore script

(Sorry, but I don’t fell comfortable to share the whole log because it might contain personal information like domain name or worse :grimacing:.)

Here again, I don’t know how to overcome this issue. It mentions that pip might be outdated ?!? I try to upgrade it with pip install --upgrade pip, but it did not work (maybe it is a pip in a virtualenv for synapse).
I don’t think now it comes from 4.2.2, but it is just a guess :face_with_monocle:

As mention in the previous post, I was still blocked to restore synapse. But after looking on the github page, I found an issue where @SiM post a solution to the same problem !
Thank to him (and the community at large)
:slight_smile:

1 Like

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