Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-26154

Null pointer exception when trace-level logging is enabled

    XMLWordPrintable

    Details

    • Location:
      External

      Description

      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());
      }

       

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              zmpetro_lm Zachary Petro
              Votes:
              1 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-26155 -
                  ERROR
                  • Last Sync Date: