Failed to set Longhorn RestAPI Endpoint

Failed to set Longhorn RestApi Endpoint.

Issue Description: Failed to set Longhorn RestAPI Endpoint. This error can occur during upgrades, when status of Longhorn is verified.


Root Cause: In versions below 23.10.4, the Longhorn migration did not remove the Longhorn storage class, leading to this issue. If Automation Suite is not on 23.10, then that means that the issue is simply that Longhorn is unhealthy.


Resolution:

  1. If Automation Suite is not on a 23.10.X version, or if the Longhorn migration has not occurred then do not follow this guide
    • A quick check would be to run the following command:
kubectl get crd | grep longhorn | wc -l
  1. On a 23.10 instance where the longhorn migration has been performed, this would return 0
  2. On other instances, it will return a number greater than 0
  3. If the above returns something greater than zero, do not run this. If it returns a number greater than zero, and Automation Suite is on 23.10.X, it means the migration needs to be performed (or the uninstall was incomplete). See Performing Post-Upgrade Operations (Longhorn would still need to be in a healthy state before doing this step). Do not enforce the Longhorn migration, until upgrades to 24.X. But it is highly recommend to perform this migration
  4. If the command above did not return zero, generate a support bundle using this tool
    1. The copy the script to the machine and make sure to run it with sudo
    2. Most likely the normal support bundle tool will have problems executing if Longhorn is down. It will still complete, but running the above tool will be quicker and easier
    3. The output of the tool is that it creates a zip file. Capture that and share it with UiPath Technical support team
  5. If on step one, the command returned zero, continue to follow this guide
  6. Remove the storage class
    1. Run the following command to list the existing storage classes
kubectl get sc
  1. Output will be the below:
Screenshot 2024-06-26 144748.png
  1. Delete Longhorn Storage Classes
    1. Manually delete both longhorn-backup and longhorn-backup-single-replica storage classes using the command below
kubectl delete sc longhorn-backup longhorn-backup-single-replica 
  1. By following these steps, it should be possible to resolve the issue with setting the Longhorn RestApi Endpoint after upgrading. If above not resolve the issue on 23.10.X create a support bundle and open a ticket. See Automation Suite Support Bundle .