Failed to upgrade multiple apps: "Aborting the upgrade, because a safety backup could not be created"

What type of hardware are you using: Old laptop or computer
What YunoHost version are you running: 12.1.28
How are you able to access your server: The webadmin
SSH
Are you in a special context or did you perform specific tweaking on your YunoHost instance ?: no

Describe your issue

Trying to upgrade both Immich and Ghost gives me errors. First error I get is Connection with the server has been closed for unknown reasons. Maybe 'yunohost-api' is down?
Then I try to run it again and get Aborting the upgrade, because a safety backup could not be created (A backup archive with the name 'immich/ghost-pre-upgrade2" already exists)

Share relevant logs or error messages

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

Aborting the upgrade, because a safety backup could not be created (A backup archive with the name 'immich/ghost-pre-upgrade2" already exists)

Hi @Sid

this might be normal to not backup content remaining after a failed migration.

Can you paste yunohost trace of the first failing upgrade if you can find it ?

a

sudo ls -la /home/yunohost.app

and

sudo find /home/yunohost.backup/

would given some ideas

Regards

I don’t think it’s normal to abort the upgrade though.

What’s a ā€œtraceā€?

sudo ls -la /home/yunohost.app

total 412
drwxr-xr-x    29 root          root            4096 Oct 13 10:17 .
drwxr-xr-x     9 root          root            4096 Feb  8  2025 ..
drwxr-x---     3 actual        actual          4096 May 26 11:35 actual
drwxr-x---     3 actual__2     actual__2       4096 May 26 12:51 actual__2
drwxr-x---     4 bonfire       www-data        4096 Oct 13 10:18 bonfire
drwxr-x---     3 ghost__2      www-data        4096 Feb  2  2025 castopod
drwxr-x---     2 gotosocial    gotosocial      4096 Jan 13  2025 django-fmd
drwxr-x---     2 pcp           pcp             4096 May 16  2024 emoncms
drwxr-x---     2 actual__2     actual__2       4096 Feb  5  2025 etherpad
drwxr-x---     2 cockpit       cockpit         4096 May 26 10:31 fathom
drwxr-x---     2 filegator     filegator       4096 Aug 21 16:49 filebrowser
drwxr-x---     2 swingmusic    swingmusic      4096 May 23 17:37 filebrowser__2
drwxr-x---     3 filegator     filegator       4096 Aug 21 20:46 filegator
drwxr-x---  1295 gotosocial    gotosocial    299008 Oct 13 10:53 gotosocial
drwxr-x---    10 homeassistant homeassistant   4096 Oct 13 08:39 homeassistant
drwxr-x---     8 immich        immich          4096 Nov 12  2024 immich
drwxr-x---     6 lemmy         lemmy           4096 Jun  5  2024 lemmy
drwxrwx---     3 collabora     www-data        4096 Feb 21  2025 limesurvey
drwxrwxrwx     4 immich        root            4096 Mar  1  2024 matrix-synapse
drwxr-x---     7 filegator     filegator       4096 Aug 18 19:34 mattermost
drwxrwx---     3 gotosocial    gotosocial      4096 Feb 16  2024 mobilizon
drwxr-x---     4 filegator     filegator       4096 Jul  6  2024 n8n
drwxr-x---     3 nextcloud     nextcloud       4096 Apr 26  2024 nextcloud
drwxr-x---     3 peertube      www-data        4096 Feb 11  2024 peertube
drwxrwxr-x+    2 filegator     filegator       4096 Sep 23  2024 qbittorrent
drwxr-x---     3 stirling-pdf  stirling-pdf    4096 Jun  2 15:20 snserver
drwxr-x---     2 stirling-pdf  stirling-pdf    4096 Aug 21 15:43 stirling-pdf
drwxr-x---    10 syncthing     syncthing       4096 Apr 26  2024 syncthing
drwxrwx---+    3 stirling-pdf  stirling-pdf    4096 Aug 11 11:52 tandoor
sudo find /home/yunohost.backup/
/home/yunohost.backup/
/home/yunohost.backup/archives
/home/yunohost.backup/archives/linkstack-pre-upgrade1.tar
/home/yunohost.backup/archives/onlyoffice-pre-upgrade2.tar
/home/yunohost.backup/archives/immich-pre-upgrade2.tar
/home/yunohost.backup/archives/peertube-pre-upgrade2.info.json
/home/yunohost.backup/archives/vaultwarden-pre-upgrade1.tar
/home/yunohost.backup/archives/actual-pre-upgrade2.tar
/home/yunohost.backup/archives/filebrowser__2-pre-upgrade1.tar
/home/yunohost.backup/archives/stirling-pdf-pre-upgrade1.info.json
/home/yunohost.backup/archives/tandoor-pre-upgrade1.tar
/home/yunohost.backup/archives/unattended_upgrades-pre-upgrade1.info.json
/home/yunohost.backup/archives/nextcloud-pre-upgrade1.tar
/home/yunohost.backup/archives/jellyfin-pre-upgrade1.info.json
/home/yunohost.backup/archives/castopod-pre-upgrade2.info.json
/home/yunohost.backup/archives/invoiceninja5-pre-upgrade1.info.json
/home/yunohost.backup/archives/invoiceninja5-pre-upgrade1.tar
/home/yunohost.backup/archives/owncast-pre-upgrade2.info.json
/home/yunohost.backup/archives/ghost-pre-upgrade2.info.json
/home/yunohost.backup/archives/nextcloud-pre-upgrade1.info.json
/home/yunohost.backup/archives/mastodon-pre-upgrade1.info.json
/home/yunohost.backup/archives/syncthing-pre-upgrade2.info.json
/home/yunohost.backup/archives/mobilizon-pre-upgrade1.info.json
/home/yunohost.backup/archives/ghost-pre-upgrade1.tar
/home/yunohost.backup/archives/immich-pre-upgrade2.info.json
/home/yunohost.backup/archives/castopod-pre-upgrade2.tar
/home/yunohost.backup/archives/actual-pre-upgrade2.info.json
/home/yunohost.backup/archives/ntfy-pre-upgrade2.tar
/home/yunohost.backup/archives/filebrowser-pre-upgrade2.info.json
/home/yunohost.backup/archives/actual__2-pre-upgrade2.info.json
/home/yunohost.backup/archives/mattermost-pre-upgrade2.tar
/home/yunohost.backup/archives/conduit-pre-upgrade2.tar
/home/yunohost.backup/archives/filebrowser-pre-upgrade2.tar
/home/yunohost.backup/archives/tandoor-pre-upgrade1.info.json
/home/yunohost.backup/archives/immich-pre-upgrade1.tar
/home/yunohost.backup/archives/actual__2-pre-upgrade2.tar
/home/yunohost.backup/archives/qbittorrent-pre-upgrade1.info.json
/home/yunohost.backup/archives/gotosocial-pre-upgrade2.info.json
/home/yunohost.backup/archives/homeassistant-pre-upgrade2.tar
/home/yunohost.backup/archives/mastodon-pre-upgrade1.tar
/home/yunohost.backup/archives/syncthing-pre-upgrade2.tar
/home/yunohost.backup/archives/collabora-pre-upgrade2.info.json
/home/yunohost.backup/archives/mobilizon-pre-upgrade1.tar
/home/yunohost.backup/archives/gotosocial-pre-upgrade2.tar
/home/yunohost.backup/archives/yunomonitor-pre-upgrade2.tar
/home/yunohost.backup/archives/qbittorrent-pre-upgrade1.tar
/home/yunohost.backup/archives/jellyfin-pre-upgrade1.tar
/home/yunohost.backup/archives/peertube-pre-upgrade2.tar
/home/yunohost.backup/archives/n8n-pre-upgrade1.info.json
/home/yunohost.backup/archives/ghost__2-pre-upgrade1.info.json
/home/yunohost.backup/archives/conduit-pre-upgrade2.info.json
/home/yunohost.backup/archives/collabora-pre-upgrade2.tar
/home/yunohost.backup/archives/lemmy-pre-upgrade1.tar
/home/yunohost.backup/archives/linkstack-pre-upgrade1.info.json
/home/yunohost.backup/archives/n8n-pre-upgrade1.tar
/home/yunohost.backup/archives/ntfy-pre-upgrade2.info.json
/home/yunohost.backup/archives/ghost__2-pre-upgrade1.tar
/home/yunohost.backup/archives/filebrowser__2-pre-upgrade1.info.json
/home/yunohost.backup/archives/freshrss-pre-upgrade2.tar
/home/yunohost.backup/archives/owncast-pre-upgrade2.tar
/home/yunohost.backup/archives/espocrm-pre-upgrade1.tar
/home/yunohost.backup/archives/libreddit-pre-upgrade2.info.json
/home/yunohost.backup/archives/libreddit-pre-upgrade2.tar
/home/yunohost.backup/archives/jitsi-pre-upgrade1.tar
/home/yunohost.backup/archives/unattended_upgrades-pre-upgrade1.tar
/home/yunohost.backup/archives/homeassistant-pre-upgrade2.info.json
/home/yunohost.backup/archives/jitsi-pre-upgrade1.info.json
/home/yunohost.backup/archives/freshrss-pre-upgrade2.info.json
/home/yunohost.backup/archives/yunomonitor-pre-upgrade2.info.json
/home/yunohost.backup/archives/mirotalk-pre-upgrade2.tar
/home/yunohost.backup/archives/lemmy-pre-upgrade1.info.json
/home/yunohost.backup/archives/onlyoffice-pre-upgrade2.info.json
/home/yunohost.backup/archives/mirotalk-pre-upgrade2.info.json
/home/yunohost.backup/archives/mattermost-pre-upgrade2.info.json
/home/yunohost.backup/archives/vaultwarden-pre-upgrade1.info.json
/home/yunohost.backup/archives/stirling-pdf-pre-upgrade1.tar
/home/yunohost.backup/archives/ghost-pre-upgrade2.tar
/home/yunohost.backup/archives/espocrm-pre-upgrade1.info.json
/home/yunohost.backup/tmp
/home/yunohost.backup/premigration

@Sid what i call traces are logs, normaly there be logs in web admin Tools/Logs ( different in french so wording might be different ) pasting them with YunoPaste is the way to get since it comes with some domain anonymisation. I guess you dont have those… some log tool is in yunhost : yunohost log

Could it be a problem with a shortage of disk space ?

ls -lh /home/yunohost.backup/archives/

du -h

There is a matrix-synapse app with immich user, migth be a former uninstalled application.
Is it is still running. ?

drwxrwxrwx 4 immich root 4096 Mar 1 2024 matrix-synapse

logs would of course tell more.

Regards

Went and looked again, and this is the only error log that I could find. It seems like it only keeps a handful of the most recent logs. This one was at the end of the list. It looks like the error from this log is:

2025-10-06 15:42:08,195: ERROR - provision_or_update failed for apt : An error occured inside the script snippet

Definitely not, I’ve got ~200GB free.

No, there is no Synapse installed or running.

I’m running into this as well with different apps on 2 different servers. E.g. 2025-10-14 23:12:46,994: DEBUG - temporary directory for backup '/home/yunohost.backup/tmp/searxng-pre-upgrade1' already exists... attempting to clean it (full log: https://paste.yunohost.org/raw/iseyumizak). When I manually remove the backups folder from the tmp directory I get another error (unfortunately I cannot even share the logs for this one as that action itself is producing an error). So, here’s a screenshot instead:

1 Like

After reviewing code to understand pre upgrade backup creation i concluded that when pre-upgrade1 and pre-upgrade2 are both in archive, upgrade will fail.

@Sid

clearly ( using sort on list help to see apps with two backups )

/home/yunohost.backup/archives/ghost__2-pre-upgrade1.info.json
/home/yunohost.backup/archives/ghost__2-pre-upgrade1.tar
/home/yunohost.backup/archives/ghost-pre-upgrade1.tar
/home/yunohost.backup/archives/ghost-pre-upgrade2.info.json
/home/yunohost.backup/archives/ghost-pre-upgrade2.tar

/home/yunohost.backup/archives/immich-pre-upgrade1.tar
/home/yunohost.backup/archives/immich-pre-upgrade2.info.json
/home/yunohost.backup/archives/immich-pre-upgrade2.tar

ghost__2 is something differenr, you may have multiple ghost installed on different domains, or anohter version of ghost … dunno but those are not conflicting.

in those you can either move the backups somewehre else, or remove the one that look like redundant …

in normal case only one should remain, once the pre backup is done successfully the previous one is removed.

Yes, I have 2 Ghost instances. The problem is clearly that there are multiple backups. The question is why, and why can’t the system figure that out and remove them as necessary? How does multiple backups prevent the system from updating?

Nadine said they removed the backups and just received another error.

This is more likely an error occuring during execution of the backup script of Ghost.
An error like ā€˜Aborting the upgrade, because a safety backup could not be create’ should appear.
Here normaly the new safety backup is not created, but if it is, this is were the problem arise.
If backup fails at pre upgrade previous file remains undeleted, this is what i understand from src/app.py code.

In normal case only one backup remains since upgrade take care of removing old pre-upgrade backup once a new one succeeded. If error is in upgrade process itself this is handled, but if error occur during backup creation, it is more blurry …

any application can still do its own mess through backup hook …

Backup is a two step action, first collect files with some in a temporary directory like for database dump then create the archive, potential using ynh tools.

What @Nadine did is to remove on tmp directy that is used during backup creation not on archive backups.
This might be the root causes of those issues.
i would think a temporary directory is expected to have a brand new name dedicated to this task. Here it is somehow specified, so can conflict with a previous failing backup.

ā€˜The devil in the details’

@Nadine

This too many open files has to be analyzed, why are there too many open file…
what contains /home/yunohost.backup/tmp/ ?
Is there a brand new ā€˜/home/yunohost.backup/tmp/searxng-pre-upgrade1’ created ?
And how many files does it contains ?

1 Like

bump

Same problem here

bumpety-bump