lawndoc / lawndoc/stack-back

Podman socket access denied for backup container

Open
#92 2 comments 0 reactions 1 assignee View on GitHub

@lawndoc is already working on this.

Since Dec 2, 2025.

bug podman
Dominant language
Python
Stars
180
Forks
12
PR merge metrics
No merged PRs in 30d

Description

Hi, I wanted to try this image with podman-compose but the rcb backup command fails with permission denied. I already tried to change the permissions of the socket to rw for all users that didn't help.

It worked by adding privileged=True to the backup container here: https://github.com/lawndoc/stack-back/blob/e11842b44b6d9b146b1234fc90fce83a146a2d44/src/restic_compose_backup/backup_runner.py#L20-L30

Am I doing something wrong in my configuration?

I am running Podman using podman machine on macos.

compose.yml

services:
  stack-back:
    image: ghcr.io/lawndoc/stack-back:v1.5.3
    restart: unless-stopped
    privileged: true
    environment:
      RESTIC_REPOSITORY: /srv/restic-repo
      RESTIC_PASSWORD: test
      DOCKER_HOST: unix://var/run/docker.sock
    volumes:
      - /run/user/501/podman/podman.sock:/var/run/docker.sock
      - ./backup:/srv/restic-repo

Error message from backup container:

Traceback (most recent call last):
  File "/restic-compose-backup/.venv/bin/rcb", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/restic-compose-backup/restic_compose_backup/cli.py", line 23, in main
    containers = RunningContainers()
  File "/restic-compose-backup/restic_compose_backup/containers.py", line 400, in __init__
    all_containers = utils.list_containers()
  File "/restic-compose-backup/restic_compose_backup/utils.py", line 39, in list_containers
    client = docker_client()
  File "/restic-compose-backup/restic_compose_backup/utils.py", line 29, in docker_client
    return docker.from_env()
           ~~~~~~~~~~~~~~~^^
  File "/restic-compose-backup/.venv/lib/python3.14/site-packages/docker/client.py", line 94, in from_env
    return cls(
        timeout=timeout,
    ...<3 lines>...
        **kwargs_from_env(**kwargs)
    )
  File "/restic-compose-backup/.venv/lib/python3.14/site-packages/docker/client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
               ~~~~~~~~~^^^^^^^^^^^^^^^^^
  File "/restic-compose-backup/.venv/lib/python3.14/site-packages/docker/api/client.py", line 207, in __init__
    self._version = self._retrieve_server_version()
                    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/restic-compose-backup/.venv/lib/python3.14/site-packages/docker/api/client.py", line 230, in _retrieve_server_version
    raise DockerException(
        f'Error while fetching server API version: {e}'
    ) from e
docker.errors.DockerException: Error while fetching server API version: ('Connection aborted.', PermissionError(13, 'Permission denied'))

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.