Symptom
A user with "Manage Xray Metadata" permissions receives the error message, “contact your admin to re-trigger the scan” when attempting to trigger a scan on an artifact or repository. This occurs specifically after the Xray retention period for that resource has expired.
Cause
The Xray retention policy is designed to automatically clean up old scan data and metadata to optimize performance and storage. When the retention period expires, all associated Xray metadata is permanently purged. To initiate a new scan, the artifact must first be re-indexed to rebuild the metadata required for Xray to function.
The core issue is that the "Manage Xray Metadata" permission grants a user the ability to manage existing Xray metadata, but it does not include the privilege to trigger the initial indexing process. Re-indexing is a high-privilege operation reserved for administrators.
Resolution
To resolve this issue, an administrator must manually perform one of the following actions to re-index the artifact:
- Re-index a single artifact: Navigate to the specific artifact and trigger a manual re-index from the UI.
- Re-index an entire repository: If multiple artifacts are affected, the admin can re-index the entire repository to ensure all expired artifacts are correctly processed.
Once the re-indexing is complete, the non-admin user will be able to successfully trigger the scan without encountering the error.