Skip to content

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

Closed

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

Activity

  1. locked and limited conversation to collaborators on Sep 4, 2026
  2. converted this issue into a discussion #515 on Sep 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions