Cannot backup JuiceFS PVCs using restic without root

Đang mở
#1,982 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
72/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
kubernetes, shell
Lĩnh vực
devops, infrastructure

Hướng nghiên cứu

Bắt đầu với mover-restic/entry.sh, đặc biệt kiểm tra check_contents và do_backup, đồng thời so sánh các loại trừ lost+found hiện có với các tệp JuiceFS được báo cáo. Chạy các kiểm tra restic mover liên quan trên một JuiceFS PVC không chạy với root và xác minh rằng .accesslog, .config và .stats được bỏ qua mà không yêu cầu privileged mode.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

bug

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
 }

Ngôn ngữ chính
Go
Star
1k
Fork
103
Merge trung bình
2 ngày 1 giờ
Pull request đã merge (30 ngày)
47

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của backube/volsync

Tất cả issue của backube/volsync

Issue tương tự

Thêm issue về Go

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.