abra app backup operates on compose files that are not in use #632

Closed
opened 2024-07-24 21:48:38 +00:00 by marlon · 6 comments

abra app backup runs the commands listed under deploy->labels->backupbot* for each compose*.yml file in the directory for a given recipe.

This causes an error when an optional compose file is included in a recipe but is not being used (i.e. it's not referenced in the config).

For example in the nextcloud recipe, compose.mariadb.yml and compose.postgres.yml are both included, and both include backup commands.
Typically only of these databases is enabled, via the configuration. But abra app backup tries to run the backup commands for both mariadb and postgres, and errors out on the one that hasn't been installed.

`abra app backup` runs the commands listed under deploy->labels->backupbot* for each compose*.yml file in the directory for a given recipe. This causes an error when an optional compose file is included in a recipe but is not being used (i.e. it's not referenced in the config). For example in the nextcloud recipe, compose.mariadb.yml and compose.postgres.yml are both included, and both include backup commands. Typically only of these databases is enabled, via the configuration. But `abra app backup` tries to run the backup commands for both mariadb and postgres, and errors out on the one that hasn't been installed.
marlon added the
bug
label 2024-07-24 21:48:38 +00:00
decentral1se added the
abra
backups
labels 2024-07-25 21:01:40 +00:00
Owner

Hey @marlon 👋 Thanks for raising this. That does seem to be a pretty bad bug. The thing is at the moment is that we're 50%+ through a re-design/implementation of the backup system that uses https://git.coopcloud.tech/coop-cloud/backup-bot-two It would be quite tricky to patch and release the fix atm 🤔

Hey @marlon 👋 Thanks for raising this. That does seem to be a pretty bad bug. The thing is at the moment is that we're 50%+ through a re-design/implementation of the backup system that uses https://git.coopcloud.tech/coop-cloud/backup-bot-two It would be quite tricky to patch and release the fix atm 🤔
Member

Can you provide which abra version and which backup-bot-two version you are using?
The new backupbot version (main branch) fetches the commands only from the running container. If a container is not running it's not able to get the pre/post commands:

backupbot.py Line 134 in cc049b858b
pre_commands[container] = prehook

backupbot.py Line 116 in cc049b858b
services = client.services.list()

client.services.list() is equivalent to docker service ls and lists only running services. Can you run docker service ls and look which services are running? Is there maybe an old zombie container left?

Can you provide which abra version and which backup-bot-two version you are using? The new backupbot version (main branch) fetches the commands only from the running container. If a container is not running it's not able to get the pre/post commands: https://git.coopcloud.tech/coop-cloud/backup-bot-two/src/commit/cc049b858b111b8b399d385f8897a3e604318c20/backupbot.py#L134 https://git.coopcloud.tech/coop-cloud/backup-bot-two/src/commit/cc049b858b111b8b399d385f8897a3e604318c20/backupbot.py#L116 `client.services.list()` is equivalent to `docker service ls` and lists only running services. Can you run `docker service ls` and look which services are running? Is there maybe an old zombie container left?
Author

Can you provide which abra version and which backup-bot-two version you are using?
The new backupbot version (main branch) fetches the commands only from the running container. If a container is not running it's not able to get the pre/post commands:

backupbot.py Line 134 in cc049b858b
pre_commands[container] = prehook

backupbot.py Line 116 in cc049b858b
services = client.services.list()

client.services.list() is equivalent to docker service ls and lists only running services. Can you run docker service ls and look which services are running? Is there maybe an old zombie container left?

Thanks for your attention! I was using abra version 0.9.0-beta-e3a0af5 and not using backup-bot-two, just the abra backup command documented here: https://docs.coopcloud.tech/operators/handbook/#how-do-i-backuprestore-my-app

But thanks to @decentral1se 's note I now understand that abra backup is not currently supported, and the fix is to use backup-bot-two instead. If appropriate I could update the above linked docs to reflect this?

> Can you provide which abra version and which backup-bot-two version you are using? > The new backupbot version (main branch) fetches the commands only from the running container. If a container is not running it's not able to get the pre/post commands: > https://git.coopcloud.tech/coop-cloud/backup-bot-two/src/commit/cc049b858b111b8b399d385f8897a3e604318c20/backupbot.py#L134 > https://git.coopcloud.tech/coop-cloud/backup-bot-two/src/commit/cc049b858b111b8b399d385f8897a3e604318c20/backupbot.py#L116 > `client.services.list()` is equivalent to `docker service ls` and lists only running services. Can you run `docker service ls` and look which services are running? Is there maybe an old zombie container left? Thanks for your attention! I was using abra version 0.9.0-beta-e3a0af5 and not using backup-bot-two, just the `abra backup` command documented here: https://docs.coopcloud.tech/operators/handbook/#how-do-i-backuprestore-my-app But thanks to @decentral1se 's note I now understand that `abra backup` is not currently supported, and the fix is to use backup-bot-two instead. If appropriate I could update the above linked docs to reflect this?
Owner

@marlon thx, yeh maybe pointing to anything with issue label "backups" + "bug" and saying we're working on the new version and trying to avoid dealing with backporting fixes atm... something something "try out backup-bot-two? Unsure... it's all a bit unstable atm. i know a couple of collectives are using backup-bot-two a lot so you could get some additional help from the Matrix tech channel 🙏

@marlon thx, yeh maybe pointing to anything with issue label "backups" + "bug" and saying we're working on the new version and trying to avoid dealing with backporting fixes atm... something something "try out `backup-bot-two`? Unsure... it's all a bit unstable atm. i know a couple of collectives are using `backup-bot-two` a lot so you could get some additional help from the Matrix tech channel 🙏
Owner
Related https://git.coopcloud.tech/coop-cloud/nextcloud/issues/43#issuecomment-21286
Owner

backup-bot-two is quite stable now, hopefully migrating to that is an acceptable fix for this. The soon (hopefully) to be released abra will also support it. Also, I've opened up a discussion to see what we should do for backup-bot in general: coop-cloud/backup-bot#5 Unsure what more can be done, gonna close this now. Feel free to re-open if there is something to handle!

`backup-bot-two` is quite stable now, hopefully migrating to that is an acceptable fix for this. The soon (hopefully) to be released `abra` will also support it. Also, I've opened up a discussion to see what we should do for `backup-bot` in general: https://git.coopcloud.tech/coop-cloud/backup-bot/issues/5 Unsure what more can be done, gonna close this now. Feel free to re-open if there is something to handle!
Sign in to join this conversation.
No description provided.