Fail to upgrade synapse from 1.59 to 1.69

My YunoHost server

Hardware: computer
YunoHost version: 11.0.10.2
I have access to my server : Through SSH, through the webadmin
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : no

Description of my issue

For some weeks, I’ve been having some issues with synapse, it failed to being backed up, then stopped working. Then I restored it to the last backup, then occurred the same issue again after some days.
I thought updating it from 1.59.0~ynh1 to 1.69.0~ynh1 may resolve the issue, so I restored it to latest working version, performed bullseye upgrade and tried it, but the synapse upgrade keep failing.
The error log seem cryptic to me, rather empty.

yunohost app upgrade -F synapse
Info: Now upgrading synapse...
Info: [....................] > Loading installation settings...
Info: [+...................] > Ensuring downward compatibility...
Info: [#++++++++...........] > Backing up the app before upgrading (may take a while)...
Warning: The password needs to be at least 8 characters long and contain a digit, upper, lower and special characters
Warning: [Error] Upgrade failed.
Warning: 309615 I: Creating /var/lib/turn/turndb from /usr/share/coturn/schema.sql
Warning: 1723424 (this may take some time)
Warning: The app was restored to the way it was before the failed upgrade.
Error: Could not upgrade synapse: An error occurred inside the app upgrade script
Info: The operation 'Upgrade the 'synapse' app' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20221027-165311-app_upgrade-synapse' to get help
Warning: Here's an extract of the logs before the crash. It might help debugging the error:
Info: DEBUG - + app=synapse
Info: DEBUG - + [[ is_free_registration =~ (unprotected|protected|skipped)_ ]]
Info: DEBUG - + ynh_app_setting set synapse is_free_registration 0
Info: DEBUG - + '[' -z ']'
Info: DEBUG - ++ ynh_string_random --length=30
Info: DEBUG - ++ length=30
Info: DEBUG - ++ filter=A-Za-z0-9
Info: DEBUG - ++ sed --quiet 's/\(.\{30\}\).*/\1/p'
Info: DEBUG - ++ dd if=/dev/urandom bs=1 count=1000
Info: DEBUG - ++ tr --complement --delete A-Za-z0-9
Info: DEBUG - + synapse_user_app_pwd=**********
Info: DEBUG - + ynh_app_setting_set --app=synapse --key=synapse_user_app_pwd --value=**********
Info: DEBUG - + local _globalapp=synapse
Info: DEBUG - + app=synapse
Info: DEBUG - + [[ synapse_user_app_pwd =~ (unprotected|protected|skipped)_ ]]
Info: DEBUG - + ynh_app_setting set synapse synapse_user_app_pwd **********
Info: DEBUG - + yunohost user create synapse -f Synapse -l Application -d domain.tld -p **********
Info: WARNING - The password needs to be at least 8 characters long and contain a digit, upper, lower and special characters
Info: DEBUG - You are now about to define a new user password. The password should be at least 8 characters long—though it is good practice to use a longer password (i.e. a passphrase) and/or to a variation of characters (uppercase, lowercase, digits and special characters).
Info: DEBUG - + ynh_exit_properly
Error: Could not upgrade synapse: This action seems to have broken these important services: fail2ban (failed)
Error: None

Any hint or suggestion in any direction would be deeply appreciated :slight_smile:

It sounds related to the fact that you probably increased the password policy to enforce lower/uppercase chars etc, but probably the mechanism that generates a random password for that special synapse user doesnt generate such a password (but it is a 30-char long password tho) …

One workaround can be to temporarily reset the password policy while upgrading/install/restoring the app I suppose

1 Like

Yo @Aleks two times in one day I’ve got to thank you so much. Again right on the spot. I was seeing this log about password policy and I couldn’t figure out what it could have to do with upgrade and it’s failure.
Thanks a lot, indeed running the following did the job perfect and synapse upgraded fine :slight_smile:

sudo yunohost settings set security.password.user.strength -v 1
sudo yunohsot app upgrade -F synapse
sudo yunohost settings set security.password.user.strength -v 3
1 Like

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