The "?trace" API

ARTIFACTORY: Uncovering Virtual Repository Resolution

AuthorFullName__c
Patrick Russell
articleNumber
000005433
ft:sourceType
Salesforce
FirstPublishedDate
2022-10-18T09:30:42Z
lastModifiedDate
2023-01-22T11:06:56Z
VersionNumber
2
Ever since Artifactory introduced Virtual repositories, there has existed a special debug API to print its artifact resolution logic. The API allows you to see the underlying logic behind the download, including the outgoing searches made to remote sources like Maven Central.

To see the debug information, add a "?trace" token onto the end of a download URL that goes through a Virtual:
curl -u <USER> "https://artifactory.com/libs-snapshot/jfrog/hello/1.0.8-SNAPSHOT/hello-1.0.8-20220526.215602-2.pom?trace"

Note: You cannot use the Trace API on package manager paths, for example, "api/pypi/pypi-virtual/[...]?trace" won't work. Try using the file path instead.

When you use this API, you receive a debug printout instead of getting a file. The debug output is the logic Artifactory used to find the file. This is very useful when troubleshooting a complex Virtual repository, as sometimes a very large resolution order can lead to unexpected logic problems.

Make sure to authenticate when using this API, the ?trace API checks your credentials just like the Virtual would. You can even see which repositories will be skipped if your account doesn't have access to them.

A lot of the information in the printout is debug information that's not very helpful. Below you can find some key tags to look for in the printout. These examples are some of the common results when resolving a file from a Virtual: Finding a local file, a remote download, and a 404 Not Found event.

The examples were performed on a Virtual with two repositories within it, a small Local and a Remote pointed at Maven Central: