Introduction
This article addresses an issue where JFrog Advanced Security (JAS) stops functioning, and Xray logs display repeated “Unauthorized” errors when attempting to create Kubernetes health check jobs.
The logs may look similar to the following:
Caused by: Unauthorized error false Contextual Analysis k8s job status} {failed to create jas health check job, err: failed to create K8s job jas-health-check
--- at /go/src/jfrog.com/xray/xray/backend/common/container_job_client/k8s.go:619 (executionServiceK8s.StartJob) ---
Caused by: Unauthorized failed to create jas health check job, err: failed to create K8s job jas-health-check
--- at /go/src/jfrog.com/xray/xray/backend/common/container_job_client/k8s.go:619 (executionServiceK8s.StartJob) ---
Caused by: Unauthorized error false Exposures k8s job status} {OK success true JFrog database sync status}}}
2026-01-02T18:56:02.701Z [33m[jfxr ][0m [34m[INFO ][0m [9fef8dcf862e7a33] [jas_health_check:98 ] [Run JAS Health Check ] Sending health check status to rabbitmq: {jas-health-check@pvslp01 {[{error Contextual Analysis k8s job status: failed to create jas health check job, err: failed to create K8s job jas-health-check
--- at /go/src/jfrog.com/xray/xray/backend/common/container_job_client/k8s.go:619 (executionServiceK8s.StartJob) ---
Caused by: Unauthorized 2026-01-02 13:56:02.701280164 -0500 EST m=+1160944.878194676 false} {error Exposures k8s job status: failed to create jas health check job, err: failed to create K8s job jas-health-check
--- at /go/src/jfrog.com/xray/xray/backend/common/container_job_client/k8s.go:619 (executionServiceK8s.StartJob) ---
Caused by: Unauthorized 2026-01-02 13:56:02.701281036 -0500 EST m=+1160944.878195343 false} {error JAS health check failed. More info in <a href="/ui/admin/xray/advanced/system_monitoring">Xray Monitoring Page</a> 2026-01-02 13:56:02.70128136 -0500 EST m=+1160944.878195665 true}] []}}
Root Cause
The issue is caused by k3s client certificate expiration. As documented in the k3s certificate behavior:
- k3s generates client certificates with 365-day validity
- Certificates are automatically renewed on the k3s/JAS server
- However, renewed certificates are NOT automatically updated in Xray
- Once the original certificates expire, Xray cannot authenticate with the k3s master
This results in:
- Failed Kubernetes job creation
- “Unauthorized” errors in JAS health checks
Resolution
The solution is to synchronize the renewed k3s certificates with Xray.
Step-by-Step Instructions:
- Restart the k3s master on the JAS server
- This ensures fresh client certificates are generated
- Copy updated certificates to the Xray server
- From the JAS server, copy the following files:
- Source directory:
/var/lib/rancher/k3s/server/tls
- Destination directory on Xray:
/var/opt/jfrog/xray/etc
- Restart Xray
- This reloads the updated certificates
- Restores authentication with the k3s master
Conclusion
If JAS health checks fail with Unauthorized errors, and Kubernetes job creation is unsuccessful, the issue is likely due to expired k3s client certificates.
Synchronizing the renewed certificates between the JAS (k3s) server and Xray resolves the issue and restores normal functionality.
References:
k3s Certificate Documentation: https://docs.k3s.io/cli/certificate