vmware-tanzu / velero

Backup and migrate Kubernetes applications and their persistent volumes
https://velero.io
Apache License 2.0
8.42k stars 1.37k forks source link

Got panic when having pod volume backup with restic #7712

Closed danfengliu closed 2 months ago

danfengliu commented 2 months ago

What steps did you take and what happened:

Pod volume backup with restic failed due to panic as shown below:

Velero server pod log:

time="2024-04-20T15:46:03Z" level=info msg="Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference" DeleteBackupRequest="{\"name\":\"backup-6a9682c3-05ed-4601-beaa-4d598ef3267b-rtz6v\",\"namespace\":\"velero\"}" controller=deletebackuprequest controllerGroup=velero.io controllerKind=DeleteBackupRequest logSource="/go/pkg/mod/github.com/bombsimon/logrusr/v3@v3.0.0/logrusr.go:108" name=backup-6a9682c3-05ed-4601-beaa-4d598ef3267b-rtz6v namespace=velero reconcileID="\"4ea0e1da-9776-41f5-8351-f1ae874f1682\""
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
    panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x244281c]

goroutine 1053 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:116 +0x1e5
panic({0x2817ca0?, 0x471f030?})
    /usr/local/go/src/runtime/panic.go:770 +0x132
github.com/vmware-tanzu/velero/pkg/controller.(*backupDeletionReconciler).Reconcile(0xc0007263c0, {0x313ee40, 0xc001dc1050}, {{{0xc0008952f0?, 0x6?}, {0xc001282ec0?, 0x31?}}})
    /go/src/github.com/vmware-tanzu/velero/pkg/controller/backup_deletion_controller.go:318 +0x3d3c
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x3146ff8?, {0x313ee40?, 0xc001dc1050?}, {{{0xc0008952f0?, 0xb?}, {0xc001282ec0?, 0x0?}}})
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:119 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc000726460, {0x313ee78, 0xc0003918b0}, {0x2978f40, 0xc001534cc0})
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:316 +0x3bc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc000726460, {0x313ee78, 0xc0003918b0})
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:266 +0x1be
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:227 +0x79
created by sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2 in goroutine 862
    /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.2/pkg/internal/controller/controller.go:223 +0x5

What did you expect to happen:

The following information will help us better understand what's going on:

If you are using velero v1.7.0+:
Please use velero debug --backup <backupname> --restore <restorename> to generate the support bundle, and attach to this issue, more options please refer to velero debug --help

If you are using earlier versions:
Please provide the output of the following commands (Pasting long output into a GitHub gist or other pastebin is fine.)

Anything else you would like to add:

Environment:

Vote on this issue!

This is an invitation to the Velero community to vote on issues, you can see the project's top voted issues listed here.
Use the "reaction smiley face" up to the right of this comment to vote.