Open mattlrx opened 1 year ago
@mattlrx The role already deletes the master_key_label.kdb file at the end of the role https://github.com/ibm-mas/ansible-devops/blob/master/ibm/mas_devops/roles/db2_backup/tasks/main.yml#L136 so I can only assume that there was a previous attempt to run the backup that didn't complete?
that is correct, it failed previously. I am aware of 2 people who ran into this issue.
I can also confirm that when it ran successfuly, the file was removed.
@mattlrx thanks for the feedback. I think we can add a similar task like https://github.com/ibm-mas/ansible-devops/blob/master/ibm/mas_devops/roles/db2_backup/tasks/main.yml#L136 to cleanup any existing files at the start of that role. Then when a previous backup has failed then the next run of the backup role can cleanup before running.
You may also want to delete old backups remaining on the pod, because it may lead the pod to exceed ephemeral storage limit. I run these commands after unsuccessful db2 backup.
oc exec -it -n db2u c-db2w-shared-db2u-0 -- bash -c "sudo rm -rf /mnt/blumeta0/home/db2inst1/db_backup"
oc exec -it -n db2u c-db2w-shared-db2u-0 -- bash -c "sudo rm -rf /mnt/blumeta0/db2/keystore/master_key_label.kdb"
executing db2_backup role fails because the file master_key_label.kdb already existed in /mnt/blumeta0/db2/keystore/
the error was:
to workaround this issue, I renamed the existing file:
cd /mnt/blumeta0/db2/keystore/
mv master_key_label.kdb master_key_label.kdb_bkp
then rerun the playbook
for information, the playbook is: