OADP Restic backup fails with an unable to open config file error

Creating a backup with the OADP utility fails with a unable to open config file: Stat: The specified key does not exist error.

Symptoms

When you view the list of backups, the status of the backup that you created is PartiallyFailed. For example:

cpd-cli oadp tenant-backup list

Example output:

NAME         STATUS           ERRORS  WARNINGS  CREATED      EXPIRES  STORAGE LOCATION   SELECTOR
cpd-backup   PartiallyFailed  35      0         <timestamp>  364d     dpa-sample-1       <none>

In the Velero pod log, you see an error message like in the following example:

error="pod volume backup failed: running Restic backup, stderr=Fatal: unable to open config file: 
Stat: The specified key does not exist.\nIs there a repository at the following location?\ns3:http://your-mino-server:9000/velero/cpdbackup/restic/cpd-instance\n: 
exit status 1" error.file="/remote-source/src/github.com/vmware-tanzu/velero/pkg/restic/backupper.go:199" 
error.function="github.com/vmware-tanzu/velero/pkg/restic.(*backupper).BackupPodVolumes" logSource="pkg/backup/backup.go:417"

Causes

This problem is a known issue for OADP backups. Velero does not recreate or update the Restic repository from the ResticRepository manifest if the Restic directories are deleted from object storage. For more information, see Velero issue 4421.

Diagnosing the problem

Create a Restic Backup CR for a namespace, empty the object storage bucket, and then recreate the Backup CR for the same namespace. The recreated Backup CR fails.

Resolving the problem

Run the following command:

oc delete backuprepository -n ${OADP_OPERATOR_PROJECT} <restic-repository-name>

For more information, see the section Restic Backup CR cannot be recreated after bucket is emptied in the Red Hat® documentation.