Skip to content

Permission Denied When Writing Backups to NFS Volume Despite Correct UID/GID Configuration #415

@ajmarmar

Description

@ajmarmar

Summary

When using an NFS-mounted volume as the backup destination, the container consistently fails with permission denied errors when attempting to write backups, despite correctly setting the UID and GID of the NFS-permitted user via environment variables and the user directive in docker-compose.yml.

Steps to reproduce

  • Mount an NFS share on the Docker host at /mnt/data

  • Ensure that the NFS share is owned by the userbck user, who has read and write permissions.

    • Configure the docker-db-backup container with:

    • Environment variables USER_DBBACKUP and GROUP_DBBACKUP matching the UID and GID of userbck

    • A volume mapping:
      volumes:
      - /mnt/data:/backup

    • Start the container and trigger a backup.

What is the expected correct behavior?

The container should be able to write backup files to the /backup directory (which is the NFS share mounted on the host) without permission errors.

Environment

Image version / tag: tiredofit/db-backup:latest
Host OS: Ubuntu 20.04

tiredofit/db-backup:4.1.19 16:00:41 /backup] $ backup01-now 2025-06-25.16:00:43 [INFO] ** [db-backup01] Starting Manual Backup for db-backup01 chmod: changing permissions of '/backup/keydb': Operation not permitted mkdir: cannot create directory ‘/backup/temp’: Permission denied stat: cannot statx '/backup/temp': No such file or directory chown: cannot access '/backup/temp': No such file or directory mktemp: failed to create directory via template ‘/backup/temp/01_dbbackup.XXXXXX’: No such file or directory chown: cannot access '': No such file or directory 2025-06-25.16:00:44 [NOTICE] ** [01keydb] Dumping Redis - Flushing Redis Cache First ... .... ....

Possible fixes

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions