vmware-tanzu / helm-charts

Contains Helm charts for Kubernetes related open source tools
https://vmware-tanzu.github.io/helm-charts/
Apache License 2.0
254 stars 363 forks source link

BackupStorageLocation is invalid, marking as unavailable #581

Closed Veeraraghavans closed 6 months ago

Veeraraghavans commented 6 months ago

What steps did you take and what happened: Was using installation steps to deploy the Velero. Created Azure Storage resources and its permission followed workload identity method to create resource. It gave following error

time="2024-05-24T12:21:37Z" level=error msg="Error getting backup store for this location" backupLocation=velero/velero controller=backup-sync error="rpc error: code = Unknown desc = storageAccount is required in BSL" error.file="/go/pkg/mod/github.com/vmware-tanzu/velero@v1.13.0/pkg/util/azure/storage.go:70" error.function=github.com/vmware-tanzu/velero/pkg/util/azure.NewStorageClient logSource="pkg/controller/backup_sync_controller.go:101"
time="2024-05-24T12:21:42Z" level=error msg="Error getting a backup store" backup-storage-location=velero/velero controller=backup-storage-location error="rpc error: code = Unknown desc = storageAccount is required in BSL" error.file="/go/pkg/mod/github.com/vmware-tanzu/velero@v1.13.0/pkg/util/azure/storage.go:70" error.function=github.com/vmware-tanzu/velero/pkg/util/azure.NewStorageClient logSource="pkg/controller/backup_storage_location_controller.go:137"
time="2024-05-24T12:21:42Z" level=info msg="BackupStorageLocation is invalid, marking as unavailable" backup-storage-location=velero/velero controller=backup-storage-location logSource="pkg/controller/backup_storage_location_controller.go:120"
time="2024-05-24T12:21:42Z" level=error msg="Current BackupStorageLocations available/unavailable/unknown: 0/1/0, BackupStorageLocation \"velero\" is unavailable: rpc error: code = Unknown desc = storageAccount is required in BSL)" controller=backup-storage-location logSource="pkg/controller/backup_storage_location_controller.go:178"
time="2024-05-24T12:21:42Z" level=warning msg="There is no existing BackupStorageLocation set as default. Please see `velero backup-location -h` for options." controller=backup-storage-location logSource="pkg/controller/backup_storage_location_controller.go:187"
time="2024-05-24T12:22:37Z" level=error msg="Error getting backup store for this location" backupLocation=velero/velero controller=backup-sync error="rpc error: code = Unknown desc = storageAccount is required in BSL" error.file="/go/pkg/mod/github.com/vmware-tanzu/velero@v1.13.0/pkg/util/azure/storage.go:70" error.function=github.com/vmware-tanzu/velero/pkg/util/azure.NewStorageClient logSource="pkg/controller/backup_sync_controller.go:101"

I created backup resource with following command

velero backup-location create default --provider=azure --bucket=azwexxxvelero --config storageAccount=azwexxxveleroacc,resourceGroup=azweyyy-rg,subscriptionId=id,storageAccountKeyEnvVar=key --default

Post above command it gave following error:

time="2024-05-24T12:34:42Z" level=error msg="Current BackupStorageLocations available/unavailable/unknown: 0/2/0, BackupStorageLocation \"velero\" is unavailable: rpc error: code = Unknown desc = storageAccount is required in BSL)" controller=backup-storage-location logSource="pkg/controller/backup_storage_location_controller.go:178"
time="2024-05-24T12:35:37Z" level=error msg="Error getting backup store for this location" backupLocation=velero/velero2 controller=backup-sync error="rpc error: code = Unknown desc = no storage account access key with key mjvRhzGKAl2FiIW7dxFfXmUqx2qfx/MRtqgSe5tTZyV/ato1cGeJS999Bg0JMXJXKVSW8fHDClbO+AStJRzyRQ== found in credential" error.file="/go/pkg/mod/github.com/vmware-tanzu/velero@v1.13.0/pkg/util/azure/storage.go:136" error.function=github.com/vmware-tanzu/velero/pkg/util/azure.GetStorageAccountCredentials logSource="pkg/controller/backup_sync_controller.go:101"
time="2024-05-24T12:35:37Z" level=error msg="Error getting backup store for this location" backupLocation=velero/velero controller=backup-sync error="rpc error: code = Unknown desc = storageAccount is required in BSL" error.file="/go/pkg/mod/github.com/vmware-tanzu/velero@v1.13.0/pkg/util/azure/storage.go:70" error.function=github.com/vmware-tanzu/velero/pkg/util/azure.NewStorageClient logSource="pkg/controller/backup_sync_controller.go:101"
time="2024-05-24T12:35:42Z" level=error msg="Error getting a backup store" backup-storage-location=velero/velero controller=backup-storage-location error="rpc error: code = Unknown desc = storageAccount is required in BSL" error.file="/go/pkg/mod/github.com/vmware-tanzu/velero@v1.13.0/pkg/util/azure/storage.go:70" error.function=github.com/vmware-tanzu/velero/pkg/util/azure.NewStorageClient logSource="pkg/controller/backup_storage_location_controller.go:137"
time="2024-05-24T12:35:42Z" level=info msg="BackupStorageLocation is invalid, marking as unavailable" backup-storage-location=velero/velero controller=backup-storage-location logSource="pkg/controller/backup_storage_location_controller.go:120"
time="2024-05-24T12:35:42Z" level=error msg="Current BackupStorageLocations available/unavailable/unknown: 0/2/0, BackupStorageLocation \"velero\" is unavailable: rpc error: code = Unknown desc = storageAccount is required in BSL)" controller=backup-storage-location logSource="pkg/controller/backup_storage_location_controller.go:178"
time="2024-05-24T12:35:42Z" level=error msg="Error getting a backup store" backup-storage-location=velero/velero2 controller=backup-storage-location error="rpc error: code = Unknown desc = no storage account access key with key mjvRhzGKAl2FiIW7dxFfXmUqx2qfx/MRtqgSe5tTZyV/ato1cGeJS999Bg0JMXJXKVSW8fHDClbO+AStJRzyRQ== found in credential" error.file="/go/pkg/mod/github.com/vmware-tanzu/velero@v1.13.0/pkg/util/azure/storage.go:136" error.function=github.com/vmware-tanzu/velero/pkg/util/azure.GetStorageAccountCredentials logSource="pkg/controller/backup_storage_location_controller.go:137"

Output of backup location

NAME      PROVIDER   BUCKET/PREFIX    PHASE         LAST VALIDATED                   ACCESS MODE   DEFAULT
default   azure      azwexxxvelero Unavailable   2024-05-24 15:47:52 +0200 CEST   ReadWrite     true

What did you expect to happen:

Expect the backup location is enabled to create backup of my K8s cluster.

Environment:

Veeraraghavans commented 6 months ago

I fixed it myself. I recreated the secret it worked.

gitafolabi commented 1 month ago

@Veeraraghavans Could you clarify if you meant you recreated a Kubernetes secret?