Skip to content

Cannot backup JuiceFS PVCs using restic without root #1982

Open

Description

@gjabell

Describe the bug

Similar to lost+found on ext4, PVCs managed by JuiceFS have special files (.accesslog, .config, .stats) that are always owned by root, which prevents non-root restic backups (and presumably rclone, etc.) from progressing.

Having to switch the mover to privileged just to work around this issue is non-ideal, especially since these files shouldn't be backed up in the first place.

Steps to reproduce

Expected behavior

These files are skipped in the same way lost+found is skipped on ext4 (#1033). Ideally a more generic solution (#959) would be supported that allows skipping arbitrary files without needing workarounds per-filesystem.

Actual results

Additional context

I've applied the following patch on my own image to work around this issue:

--- /mover-restic/entry.sh
+++ /mover-restic/entry.sh
@@ -80,7 +80,7 @@ function check_var_defined {

 function check_contents {
     echo "== Checking directory for content ==="
-    DIR_CONTENTS="$(ls -A "${DATA_DIR}" --ignore="lost+found")"
+    DIR_CONTENTS="$(ls -A "${DATA_DIR}" --ignore="lost+found" --ignore=".accesslog" --ignore=".config" --ignore=".stats")"
     if [ -z "${DIR_CONTENTS}" ]; then
         echo "== Directory is empty skipping backup ==="
         exit 0
@@ -154,7 +154,7 @@ function ensure_initialized {
 function do_backup {
     echo "=== Starting backup ==="
     pushd "${DATA_DIR}"
-    "${RESTIC[@]}" backup --host "${RESTIC_HOST}" --exclude='lost+found' .
+    "${RESTIC[@]}" backup --host "${RESTIC_HOST}" --exclude='lost+found' --exclude='.accesslog' --exclude='.config' --exclude='.stats' .
     popd
 }

Activity

  1. Yub0 commented on Aug 27, 2026

    @Yub0

    Additional data point from a JuiceFS CSI (v0.28) + VolSync 0.16.0 deployment on k3s (Elastic Metal bare metal, RWO CSI PVCs):

    We hit a harder variant of this: the mover doesn't fail on permissions, it hangs forever, even when running as root.

    Root cause analysis

    mover-restic/entry.sh (v0.16.0, line 157):

    "${RESTIC[@]}" backup --host "${RESTIC_HOST}" --exclude='lost+found' .

    JuiceFS recreates three virtual files at every mount of the volume (they are FUSE properties of the mount, not files on the volume):

    • .accesslog — an endless stream with no EOF
    • .stats — on-demand virtual file
    • .config — virtual file

    restic backup . walks the directory and tries to read .accesslog, which never reaches EOF. The mover stays in Running indefinitely (observed: 45 min with ~0 CPU and no network progress before we killed it). We also confirmed --exclude is not configurable through the VolSync CRD (no excludedPaths field for the restic mover in the v0.16.0 CRD spec), so there is no user-side workaround.

    We also tested:

    • Snapshot-based copyMethod: Clone/Snapshot → does not help: the mover still mounts the cloned PVC, and juicefs recreates .accesslog on that mount too.
    • moverSecurityContext with fsGroup/runAsUser → irrelevant, the file is an endless stream regardless of permissions.

    What we use instead (works reliably): a dedicated CronJob that mounts the same PVC and runs restic backup /source --exclude=.stats --exclude=.config --exclude=.accesslog. The excludes make the backup complete in seconds/minutes depending on data size.

    Suggestion

    Either of the following would fix this for FUSE filesystems with virtual files:

    1. Expose excludedPaths/resticOptions on the restic mover spec (overlaps with Support excludes in restic mover #677), or
    2. Add the JuiceFS virtual files to the hardcoded exclusion list next to lost+found (they are filesystem properties, analogous to lost+found).
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

    bugSomething isn't working

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions