Server gets stuck in CrashLoopBackOff if restarted during first-time repository initialization

Đang mở
#730 0 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

@gabriele-wolfox đang làm issue này rồi.

Từ ngày 1/12/2026.

  • #752 của @gabriele-wolfox — đang mở

Đá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
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
go, kubernetes
Lĩnh vực
backend, databases

Hướng nghiên cứu

Start in core/cmd/initialize/initialize.go at verifyExistingRepositories and trace how it handles a non-empty but incomplete Kopia directory after kopia repository create is interrupted. Use the reproduction steps with the sample at operator/config/samples/klio_v1alpha1_server.yaml to inspect recovery after restarting the Pod. Done means initialization can recover from this interrupted first start instead of repeatedly failing repository password verification.

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

Mô tả

Description

If the server Pod is restarted while it is initializing the repositories for
the first time, it never recovers. The /klio PVC is retained, the WAL
repository is already initialized and the Kopia directory is non-empty but
incomplete, so every following start fails and the Pod stays in
CrashLoopBackOff.

Steps to reproduce

The window is short, so the result is intermittent.

  1. Create a Server from operator/config/samples/klio_v1alpha1_server.yaml
    in a new namespace.
  2. As soon as the server container starts, force-delete the Pod while
    kopia repository create is running:
    kubectl delete pod <server>-klio-0 --grace-period=0 --force
  3. The StatefulSet recreates the Pod with the retained, partially
    initialized /klio volume.

Actual behavior

verifyExistingRepositories (core/cmd/initialize/initialize.go) treats the
non-empty Kopia directory as an existing repository and tries to verify it:

WAL repository exists, verifying password
WAL repository password verified successfully
Kopia repository exists, verifying password
error connecting to repository: repository not initialized in the provided storage
Error: kopia repository exists but password verification failed: ...

The Pod exits and restarts with the same error indefinitely.

Evidence

ServerTierReconfiguration (e2e) hits this when its tier2 update lands while
Kopia init is still running. It fails with server Pod not ready after tier2 reconfiguration, and the server log shows the sequence above. Seen in:

Ngôn ngữ chính
Go
Star
41
Fork
10
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
171

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

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 cloudnative-pg/klio

Tất cả issue của cloudnative-pg/klio

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.