Open sagargulabani opened 3 weeks ago
@hors @cap1984 @tplavcic @nonemax Please can you please check on this one, Thanks. This is a hard blocker for us.
Hey @sagargulabani , thanks for reporting, we'll check it.
hi @inelpandzic , any update ?
Hi @inelpandzic we can also confirm this bug. This is the resource that was used, please note that it works on some clusters, but not all the time.
apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBClusterRestore
metadata:
name: bootstrap
spec:
pxcCluster: percona-cluster
backupSource:
destination: s3://percona-xtrabackup-bootstrap/common/bootstrap
s3:
credentialsSecret: percona
region: ""
endpointUrl: https://minio.redacted.tld/
Logs:
-4aeb-a212-fb33ccf5e9c7"}
2024-07-08T12:11:21.373Z INFO Observed a panic in reconciler: runtime error: invalid memory address or nil pointer dereference {"controller": "pxcrestore-controller",
"namespace": "default", "name": "bootstrap", "reconcileID": "4ff5700d-ec23-4aeb-a212-fb33ccf5e9c7"}
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=0x58 pc=0x1634635]
goroutine 77 [running]:
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile.func1()
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.0/pkg/internal/controller/controller.go:116 +0x1e5
panic({0x1aa5fe0?, 0x2e707b0?})
/usr/local/go/src/runtime/panic.go:914 +0x21f
github.com/percona/percona-xtradb-cluster-operator/pkg/apis/pxc/v1.(*PXCBackupStatus).GetStorageType(...)
/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/apis/pxc/v1/pxc_backup_types.go:140
github.com/percona/percona-xtradb-cluster-operator/pkg/pxc/backup.RestoreJob(0xc000ee89c0, 0xc000e73b00, 0xc000bcd400, {0xc001441b00, 0x32}, 0x0)
/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/pxc/backup/restore.go:140 +0x75
github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxcrestore.(*s3).Job(0xc0006ffda0?)
/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxcrestore/restorer.go:38 +0x32
github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxcrestore.(*ReconcilePerconaXtraDBClusterRestore).validate(0x1a8a960?, {0x204fa08, 0xc000d22750}, 0xc000ee89c
0, 0x204f998?, 0xc000bcd400?)
/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxcrestore/restore.go:80 +0x4b
github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxcrestore.(*ReconcilePerconaXtraDBClusterRestore).Reconcile(0xc0006ffda0, {0x204fa08, 0xc000d22750}, {{{0xc00
119fde0?, 0x5?}, {0xc00119fdd6?, 0xc000923d08?}}})
/go/src/github.com/percona/percona-xtradb-cluster-operator/pkg/controller/pxcrestore/controller.go:190 +0xf14
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile(0x2053448?, {0x204fa08?, 0xc000d22750?}, {{{0xc00119fde0?, 0xb?}, {0xc00119fdd6?, 0x0?}}})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.0/pkg/internal/controller/controller.go:119 +0xb7
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler(0xc0002890e0, {0x204fa40, 0xc00030cc80}, {0x1b4eb40?, 0xc000491f80?})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.0/pkg/internal/controller/controller.go:316 +0x3cc
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem(0xc0002890e0, {0x204fa40, 0xc00030cc80})
/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.17.0/pkg/internal/controller/controller.go:266 +0x1af
sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2()```
FYI As we're under a Percona support contract we've also raised this issue with the Percona support team. Ticket ID: CS0048052
I've found the issue - you need to have:
xtradb:
backup:
enabled: true
storages:
minio:
type: $your_storage
The important part is that the backup.storages
are set.
Anyway this should not segfault but generate a log message.
Edit: Updated resolution advice with the right key.
cc @inelpandzic @sagargulabani
@ydixken Thank you for the update. Just to clarify the above config belongs to the actual pxc database resource.
apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBCluster
which looks like
...
spec:
backup:
image: percona/percona-xtradb-cluster-operator:1.14.0-pxc8.0-backup-pxb8.0.35
pitr:
enabled: false
schedule:
- keep: 5
name: hourly-backup
schedule: 45 * * * *
storageName: s3-subdir-eu-west-2
storages:
s3-subdir-eu-west-2:
s3:
bucket: test-bucket/test
credentialsSecret: s3-backup-aws-creds
region: eu-west-2
schedulerName: default-scheduler
type: s3
Thanks for the heads-up!
Just to clarify, we've got following configured, before the storage was missing - and I've encountered the behavior you've described:
backup:
storages:
minio-bootstrap:
type: s3
s3:
bucket: "percona-xtrabackup-bootstrap"
endpointUrl: "https://minio.redacted.tld"
credentialsSecret: percona
To trigger a restore, I'm using:
apiVersion: pxc.percona.com/v1
kind: PerconaXtraDBClusterRestore
metadata:
name: bootstrap
spec:
pxcCluster: percona-cluster
backupSource:
destination: s3://percona-xtrabackup-bootstrap/prod
s3:
credentialsSecret: percona
region: ""
endpointUrl: https://minio.redacted.tld/
Maybe this helps out?
yes after I added the storages section, it did work for me.
glad to hear :-)
Report
I am trying to restore a backup to a new percona cluster without specifying the backupName. Since this is a new kubernetes cluster, I don't have the backup name with me.
More about the problem
My configuration
Steps to reproduce
1.Create a pxc cluster 2.Try to restore the cluster from s3 using the path, not the backup name.
Versions
Kubernetes - 1.30 Operator - 1.14 2024-06-29T16:21:47.452Z INFO setup Runs on {"platform": "kubernetes", "version": "v1.30.0-eks-036c24b"} 2024-06-29T16:21:47.452Z INFO setup Manager starting up {"gitCommit": "c85a021f2a21441500b02a2c0b3d17e8a8b25996", "gitBranch": "release-1-14-0", "buildTime": "2024-03-01T09:01:29Z", "goVersion": "go1.21.7", "os": "linux", "arch": "arm64"}
Anything else?
No response