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

**URL:** <https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447>\
**Category:** Support\
**Tags:** english\
**Created:** [April 18, 2021, 6:39pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447 "2021-04-18T18:39:39Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ludovic](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ludovic/32/2209_2.png) [@ludovic](https://forum.yunohost.org/u/ludovic)\
**Post date:** [April 18, 2021, 6:39pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447/1 "2021-04-18T18:39:40Z")

</div>

### 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 :

```plaintext
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 :

```plaintext
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 :

- one related to [yunohost 4.2.2 testing](https://forum.yunohost.org/t/yunohost-4-2-testing/15088) I think,
- one related to synapse upgrade.

Any help will be much appreciated !

---

<div class="post-metadata">

**Author:** ![ludovic](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ludovic/32/2209_2.png) [@ludovic](https://forum.yunohost.org/u/ludovic)\
**Post date:** [April 21, 2021, 2:41pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447/2 "2021-04-21T14:41:20Z")

</div>

No one had come over my issue ?? ☹  
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.

---

<div class="post-metadata">

**Author:** ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)\
**Post date:** [April 21, 2021, 3:07pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447/3 "2021-04-21T15:07:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ludovic](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ludovic/32/2209_2.png) [@ludovic](https://forum.yunohost.org/u/ludovic)\
**Post date:** [April 21, 2021, 3:32pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447/4 "2021-04-21T15:32:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![VingtTrois](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/v/f4b2a3/32.png) [@VingtTrois](https://forum.yunohost.org/u/VingtTrois)\
**Post date:** [April 23, 2021, 4:09pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447/5 "2021-04-23T16:09:08Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ludovic](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ludovic/32/2209_2.png) [@ludovic](https://forum.yunohost.org/u/ludovic)\
**Post date:** [April 23, 2021, 8:25pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447/6 "2021-04-23T20:25:45Z")

</div>

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) :

```auto
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

```

```auto
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 😬.)

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 🧐

---

<div class="post-metadata">

**Author:** ![ludovic](https://forum.yunohost.org/user_avatar/forum.yunohost.org/ludovic/32/2209_2.png) [@ludovic](https://forum.yunohost.org/u/ludovic)\
**Post date:** [April 24, 2021, 7:13pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447/7 "2021-04-24T19:13:48Z")

</div>

As mention in the previous post, I was still blocked to restore synapse. But after looking on the github page, I found an [issue](https://github.com/YunoHost-Apps/synapse_ynh/issues/259?_pjax=%23js-repo-pjax-container#issue-866477859) where @SiM post a solution to the same problem !  
Thank to him (and the community at large)  
🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum.yunohost.org/uploads/default/original/2X/f/f59fe8e3ee6b100b4f574d30d6e30479c68b89f0.png) [@system](https://forum.yunohost.org/u/system)\
**Post date:** [May 9, 2021, 7:14pm UTC](https://forum.yunohost.org/t/impossible-to-restore-after-a-fail-update-of-synapse-yuno-testing-4-2-2/15447/8 "2021-05-09T19:14:15Z")

</div>

Closed on May 9, 2021, 7:14pm UTC

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