k8up-io / k8up

Kubernetes and OpenShift Backup Operator
https://k8up.io/
Apache License 2.0
717 stars 66 forks source link

getting started - Introduction Tutorial - ciphertext verification failed #970

Closed mortega89 closed 5 months ago

mortega89 commented 6 months ago

Description

the jobs goes EOF with ciphertext verification failed in logs:

Fatal: Fatal: config cannot be loaded: ciphertext verification failed Fatal: config or key is damaged: ciphertext verification failed

the status of pods are CrashLoopBackOff, suddenly Fail to Terminating.

descrbe CR backup: describe backup.txt job's pod LOG: logs_jobs.txt

Additional Context

Hi, I started to try k8up but unfortunately I get stopped at the early. I followed instructions to get started with the tutorial. (https://docs.k8up.io/k8up/tutorials/tutorial.html) I just got blocked after apply the backup.yaml as far as I understand, here i'm applying a CR object, so "backup-test" get applied, and suddenly two jobs got created.

the job backup-backup-test-prebackup and the backup-backup-test-0 goes EOF with ciphertext verification failed in logs.

Not sure how to proceed or if it's a restic core problem/k8up bug, I just tried to follow the guide using Kind instead of Minikube, with the same results.

I'm on KDE Neon 22

Thanks!

Logs

No response

Expected Behavior

to get the backup executed and the JOBS completed

Steps To Reproduce

kind: Backup
metadata:
  name: backup-test
spec:
  failedJobsHistoryLimit: 2
  successfulJobsHistoryLimit: 2
  backend:
    repoPasswordSecretRef:
      name: backup-repo
      key: password
    s3:
      endpoint: http://minio:9000
      bucket: backups
      accessKeyIDSecretRef:
        name: minio-credentials
        key: username
      secretAccessKeySecretRef:
        name: minio-credentials
        key: password

Version of K8up

v2.10.0

Version of Kubernetes

v 1.29

Distribution of Kubernetes

Minikube / Kind

Kidswiss commented 6 months ago

Hi @mortega89

Thanks for testing out K8up!

That it spawns two jobs is expected. However that one of them corrupts the repository isn't!

There used to be an issue with restic, if two restic init commands were triggered at the same time and the bucket was empty, then it would corrupt the repository. Seems like that still occurs from time to time...

I just saw that the tutorial points to old CRDs as well. In step 6 could you do:

kubectl apply -f https://github.com/k8up-io/k8up/releases/download/v2.10.0/k8up-crd.yaml --server-side

Can you try the following before applying the backup.yaml?


kubectl port-forward svc/minio 9000:9000 &
export RESTIC_REPOSITORY=s3:http://localhost:9000/backups/
export RESTIC_PASSWORD=p@ssw0rd
export AWS_ACCESS_KEY_ID=minio
export AWS_SECRET_ACCESS_KEY=minio123
restic init

If this helps, I'll rename this issue to reflect the race condition.

mortega89 commented 6 months ago

hi @Kidswiss , It's seems that the updated CRDs solve the problem, I tried as you described and it worked!

Message: "backup_backup-test" has 2 succeeded, 0 failed, and 0 started jobs

thanks a lot for your support!

TheBigLee commented 6 months ago

Fix for the tutorial: #971

Kidswiss commented 5 months ago

As the docs are fixed and the tutorials is working again, I'm closing here.