Cannot delete backup stuck in "starting" state

Hello together,

in most of the cases PBM works great, but now I have a “not-backup” in my backups list which cannot be deleted:

...
    2022-09-09T22:05:14Z 26.96GB <logical> [complete: 2022-09-09T22:35:35Z]
    2022-09-03T22:05:15Z 26.96GB <logical> [complete: 2022-09-03T22:34:27Z]
    2022-08-31T10:05:11Z 0.00B <logical> [ERROR: Backup stuck at `starting` stage, last beat ts: 1661940427] [2022-08-31T10:07:07Z]
    2022-08-28T04:05:10Z 24.96GB <logical> [complete: 2022-08-28T04:35:08Z]
    2022-08-20T22:05:15Z 24.94GB <logical> [complete: 2022-08-20T22:33:46Z]

Result when I try to delete it:

Are you sure you want delete backup(s)? [y/N] y
Waiting for delete to be done ..Error: deleting: unable to delete backup in starting state

Any ideas? - Thanks in advance! Andreas

1 Like

Hi Andreas,

I know this is a late reply. Did you try cancelling the backup before removing it?

Thank you!

1 Like

Hi Pep,

I wasn’t able to fix this yet, so I was quite happy about your late reply. :slight_smile: Nevertheless, I was not able to fix it with your recommendation. The cancel command only works for the one backup that is currently running and it sadly had no effect on my stuck one. :-/ Maybe I can fix it directly inside the database?

Best regards,

Andreas

1 Like

Hi Andreas,

Looking at the code of pbm, deleting a backup involves two main steps:

  • Delete the files from storage.
  • Delete the metadata from the database.

I guess that if the backup was starting, there were no files written. You may clean the metadata.

I hope this helps.

Pep

PS: You may find the code here: percona-backup-mongodb/delete.go at main · percona/percona-backup-mongodb · GitHub
This is one of the advantages of FOSS… you always can look at the code.

2 Likes

Thank you @Pep_Pla ! Since no files have been created yet, I simply deleted the entry from the database and the item on the list disappeared. :partying_face:

2 Likes