Introduction When running the Xray offline update command such as: "jf xr offline-update --license-id=xxx --version=3.69.3”. You may encounter the following error:
14:42:56 [Info] Getting updates... 14:42:57 [Error] server response: 401 Unauthorized
This is usually related to the following scenarios: Scenario 1: The Artifactory Enterprise license has expired. Scenario 2: You have configured an Artifactory and Xray trial license before, then you replaced the Artifactory license with the Enterprise license and forgot to remove the expired Xray trial license, it has been hidden in the Artifactory UI. Resolution Here are the resolutions for the above scenarios: Resolution for Scenario 1: Check if the Artifactory Enterprise license is correct by following this article: How to Overcome the Error "License has been Expired"? Or check it in the UI: Artifactory standalone instance:HA Artifactory:
If the license has expired, please replace it with a valid Enterprise license. Resolution for Scenario 2: If you are using a valid Enterprise license and the issue still persists, please check if there is an Xray trial license in the JFrog Platform, you can check and remove it by using the following API from the article: How do I check license status for Xray, and remove trial licenses? If you have removed the trial license as described above, and the error still persists, please use the following steps to confirm and remove the trial license from UI (the Xray trial license button only appears when using an Artifactory trial license): 1. Backup your License in the Artifactory server directory $JFROG_HOME/var/etc/artifactory/: Artifactory standalone instance: artifactory.lic file HA Artifactory: artifactory.cluster.license file 2.Navigate to the Artifactory UI, Administration | General Management | Licenses. Replace the existing Artifactory License with a valid Artifactory trial license: Artifactory standalone instance:
HA Artifactory:
Note: For the HA Artifactory, click the "Add license" button in the top right corner. After adding the trial License, remove one existing license from one of the nodes, and it will be replaced with the trial license for that node:
3. Then navigate to Administration | General Management | Activate Xray Trial, and click the "Remove License" button to remove the trial Xray license:
4. Restore the backed-up Artifactory License as Step “2)” Now, run the Xray offline update command again, and the update will be successful. Conclusion This article provides step-by-step instructions to troubleshoot and resolve the "401 Unauthorized" error when performing an offline update for JFrog Xray.