XRAY: How to overcome “Xray is disabled or not supported by this instance’s license” after upgrade to Unified Platform?

Muhammed Kashif
2023-01-22 11:10

You might encounter a license-related issue when connecting to Xray from the Artifactory when the upgrade is performed on Artifactory and Xray to Unified Platform. If your separate upgrades of these products have been successful, but Xray is still not connecting to Artifactory, check your Xray-server-service.log file to see which error was triggered.

2020-06-29T13:07:09.640Z [33m[jfxr ][0m [1m[31m[ERROR][0m [                ] [support_bundle_service:220    ] [main                ] {
  "errors" : [ {
    "status" : 400,
    "message" : "{\"error\":\"Xray is disabled or not supported by this instance's license.\"}"
  } ]
}
 

If you encounter the error above, navigate to the Config Descriptor under the JPD UI > Administration > Service | Artifactory > Config Descriptor and look for the <xrayConfig> tag: 

<xrayConfig>
  <enabled>true</enabled>
  <baseUrl>https://localhost:8046/xray/</baseUrl>
  <user></user>
  <password></password>
  <artifactoryId>default</artifactoryId>
  <xrayId></xrayId>
  <allowDownloadsXrayUnavailable>false</allowDownloadsXrayUnavailable>
  <allowBlockedArtifactsDownload>false</allowBlockedArtifactsDownload>
  <blockUnscannedTimeoutSeconds>60</blockUnscannedTimeoutSeconds>
</xrayConfig>
 

If, as above, your <artifactoryId> is set to default, it means that after upgrading to the Unified Platform, your <artifactoryId> changed from actual artifactory’s Id to default in Xray. 

To overcome this problem, run the DB query below against Xray’s PostgreSQL,

SELECT bin_mgr_id FROM binary_managers;

The output will return the <artifactoryId> of the Artifactory instance which had successfully connected to Xray prior to the upgrade. If the output of the DB query is not default, change the <artifactoryId> under the Config Descriptor from default to the output of the query.

For example, if the output of the DB query is “Artifactory” as below,

SELECT bin_mgr_id FROM binary_managers;
Output: Artifactory

Then change the <xrayConfig> tag's <artifactoryId> element from “default” to “Artifactory

<xrayConfig>
  <enabled>true</enabled>
  <baseUrl>https://localhost:8046/xray/</baseUrl>
  <user></user>
  <password></password>
  <artifactoryId>Artifactory</artifactoryId>
  <xrayId></xrayId>
  <allowDownloadsXrayUnavailable>false</allowDownloadsXrayUnavailable>
  <allowBlockedArtifactsDownload>false</allowBlockedArtifactsDownload>
  <blockUnscannedTimeoutSeconds>60</blockUnscannedTimeoutSeconds>
</xrayConfig>

Once done, save the changes and this should resolve the license-related issue.