ARTIFACTORY: How to resolve 'the build info URL generated by Jenkins Pipeline giving 404 Not Found

ARTIFACTORY: How to resolve 'the build info URL generated by Jenkins Pipeline giving 404 Not Found

AuthorFullName__c
Vaibhav Jain
articleNumber
000005630
ft:sourceType
Salesforce
FirstPublishedDate
2023-03-21T08:58:43Z
lastModifiedDate
2023-03-20
VersionNumber
1

In this article, we will be resolving the “404 Not Found error” which you may encounter in some cases while navigating to build info with the URL generated by Jenkins while publishing a build.

The URL generated by Jenkins navigates us to the build info in Artifactory and it gives us the 404. Below are the example screenshots of the URL generated in the Jenkins pipeline and the Artifactory UI giving a 404 error:

User-added image
  User-added image

As we can see the above URL generated has the below incorrect format:-

   https://<ART-URL>/artifactory/ui/builds/

Generally, the above issue occurs when the Platform URL of JFrog in Jenkins Configuration has not been set correctly.
In order to overcome the 404 error, the /artifactory context should be removed from the Jenkins Configuration Page for the JFrog Platform.

Follow the below steps to configure the JFrog Platform with Jenkins.
1. In Jenkins, navigate to Dashboard -> Manage Jenkins -> Configure System.
2. Under JFrog, Check the JFrog instance details, here you may see that /artifactory is appended with the base URL. Below is the screenshot.
User-added image

3. If that is the case, remove the /artifactory context from the JFrog instance details and click on Test connection and click on Apply and Save the configuration.

4. Then, run the Jenkins job again and we will see that this time the URL generated does not have /artifactory in it. Refer to the below screenshot.
         User-added image
5. This time if we open the URL it will navigate to the correct build info. Refer to the screenshot below
 
User-added image


Great, the 404 error should not occur anymore.