Thursday, July 24, 2025
support@conference.yunohost.org
July
Mon Tue Wed Thu Fri Sat Sun
  1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 23
24
25
26
27
28
29
30
31
     
             

[15:58:54] <Jørgen> Hi, I have a bit of problem updating synapse to the latest version, might there be someone to help me troubleshoot?
[15:59:59] <Aleks (he/him/il/lui)> just ask your question directly
[16:02:19] <Jørgen> Trying to update synapse to the latest version it errors, full log attached.
[16:04:08] <Jørgen> It might be related to:

> 2025-07-24 17:51:33,028: WARNING - homeserver.py: error: argument --generate-missing-configs/--generate-keys: not allowed with argument --generate-config
[16:05:07] <Aleks (he/him/il/lui)> hmm there was a similar issue in https://github.com/YunoHost-Apps/synapse_ynh/issues/524 but supposedly fixed months ago
[16:07:09] <Jørgen> With the current install I cannot connect with the element x app as it will not accept the server. Maybe if it was possible to just backup the setup/database remove and the and then install the synapse again.
[16:14:35] <Aleks (he/him/il/lui)> from what I understand from the old issue, I would try to manually run these commands :

```
sudo -i # Make sure you're root
cd /var/www/synapse
# In the next command, note that you need to replace matrix.domain2.tld with the actual domain :
# (and note that i removed the --generate-keys option ... following what seemed to have been discussed in the old issue ... though i don't know enough about synapse but it seems somewhat legit)
/var/www/synapse/venv/bin/python -m synapse.app.homeserver --keys-directory /etc/matrix-synapse/ --generate-config --server-name matrix.domain2.tld --report-stats=no -c homeserver.yml
registration_shared_secret=$(egrep "^registration_shared_secret:" homeserver.yml | cut -d'"' -f2)
form_secret=$(egrep "^form_secret:" homeserver.yml | cut -d'"' -f2)
yunohost app setting synapse registration_shared_secret --value="$registration_shared_secret"
yunohost app setting synapse form_secret --value="$form_secret"
```

and then ... ??? .. i suppose you can just re-attempt a regular upgrade
[16:15:28] <Aleks (he/him/il/lui)> hmm i'm not sure about the "cd" though ...
[16:23:35] <Jørgen> success!

The cd is necessary because it refers to homeserver.yml without the full path
[16:28:12] <Jørgen> Thanks for your help, where did you find the commands to reuse the old keys?
[16:29:13] <Aleks (he/him/il/lui)> the issue was refering to https://github.com/YunoHost-Apps/synapse_ynh/tree/fix_upgrade_missing_secrets which contains this commit https://github.com/YunoHost-Apps/synapse_ynh/commit/be5c414d4d5778163512a34de048cab5a797d4ca (but it's probably not a good idea to upgrade using this branch because it's "old" (4 month) so it'll create a huge mess and actually downgrade synapse probably)
[16:29:24] <Aleks (he/him/il/lui)> but i did see that it removes the --generate-keys option
[16:29:45] <Aleks (he/him/il/lui)> and then i adapted the rest of the migration from https://github.com/YunoHost-Apps/synapse_ynh/blob/master/scripts/upgrade#L266-L272
[16:30:52] <Aleks (he/him/il/lui)> still sounds like a bug in the upgrade script of the app to me, this shouldnt be necessary, but i don't understand why that --generate-keys option is here and why it's not compatible with the other options
[16:34:58] <Jørgen> Thanks ❤️