distroless container issues #707

Closed
opened 2025-10-27 19:40:21 +00:00 by Brooke · 2 comments

When trying to setup backupbot with garage any attempt to create a backup fails as the container integrates no shell and abra wants to wrap the pre-hook command. see #1 and the below error:

$ abra app backup create garage.mirnet.org --chaos
Failed to run command bash -c 'set -o pipefail;/garage meta snapshot --all' in garage_mirnet_org_app.1.c43atpbbfv7of32266cgun8df: OCI runtime exec failed: exec failed: unable to start container process: exec: "bash": executable file not found in $PATH: unknown

backup finished

I have verified that running the command manually and extracting the snapshot from the host's /var/lib/docker/volumes/ dir works, so I believe this to be a limitation with abra.

note the garage dockerfile.

When trying to setup backupbot with garage any attempt to create a backup fails as the container integrates no shell and abra wants to wrap the pre-hook command. see [#1](https://git.coopcloud.tech/coop-cloud/garage/issues/1) and the below error: ``` $ abra app backup create garage.mirnet.org --chaos Failed to run command bash -c 'set -o pipefail;/garage meta snapshot --all' in garage_mirnet_org_app.1.c43atpbbfv7of32266cgun8df: OCI runtime exec failed: exec failed: unable to start container process: exec: "bash": executable file not found in $PATH: unknown backup finished ``` I have verified that running the command manually and extracting the snapshot from the host's /var/lib/docker/volumes/ dir works, so I believe this to be a limitation with abra. note the [garage dockerfile](https://git.deuxfleurs.fr/Deuxfleurs/garage/src/branch/main-v1/Dockerfile).
Owner

@Brooke I believe backup-bot-two is responsible for running the pre-hooks:

backupbot.py Lines 434 to 459 in e972ca24d8
def run_commands(commands):
for container, command in commands.items():
if not command:
continue
# Remove bash/sh wrapping
command = (
command.removeprefix("bash -c").removeprefix("sh -c").removeprefix(" ")
)
# Remove quotes surrounding the command
if (
len(command) >= 2
and command[0] == command[-1]
and (command[0] == "'" or command[0] == '"')
):
command = command[1:-1]
# Use bash's pipefail to return exit codes inside a pipe to prevent silent failure
command = f"bash -c 'set -o pipefail;{command}'"
logger.info(f"run command in {container.name}:")
logger.info(command)
result = container.exec_run(command)
if result.exit_code:
logger.error(
f"Failed to run command {command} in {container.name}: {result.output.decode()}"
)
else:
logger.debug(result.output.decode())

abra doesn't deal with this pipefail stuff, so that caught my eye. In general, abra is a very "thing client" for backup-bot-two and doesn't run the pre-hooks itself (afair). We could probably document this all better ala coop-cloud/backup-bot-two#74.

In general, we might need to special case these distroless containers...

Wanna open a ticket on https://git.coopcloud.tech/coop-cloud/backup-bot-two/issues?

@Brooke I believe `backup-bot-two` is responsible for running the pre-hooks: https://git.coopcloud.tech/coop-cloud/backup-bot-two/src/commit/e972ca24d8fffc8cb92b65e83044b836752d5730/backupbot.py#L434-L459 `abra` doesn't deal with this `pipefail` stuff, so that caught my eye. In general, `abra` is a very "thing client" for `backup-bot-two` and doesn't run the pre-hooks itself (afair). We could probably document this all better ala https://git.coopcloud.tech/coop-cloud/backup-bot-two/issues/74. In general, we might need to special case these distroless containers... Wanna open a ticket on https://git.coopcloud.tech/coop-cloud/backup-bot-two/issues?
Author

Ah my mistake, I should have checked for a backupbot repo #75

Ah my mistake, I should have checked for a backupbot repo [#75](https://git.coopcloud.tech/coop-cloud/backup-bot-two/issues/75)
Sign in to join this conversation.
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: toolshed/abra#707
No description provided.