When backups are performed using Velero, whether executed immediately or through a scheduled process, issues may arise. There can be multiple possible causes of the issues. This article outlines how to collect data to help diagnose the potential causes of these issues.
Prerequisities
Make sure to log in to the server as root, and run export KUBECONFIG=/etc/rancher/rke2/rke2.yaml && export PATH=$PATH:/var/lib/rancher/rke2/bin to enable the kubectl functionalities.
Both the uipathctl and velero binaries required for diagnosing the issues are located in the /opt/UiPathAutomationSuite/<version>/installer/bin directory. The first step is to change into this directory.
Steps to diagnose
The first step is to check the status of the backup:
The command /bin/velero backup get provides a list of backups, showing which ones completed successfully and which ones failed.
The command ./bin/velero backup describe <backup-name> displays detailed information about a backup failure, including any hooks that did not succeed.
If the errors is not clear, get the output as a file and raise a ticket with UiPath Support.
After having identified the failed backups and the type of failures, check the logs of the failed backup to identify the actual cause of errors. Check for logs in two places:
kubectl -n velero logs deploy/velero will show the logs for all the backup operations taking place.
To get logs specific to a particular failed backup, use ./bin/velero backup logs <backup-name>
Sometimes the logs might be difficult to read as multiple log records might be condensed into a single log record. In such cases, searching the logs with grep -i error helps.
In case the errors still cannot be identified, extract the logs and share with UiPath Support
If the errors appear to be due to a hook failure:
Check if the failure is due to a pre-hook or a post-hook
The service that is called to run backup hooks is backup-hook-service under uipath-infra namespace, and the pre-hook/post-hook scripts are run with bash script provided through the backup-hook-script-cm configmap.
Collect the outputs of kubectl -n uipath-infra get deploy/backup-hook-service and kubectl -n uipath-infra get cm backup-hook-script-cm
In case the above steps do not help in successful identification of the issue, collect all the required details as mentioned above, along with the support bundle generated by following this KB Article, and reach out to UiPath Support.