In this article we will learn how to resolve an issue where Artifactory failed to start due to "Error while trying to connect to local router".
Cause of the issue
This is happening since access.xml and artifactory.xml files which should be located in $JFROG_HOME/artifactory/app/artifactory/tomcat/conf/Catalina/localhost directory are missing.
Since these files are missing, Access service is not able to start while you don't see an indication in access-service.log. In addition, you will not see any updates in tomcat log trying to start Access.
The following errors can be noticed in console.log:
failed fetching external topology from Access: bad response status: 404 Not Found
Service registry ping failed, will retry. Error: Error while trying to connect to local router at address 'http://localhost:8046/access/api/v1/system/ping': Get "http://localhost:8046/access/api/v1/system/ping": dial tcp 127.0.0.1:8046: connect: connection refused [startup]
In order to resolve the issue, you may want to perform the following steps:
Stop Artifactory service
Navigate to $JFROG_HOME/artifactory/app/artifactory/tomcat/conf/Catalina/localhost directory – this directory should have two files: access.xml and artifactory.xml which responsible for Access and Artifactory startup. If they are missing:
*Copy the missing files to the mentioned directory (download explanation below)
Verify that the owner and group are “artifactory” for these files
Start Artifactory service
*The missing files can be copied from the .tar.gz or .zip files of Artifactory (Linux/Windows download) on our download page.
Download the relevant version of Artifactory, unzip it, copy the access.xml and artifactory.xml from app/artifactory/tomcat/conf/Catalina/localhost directory.