Credit for finding this bug goes to Chris Beckley.
After enabling trace-level logging within Artifactory, our Jenkins/Gradle builds began to fail due to Artifactory responding with a 500 Internal Server Error rather than a 404 Not Found error when attempting to pull Artifacts where the repository existed, but the Artifact within the repository did not exist. After looking through the JVM stack-trace as well as the Artifactory source code, we determined that the issue is due to a missing return statement within the download service code that causes a null pointer exception within Artifactory.
jfrog-artifactory-oss-7.21.7-sources\jfrog-artifactory-7.21.7\backend\core\src\main\java\org\artifactory\engine\DownloadServiceImpl.java lines 445-455:
private void logTraceIsNoneMatch(RepoResource resource, RepoResourceInfo resourceInfo) { if (!log.isTraceEnabled()) { return; } if (resourceInfo == null) { log.trace("Resource {} info is null", resource.getRepoPath()); return; <----- MISSING RETURN HERE } log.trace("Resource {} sha1 {} md5 {} includeMd5IntoETagCheck {}", resource.getRepoPath(), resourceInfo.getSha1(), resourceInfo.getMd5(), ConstantValues.includeMd5IntoETagCheck.getBoolean()); }