Introduction
When installing JAS for the first time, in rare cases you may get the following error:
"message": "Applicability scanner got exception: ConnectionError(MaxRetryError(\"HTTPConnectionPool(host='localhost', port=8046): Max retries exceeded with url: /artifactory/api/<your-filepath> (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7df69cc01150>: Failed to establish a new connection: [Errno 111] Connection refused'))\"))"
Or generally, error messages like “Failed to establish a new connection, Connection refused when connecting to localhost:8046” in regards to JAS.
The JAS Router may fail due to various factors, like your network setup between nodes, use of proxies and firewalls, etc. If we disable this Router, we can directly use the Custom Base URL we have configured in Artifactory UI instead for JAS to process requests.
This article will allow you to disable the JAS Router to unblock yourself in this scenario, so that JAS will begin to work if it has already been installed correctly
Solution 1:
The recommended, permanent solution for this issue is to upgrade XRay to Xray 3.131.0+, as a bug related to JAS’s router microservice has been fixed in this version or higher.
Solution 2:
Otherwise, if upgrading XRay is not immediately possible, please do the following to unblock yourself:
- Make sure your Custom Base URL is configured correctly by following the instructions in this article. Ensure that Base URL is reachable from the server/container where JAS is installed (use tools like “nslookup” and “netcat” to verify this)
- Add a snippet to the system.yaml depending on your installation type.
If you installed JAS without Helm:
a) Navigate to $XRAY_HOME/xray/var/etc/system.yaml and add the below snippet:
jas:
router:
mode: disabled
If you installed JAS with Helm:
a) Navigate to your Helm chart or “values.yaml” and add the below snippet:
extraSystemYaml:
jas:
router:
mode: disabled
- Run the following API to disable the JAS healthcheck. You should only use this API if JAS otherwise appears to function properly (i.e. all Advanced Scans work as expected in a timely manner).
curl --location 'https://<JPD URL>/xray/api/v1/configuration/jas' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <ACCESS_TOKEN>' \
--data '{
"enable_health_check": false
}'
After running this API, you must restart Xray once so it takes effect.
To revert this change, you can simply replace “false” with “true” in the payload above, and once again restart Xray.