XRAY – How to overcome issue when Xray online DB Sync fails with 401?
The below log entry is logged in the Xray-server-service.log when the Xray DB sync fails to complete,[2020/10/06 11:25:38 CEST] [EROR] (www.si-fil.com/xray/internal/jobs.DownloadOnlineUpdates:584) Updates worker id 0 failed to download update from https://jxray.jfrog.io/api/v1/updates/bundles?from=1593080483014&to=1601976328671: Failed to access :https://jxray.jfrog.io/api/v1/updates/bundles?from=1593080483014&to=1601976328671 return status code : 401The problem is that the JXray server is responding 401. This happens when the JXray server is failing to validate your license.
This error would occur when a license gets blacklisted. Blacklisting happens when a renewal of the license happened and the previous one gets expired. Kindly check if there were any Artifactory license renewals happened and reach out to JFrog Support.
In addition, there is a chance that the Xray trial license was used and a new license was added in the Artifactory and it could be that the trial license is still on Xray. To verify whether a trial license is attached by any chance to the Xray instance navigate to Xray UI -> Admin -> Configuration -> Activate Trial License for Xray v2.x and navigate to JFrog Platform UI –> Administration –> Licenses | Activate Xray Trail License for Xray v3.x and If there are any trial license attached, remove it and the Xray DB sync issue should be resolved upon removing the trial license.
If the DB sync is still returning the 401 error again, then this could be related to the restriction against the URLs from the Xray host that is not allowed by the proxy/firewall.
- https://releases.jfrog.io/
- https://releases-cdn.jfrog.io
- https://dl.bintray.com/
- https://akamai.bintray.com
- https://jxray.jfrog.io
Refer to thisKB articlefor the URLs that need to be whitelisted.
To test the ability to sync, run the following REST API endpoint:curl https://jxray.jfrog.io/api/v1/system/pingIf this returns "PONG" as an output then this URLhttps://jxray.jfrog.iocan be accessed over the network. If the issue persists, reach out to JFrog Support.
