[SOLVED] Migration failure -- v11 to v12

What type of hardware are you using: VPS bought online
What YunoHost version are you running: 12.0.11
How are you able to access your server: SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: no

Describe your issue

The migration from v11 to v12 failed, leaving the system in a degraded state. Services are still running but the webmin is inaccessible. I am unable to access the log of the upgrade via the cli, though it does exist in the yuno log dir. Attempting to restore the system from a pre-migration backup also failed.

First thing I need to know is the best way to anonymize and share the log, since I’m unable to use the built-in tools to do so. I’ll include the actual failure message below.

Share relevant logs or error messages

yunohost --version

yunohost: 
  repo: stable
  version: 12.0.11
yunohost-admin: 
  repo: stable
  version: 11.3.0
yunohost-portal: 
  repo: ?
  version: ?
moulinette: 
  repo: stable
  version: 12.0.4
ssowat: 
  repo: stable
  version: 12.0.3
2025-02-25 05:56:09,291: DEBUG -  yunohost
2025-02-25 05:56:10,270: WARNING - E: Sub-process /usr/bin/dpkg returned an error code (1)
2025-02-25 05:56:10,358: DEBUG - Setting up yunohost (12.0.11) ...
2025-02-25 05:56:10,479: DEBUG - Regenerating configuration, this might take a while...
2025-02-25 05:56:11,711: WARNING - ERROR Could not find synapse in the list of installed apps:
2025-02-25 05:56:11,712: WARNING -  * cinny
2025-02-25 05:56:11,713: WARNING -  * dokuwiki
2025-02-25 05:56:11,714: WARNING -  * element
2025-02-25 05:56:11,715: WARNING -  * gitea
2025-02-25 05:56:11,716: WARNING -  * synapse__2
2025-02-25 05:56:11,717: WARNING -  * syncserver-rs
2025-02-25 05:56:11,884: WARNING - dpkg: error processing package yunohost (--configure):
2025-02-25 05:56:11,885: WARNING -  installed yunohost package post-installation script subprocess returned error exit status 1
2025-02-25 05:56:12,001: WARNING - Errors were encountered while processing:
2025-02-25 05:56:12,002: WARNING -  yunohost
2025-02-25 05:56:17,006: ERROR - Migration 0027_migrate_to_bookworm did not complete, aborting. Error: Failed to run command 'aptitude full-upgrade --show-why -o Dpkg::Options::='--force-confold' yunohost yunohost-admin yunohost-portal moulinette ssowat libluajit2-5.1-2 '
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yunohost/migrations/0027_migrate_to_bookworm.py", line 261, in run
  File "/usr/lib/python3/dist-packages/yunohost/utils/system.py", line 315, in aptitude_with_progress_bar
yunohost.utils.error.YunohostError: Failed to run command 'aptitude full-upgrade --show-why -o Dpkg::Options::='--force-confold' yunohost yunohost-admin yunohost-portal moulinette ssowat libluajit2-5.1-2 '

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/yunohost/tools.py", line 786, in tools_migrations_run
    operation_logger.success()
  File "/usr/lib/python3/dist-packages/yunohost/migrations/0027_migrate_to_bookworm.py", line 266, in run
    aptitude_with_progress_bar("unhold yunohost moulinette ssowat yunohost-admin")
  File "/usr/lib/python3/dist-packages/yunohost/utils/system.py", line 315, in aptitude_with_progress_bar
yunohost.utils.error.YunohostError: Failed to run command 'aptitude full-upgrade --show-why -o Dpkg::Options::='--force-confold' yunohost yunohost-admin yunohost-portal moulinette ssowat libluajit2-5.1-2 '

Hmkay so is there a specific story with synapse on your server ? I see that you have a second synapse instance somehow, is this expected ?

Yes, at one time I had two synapse installations serving two different domains. The second was removed prior to the migration to v11 as far as I can tell from the logs.

The “could not find synapse in the list of installed apps” error seems to be what’s really blocking – it’s preventing me from doing basically everything here, and I have no idea how to clear it. Any ideas? I can’t update the system, install anything, or restore any backups.

Update: Hey some good news, I figured out the issue with sharing the logs – yuno’s log location changed with the upgrade to v12. Moved the old logs there.

Here’s the failed migration log:

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


Did some digging through the code. Bear in mind I know no python.

Seems like the main problem is the yunohost package postinst is choking at the yunohost app ssowatconf step. I’m afraid I’m unclear on what exactly this step is doing – I think it’s looking for the default apps for each of the domains that are present in LDAP but I’m not sure.

Still can’t actually do anything with the system – need to get past the postinst script but everything I do fails with the “Error: Could not find synapse in the list of installed apps:” message. Not even sure how that message is being generated since grep can’t find that string (or logical substrings) in any of the source files.


UTA 2025-03-01:

I thought maybe the issue might be something in LDAP so I did a dump of the data there and found a few lingering permissions from the original synapse installation: synapse.main, synapse.admin_api, and synapse.server_api. So I tried removing one of those via yunohost user permissions remove synapse.main but that failed:

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

# yunohost user permission remove synapse.main --debug
608  DEBUG   acquiring lock...
657  DEBUG   lock has been acquired
675  DEBUG   loading python module yunohost.user took 0.018s
676  DEBUG   processing action 'yunohost.user.permission.remove'
920  DEBUG   initializing root ldap interface
973  DEBUG   Nothing to update in LDAP
986  DEBUG   The permission database has been resynchronized
1058 INFO    The operation 'Update accesses for permission 'synapse'' could not be completed. Please share the full log of this operation using the command 'yunohost log share 20250301-151656-user_permission_update-synapse' to get help
1078 DEBUG   action executed in 0.402s
1079 DEBUG   lock has been released
1080 ERROR   Could not find synapse in the list of installed apps: 
*

Can anyone provide any insight? Next steps? More info to gather? Is the fact that the permission ‘synapse’’ has that second apostrophe significant? Going on a week with an unusable install now.

Let’s try this :

yunohost tools shell -c "ldap.remove('cn=synapse.main,ou=permission')"
yunohost tools shell -c "ldap.remove('cn=synapse.admin_api,ou=permission')"
yunohost tools shell -c "ldap.remove('cn=synapse.server_api,ou=permission')"

Ran the given commands and tried apt install -f. Encountered a few more obsolete permissions, removed those as well, ran apt install -f again, migration completed successfully. Then ran yunohost tools upgrade system to get yunohost-admin on the latest version, then apt install yunohost-portal since that was gone entirely.

System now appears to be in a usable state. I backed up and removed all the apps to try to eliminate some complexity while I was troubleshooting – I’ll try to restore some of those next and if that works out I’ll mark this one done.

Thanks Aleks, you’re a right proper old so-and-so.

Alright! I was able to restore the pre-migration backups (except for one), and diagnostics are showing clear, so I guess we’re done here. I’m going to open a new ticket for the backup restoration problem I’m having.

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