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

未关闭
#730 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

@gabriele-wolfox 已经在做这个了。

开始于 2026年12月1日。

  • #752 来自 @gabriele-wolfox —— 未关闭

评估

难度
3/5
预计耗时
1-2 天
新手友好度
72/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
go, kubernetes
领域
backend, databases

调研方向

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.

由索引模型根据 Issue 内容生成。

描述

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:

主要语言
Go
星标
41
派生
10
平均合并
1 天 8 小时
30 天内合并 PR
171

环境准备

  • 没有 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

cloudnative-pg/klio 的其他 Issue

查看 cloudnative-pg/klio 的全部 Issue

相似的 Issue

更多 Go Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。