garethgeorge / backrest

Backrest is a web UI and orchestrator for restic backup.
GNU General Public License v3.0
787 stars 31 forks source link

ERROR: this element should not appear, this is a bug. #359

Open lucius346346 opened 5 days ago

lucius346346 commented 5 days ago

I have this message on top level of the Tree View. image

Backups are done outside of Backrest because I need to stop the docker containers before backup, which Backrest does not support.

arminus commented 1 day ago

I have the same issue with 1.2.0, didn't appear with 1.1.0

garethgeorge commented 1 day ago

For a bit of extra context -- is this happening in the repo view or the plan view or both?

Are both of you using externally created snapshots? Do they use any of the backrest tags e.g. plan or created-by?

I have some ideas re: why this might be popping up, will patch in the next release.

arminus commented 1 day ago

For a bit of extra context -- is this happening in the repo view or the plan view or both?

for me only in the repo view, I don't use plans (yet)

2024-07-01_202918

Are both of you using externally created snapshots? Do they use any of the backrest tags e.g. plan or created-by?

external snapshots from remote hosts via sftp. Not familiar with those tags...

I have some ideas re: why this might be popping up, will patch in the next release.

appreciate the work!

garethgeorge commented 1 day ago

Ah, thanks for the extra info. This is pretty fixable and can be backfixed for the existing imported operations:

Linking some code for my future reference --

bug is in https://github.com/garethgeorge/backrest/blob/main/internal/orchestrator/tasks/taskindexsnapshots.go#L185-L195 , should be setting a default instance ID e.g. _unassociated_ for imported snapshots if none can be inferred from tags. A low-risk oplog migration can be added to backfix this for operations that were imported incorrectly e.g. https://github.com/garethgeorge/backrest/blob/main/internal/oplog/migrations.go#L114C6-L114C28 can be reapplied.