I’m getting the same issue, or at least a very close one.
I have two servers, lets call them source and backup with 18 containers on.
Every night source updates backup with a copy --refresh, been working for years.
Yesterday one of the storage pools on source started to get close to being full so I stopped two of the containers and moved them into the other storage storage pool on the same server under new names, renamed them back to the original names and started them again.
That night the refresh of the two containers that were moved on source both failed, the rest were fine.
So I went to the backup machine, removed all traces of both the containers and their incomplete migration folders, making sure they were also removed from LXD SQL and the btrfs filesystem, both in the containers and containers-snapshots folders. Effectively making sure there was no trace of these containers on backup.
I then created fresh copies of the two containers on backup from source which worked…
lxc copy container backup:container --storage=default --mode=push
Which worked…
However whenever I try a refresh of those containers…
lxc copy container backup:container --refresh --storage=default --mode=push
It runs for a considerable amount of time transferring data into the migration folder then errors with…
Error: Failed instance migration: Failed migration on source: Error from migration control target: Failed creating instance on target: rename /var/snap/lxd/
common/lxd/storage-pools/default/containers/migration.844538622/2024-09-01-monthly/2024-09-01-monthly /var/snap/lxd/common/lxd/storage-pools/default/contain
ers-snapshots/container/2024-09-01-monthly: file exists
…which of course it does as this is a refresh.
I am now in a state where the containers exist on both machines but I cannot refresh them.
I have tried restarts and recopying multiple times, same error every time.
Both machines running:
Ubuntu 22.04.4 LTS
snap: lxd 6.1-78a3d8f
The next thing I am going to try is fully updating apt on both machines and trying again.