Closed sashokbg closed 1 year ago
Hi @sashokbg
Do you have any snapshot
objects in that namespace? kubectl get snapshots
? If you do, could you please post the yaml output of one of those?
It looks to me that a field is not correctly populated in the snapshot object when using the swift backend.
Hello @Kidswiss thank you for your message here are some yamls from the snapshots:
apiVersion: k8up.io/v1
kind: Snapshot
metadata:
creationTimestamp: "2023-05-14T02:00:26Z"
generation: 1
name: f4856c6f
namespace: home-cloud
resourceVersion: "85254"
uid: cc1e2de6-35e1-4dcd-934c-e36b06914cb3
spec:
date: "2023-03-27T02:00:20Z"
id: f4856c6fe842d6421187f9368171089fde4316bcf5c7a9053cceba10f192f339
paths:
- /home-cloud-postgresql.sql
apiVersion: k8up.io/v1
kind: Snapshot
metadata:
creationTimestamp: "2023-05-14T02:00:28Z"
generation: 1
name: f0cd4ef4
namespace: home-cloud
resourceVersion: "85267"
uid: d5a29422-c0b5-4d79-b4e4-a3f573592155
spec:
date: "2023-04-18T02:00:12Z"
id: f0cd4ef4c1f4d26b0eb823310303c2357ef14e7dbaf0f714b18b26abb2603ae0
paths:
- /data/data-nextcloud
Hello @Kidswiss I have worked on adding the swift support via EnvFrom variables in #657 can you please give me some directions where the NPE might be comming from ? I am not well versed in GO unfortunately :(
Hi @sashokbg
Sorry was a bit busy...
I just checked your snapshots
and I see that the field spec.repository
is missing. That's what's causing the nilpointer.
It should take the value of RESTIC_REPOSITORY
in the backup pod to populate this field. Could you please post a yaml of the backup pod? I'd like to check if all environment variables are available as expected.
EDIT: it might start to work if you use envFrom to inject following envVar:
RESTIC_REPOSITORY=swift:home-cloud-backup-storage/archives
Then you delete the existing snapshot
objects in the namespace and trigger a backup again.
Hello @Kidswiss
Good news your suggestion worked perfectly !!
I checked the snapshots and saw they did not have the repository field that was added recently so I checked my CRDs and found out I forgot to update them (silly me).
I updated the CRDs and then deleted all snapshots as you suggested and everything worked.
Thank you very much for your kind help
Description
When trying to run a manual backup (see yaml bellow) I get a strange null pointer exception.
Additional Context
Logs
Expected Behavior
Backup should work
Steps To Reproduce
Version of K8up
v4.2.2
Version of Kubernetes
v1.23.7
Distribution of Kubernetes
Bare metal