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

@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

halp

Sure would like to be able to upgrade to Immich stable…

Update: I feel like a big dummy. In the main menu there is a ā€œbackupā€ option. Went in there and deleted the backups and ran the upgrade again, and it worked fine. The bigger problem is that the GUI keeps getting disconnected and freezing so I never got a confirmation when the upgrade is completed…