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

Non-readable files inside a synced directory (such as /etc/plugins) causes a NPE and fails startup

    Details

    • Type: Bug
    • Status: Open
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 5.4.6
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      A non-readable file inside a synced directory such as the $ARTIFACTORY_HOME/etc/plugins dir would cause the file-to-db syncing thread to fail with a NPE - see full stack trace attached.

      The fact that the following line is executed within a try-with-resources block causes the FileNotFoundExeption (permissions denied) to be surpassed, and the code within the try block continues to execute:

      try (InputStream stream = configWithTime.getBinaryStream()) {
                      configBytes = IOUtils.toByteArray(stream);
                  } 
      

      so "stream" is null, and this causes toByteArray to fail with a NPE.

      Reproduce:
      1.Create a file inside /etc/plugins (i.e touch foo.groovy) while the server is down or if the application is halted with a breakpoint
      2.Remove read permissions for this file to whichever user you are using to run the Artifactory process
      3.Start the server, observe the NPE on your localhost.log file

      This should be considered a high priority issue because it can fail a startup

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                uriahl Uriah Levy
              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: