Synapse upgrade failed, restore failed

What type of hardware are you using: Virtual machine
What YunoHost version are you running: 11.3.0
What app is this about: matrix-synapse

Describe your issue

Subject line says it all.

Share relevant logs or error messages

Initial upgrade failure: https://paste.yunohost.org/raw/covogexura

Auto-restore failure: https://paste.yunohost.org/raw/mehaqiwuse

Hello,

Can you share me the upgrade log. The first one is the remove after the upgrade which is not really useful.

From which version version did you try to upgrade ?

Maybe doing a mv /home/yunohost.app/synapse /home/yunohost.app/matrix-synapse might solve the restore but well without more details it’s difficult to say.

1 Like

Whoops!

https://paste.yunohost.org/raw/iyofodoriz

Moving synapse to matrix-synapse as you suggested allowed the backup to restore it looks like.

I was attempting to upgrade from 1.69.0~ynh1.

Well,

To be honest, I’m quite not surprised that the upgrade fail from an older version like this. Currently the oldest version we test the upgrade is from 1.100.0~ynh1 because to support the upgrade from an older version it’s quite complicated to support.

Maybe can you try theses command to see if the venv can be built this way:

Create a file in /tmp/synapse_requirement.txt with this content:

annotated-types==0.7.0
attrs==24.2.0
Automat==24.8.1
bcrypt==4.2.1
bleach==6.2.0
canonicaljson==2.0.0
certifi==2024.8.30
cffi==1.17.1
charset-normalizer==3.4.0
constantly==23.10.4
cryptography==43.0.3
hyperlink==21.0.0
idna==3.10
ijson==3.3.0
immutabledict==4.2.1
incremental==24.7.2
Jinja2==3.1.4
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
ldap3==2.9.1
lxml==5.3.0
MarkupSafe==3.0.2
matrix-common==1.3.0
matrix-synapse==1.120.0
matrix-synapse-ldap3==0.3.0
msgpack==1.1.0
ndg-httpsclient==0.5.1
netaddr==1.3.0
packaging==24.2
phonenumbers==8.13.50
pillow==11.0.0
prometheus_client==0.21.0
psycopg2==2.9.10
pyasn1==0.6.1
pyasn1_modules==0.4.1
pycparser==2.22
pydantic==2.10.2
pydantic_core==2.27.1
pymacaroons==0.13.0
PyNaCl==1.5.0
pyOpenSSL==24.2.1
python-multipart==0.0.17
PyYAML==6.0.2
referencing==0.35.1
requests==2.32.3
rpds-py==0.21.0
semantic-version==2.10.0
service-identity==24.2.0
setuptools-rust==1.10.2
signedjson==1.1.4
six==1.16.0
sortedcontainers==2.4.0
tomli==2.1.0
treq==24.9.1
Twisted==24.10.0
typing_extensions==4.12.2
unpaddedbase64==2.1.0
urllib3==2.2.3
webencodings==0.5.1
zope.interface==7.1.1

Then run theses commands:

python3 -m venv /tmp/synapse_test_venv
/tmp/synapse_test_venv/bin/pip3 install --upgrade setuptools wheel pip cffi
/tmp/synapse_test_venv/bin/pip3 install --upgrade -r /tmp/synapse_requirement.txt

If it fail, can you share me the log.

Thanks for the procedure. Unfortunately:

ERROR: Could not find a version that satisfies the requirement pip3
ERROR: No matching distribution found for pip3

This is the output after creating the file and running the first and second commands. I did verify that there’s a /tmp/synapse_test_venv/bin/pip3.

Sorry there was a typo on the command I edited the message to fixe it.

Ah, that seems to have done the trick.

Installing collected packages: webencodings, sortedcontainers, phonenumbers, ijson, zope.interface, urllib3, unpaddedbase64, typing_extensions, tomli, six, semantic-version, rpds-py, P
yYAML, python-multipart, pyasn1, psycopg2, prometheus_client, pillow, packaging, netaddr, msgpack, MarkupSafe, lxml, immutabledict, idna, constantly, charset-normalizer, certifi, canon
icaljson, bleach, bcrypt, attrs, annotated-types, setuptools-rust, requests, referencing, PyNaCl, pydantic_core, pyasn1_modules, matrix-common, ldap3, Jinja2, incremental, hyperlink, c
ryptography, Automat, Twisted, signedjson, service-identity, pyOpenSSL, pymacaroons, pydantic, jsonschema-specifications, ndg-httpsclient, matrix-synapse-ldap3, jsonschema, treq, matri
x-synapse
Successfully installed Automat-24.8.1 Jinja2-3.1.4 MarkupSafe-3.0.2 PyNaCl-1.5.0 PyYAML-6.0.2 Twisted-24.10.0 annotated-types-0.7.0 attrs-24.2.0 bcrypt-4.2.1 bleach-6.2.0 canonicaljson
-2.0.0 certifi-2024.8.30 charset-normalizer-3.4.0 constantly-23.10.4 cryptography-43.0.3 hyperlink-21.0.0 idna-3.10 ijson-3.3.0 immutabledict-4.2.1 incremental-24.7.2 jsonschema-4.23.0
 jsonschema-specifications-2024.10.1 ldap3-2.9.1 lxml-5.3.0 matrix-common-1.3.0 matrix-synapse-1.120.0 matrix-synapse-ldap3-0.3.0 msgpack-1.1.0 ndg-httpsclient-0.5.1 netaddr-1.3.0 pack
aging-24.2 phonenumbers-8.13.50 pillow-11.0.0 prometheus_client-0.21.0 psycopg2-2.9.10 pyOpenSSL-24.2.1 pyasn1-0.6.1 pyasn1_modules-0.4.1 pydantic-2.10.2 pydantic_core-2.27.1 pymacaroo
ns-0.13.0 python-multipart-0.0.17 referencing-0.35.1 requests-2.32.3 rpds-py-0.21.0 semantic-version-2.10.0 service-identity-24.2.0 setuptools-rust-1.10.2 signedjson-1.1.4 six-1.16.0 s
ortedcontainers-2.4.0 tomli-2.1.0 treq-24.9.1 typing_extensions-4.12.2 unpaddedbase64-2.1.0 urllib3-2.2.3 webencodings-0.5.1 zope.interface-7.1.1

So that looks to me like I’m running synapse 1.120 … of course, the Yuno package still shows as 1.69. Can I just run the upgrade from the webmin again to resolve that, or … ?

Hello,

So that looks to me like I’m running synapse 1.120 … of course, the Yuno package still shows as 1.69.

No building a venv don’t mean to run a new version :wink:

So it’s probably related to the fact that the venv is really old and need to be rebuilt cleanly.

Maybe what you can try is to do something like this:

# Move the old venv so we can create a new one at the same place than the old one
mv /opt/yunohost/matrix-synapse /opt/yunohost/matrix-synapse_old
# Create the new venv
python3 -m venv /opt/yunohost/matrix-synapse
/opt/yunohost/matrix-synapse/bin/pip3 install --upgrade setuptools wheel pip cffi
/opt/yunohost/matrix-synapse/bin/pip3 install --upgrade -r /tmp/synapse_requirement.txt
# Copy files from old venv
cp  /opt/yunohost/matrix-synapse_old/update_synapse_for_appservice.sh /opt/yunohost/matrix-synapse
cp  /opt/yunohost/matrix-synapse_old/Coturn_config_rotate.sh /opt/yunohost/matrix-synapse
# Upgrade synapse without safety backup so we avoid to remove the app in case of the upgrade fail
yunohost app upgrade -b synapse

Note I can’t guarantee that it will work, it’s just what I would try if I was in your case. If it fail please share your log so I can try to help your to go further.

Hrm, could I also:

  1. dump database
  2. uninstall old matrix-synapse
  3. install updated matrix-synapse
  4. restore db ?

haven’t tried it your way yet, just exploring the options. i also don’t know if the schema has been materially changed between the versions, so this might not be the best idea

Yes it’s also a solution but you might need to restore a little bit more thing than just the DB, by example also the data directory and also there are some token in the configuration which need to be keep to keep the user logged in.

About the DB schema, to be honest it’s the most important thing that I’m quite not sure it will work. It’s quite a big gap between 1.69 and 1.120.

Right, well I’ll give a try to the upgrade path you described sometime in the next couple days. Worst case is I have to nuke everything and start over and that’s not that big a deal.

Alright, I ran the steps as you suggested and the upgrade seems to have completed successfully! Thank you so much for all your help, couldn’t have done it without. o7

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