Comparing correct NuGet REST API calls can show where the problem lies.
4.0.2 – Latest
When troubleshooting NuGet errors it is best to compare what is supposed to happen against what is currently happening. You can eliminate a great deal of noise by simulating each step the client takes, and examining what HTTP return code is sent by Artifactory.
In general, these return codes indicate where to look next:
403 and 401 – Authentication issue, examine authorization settings
404 – Resource not found, check repository for resource
400 – Incorrect request, use curl to get reason phrase
50X – Server problem, examine artifactory.log
Using your Web Browser
Many NuGet projects can only be built on Windows hosts, which means that standard troubleshooting tools like libcurl are not available or have reduced functionality.
Modern web browsers can be used to pull NuGet metadata if supplied with the correct URL. Simply go to the Artifactory URL, and after the “/artifactory” add the information from the request log to perform a GET action similar to the NuGet client.
This will display the correct XML metadata in the tab for further troubleshooting.
Running a “nuget list” command causes the client to pull most of the NuGet metadata from Artifactory.
The client first gets an XML page of the proper “packages” API formatting:
It then gets the metadata formatting of the search command:
Finally, it will then pull an XML page listing all available packages:
nuget install bang.test.bench
Running a “nuget install” command results in the client searching for the package in two different ways, depending on the NuGet client:
— or —
This XML metadata contains the download link for the package, which the client then uses:
The .nupkg file is pulled via the above URL, and can be manually downloaded via a web browser to test this.
Nuget push bang.test.bench.nupkg
A “nuget push” command runs a PUT with the .nupkg as the payload:
The metadata contained in the .nupkg file is read by Artifactory during the Indexing phase, which updates the metadata for the repository.