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

Aperta
#730 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@gabriele-wolfox ci sta già lavorando.

Dal 1/12/2026.

  • #752 di @gabriele-wolfox — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go, kubernetes
Ambito
backend, databases

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

Lingua principale
Go
Stelle
41
Fork
10
Merge medio
1g 8h
PR unite (30g)
171

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cloudnative-pg/klio

Tutte le issue di cloudnative-pg/klio

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.