Skip to content
Latchkey

JFrog Xray "scan failed" in CI

Xray could not complete the scan. The target may not be indexed yet, Xray may be unreachable, or the build info Xray needs was not published before the scan ran.

What this error means

A jf scan, jf docker scan, or jf build-scan step fails with "Scan failed" or "The scan did not complete", sometimes noting the resource is not indexed.

jf
[Error] Xray scan failed:
The requested build 'my-build/12' was not found or has not been indexed by Xray yet.

Common causes

The resource is not indexed yet

Xray indexes artifacts and builds asynchronously. Scanning immediately after publish can run before indexing completes.

Xray is unreachable or the watch is misconfigured

A wrong URL, a down Xray service, or a scan targeting a build that was never published fails the scan step.

How to fix it

Publish build info, then scan the build

  1. Publish build info before the scan so Xray has something to index.
  2. Scan the published build rather than an artifact that is not indexed.
  3. Allow indexing to complete before invoking the scan.
Terminal
jf rt build-publish my-build ${{ github.run_number }}
jf build-scan my-build ${{ github.run_number }}

Verify Xray connectivity

Confirm the platform URL is correct and Xray is enabled; a misrouted request cannot scan.

Terminal
jf rt curl -XGET "/xray/api/v1/system/ping"

How to prevent it

  • Publish build info before invoking a build scan.
  • Allow time for Xray indexing after publish.
  • Verify the platform URL routes to a running Xray instance.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →