[solved] I broke my Yunohost, what can I restore? (migration)

Hi all!

I ran the migration of 4 or 5 Yunohosts with minor or no problems at all. This one proves more difficult.

My YunoHost server

Hardware: VPS bought online
YunoHost version: limbo
I have access to my server : Through SSH | VNC-CLI
Are you in a special context or did you perform some particular tweaking on your YunoHost instance ? : perhaps:

  • diagnosis complains on behalf of Borg about an SSHFS-mount (backups go there);
  • the server turned out to not have rebooted for over a year, perhaps running a stale kernel or libraries while starting the migration the first time
  • there was still a sury.org-sources entry, only found out after starting to manually perform upgrades of packages

Description of my issue

The first time the migration ran, it corrected the sources to Bullseye, and then crashed on trying to upgrade MariaDB. I tried a few more times, but never got to 10.5; apt would revert to 10.3 when apt install mariadb-server. Hardly any package was installable (maybe because of stale sury.org versions?).

Finally, I pushed through with manual upgrade, losing Yunohost and Yunohost-admin (“I’ll reinstall them afterwards”, I thought).

Now Yunohost is reinstalled, but does not want to do anything until I run post-install. Post-install thinks I’m crazy and tells me to ask for help.

I have Borg-backups of the apps, and Yuno-backups of the apps and I think of the system, but feeding the (perhaps) system backups to post-install tells me there is no domain name. I am afraid to lose the permissions structure / match between apps and directories when I just start a blank server and import the backups.

Services are not available in /etc/init.d/; no yunohost, no yunohost-api, and also no mail server. Funnily enough, Nextcloud is running, seemingly without a problem. Wordpress, Roundcube and Opensondage run into a bad gateway; element chat tries to connect to the homeserver but Synapse is missing as well.

The non-functioning area is so large, that I don’t know which logs to post.

Help, hints or suggestions?

Well let’s take one problem at a time … Is Yunohost still complaining about the post-"re"install ?

Hi Aleks, thanks for your attention :slight_smile:

Yes, still complaining. This is what Yunohost tells me:

# yunohost --help
Error: YunoHost is not correctly installed. Please run 'yunohost tools postinstall'
# yunohost backup restore 20210926-194650
Info: Preparing archive for restoration...
Warning: unable to retrieve string to translate with key 'The following critical error happened during restoration: It looks like you're trying to re-postinstall a system that was already working previously ... If you recently had some bug or issues with your installation, please first discuss with the team on how to fix the situation instead of savagely re-running the postinstall ...' for default locale 'locales/en.json' file (don't panic this is just a warning)
Error: The following critical error happened during restoration: It looks like you're trying to re-postinstall a system that was already working previously ... If you recently had some bug or issues with your installation, please first discuss with the team on how to fix the situation instead of savagely re-running the postinstall ...
# 

Hmyeah so let’s run touch /etc/yunohost/installed

Sorry, I not only made a mess of the Yunohost, also of the forums. I thought to split my problem in a part ‘MariaDB is not co-operating’ and a part ‘I broke everything’.

I didn’t notice you replied to both threads, and continued in the other thread.

After touching /etc/yunohost/installed things start to look better, and complete restore from backup does not seem necessary at this moment.

I’ll let this thread ‘sleep’ for now!

My Yunohost is up and running again, migration finished. The other thread got too many gory details; to summarize:

  • If you got the same problem, try to make a backup of the whole server if you can and did not do that yet.
  • touch /etc/yunohost/installed
  • finish the Debian part of the upgrade:
    • apt update
    • apt upgrade
    • apt-get dist-upgrade / apt full-upgrade
    • if need be, un-hold packages: apt-mark showhold to find out which
  • try to run the migration half-nicely, yunohost tools migrations run 0021_migrate_to_bullseye --force-rerun
    • –force-rerun did not work for me, I did yunohost tools migrations run 0021_migrate_to_bullseye --skip
    • and then yunohost tools migrations run --accept-disclaimer
  • yunohost-services were not available. I recreated /etc/systemd/system/yunohost-api.service and yunohost-firewall.service in the same dir
    • find yunohost-api.service on github
    • same for yuhohost-firewall.service
    • enable each service and start it
    • systemctl enable yunohost-api and systemctl start yunohost-api
    • systemctl enable yunohost-firewall and systemctl start yunohost-firewall
  • Yunohost should now give semblance of being up and running

On my server Matrix/Synapse got under the bus during the procedure. Yunohost made a backup last time it got upgraded via the web GUI (just before I started the migration), so it was a quick repair:

  • yunohost backup list to find the correct backup
  • yunohost backup restore synapse-pre-upgrade1, in my case

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