Uploaded image for project: 'SonarQube'
  1. SonarQube
  2. SONAR-15987

Restart should not fail if temp files can't be deleted

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 9.4
    • Component/s: None
    • Edition:
      Community
    • Production Notes:
      None

      Description

      There are temporary files that can't be deleted when restarting SonarQube, causing the restart to fail. It can be reproduced on Windows, most likely because the file is still in use by a process.

      The file is probably created by ElasticSearch.

      Instead of trying to chase file handlers, we should just be resilient to failing deletes.

      jvm 1    | 2022.02.02 15:31:47 INFO  app[][o.s.a.SchedulerImpl] SonarQube is restarting
      jvm 1    | 2022.02.02 15:31:47 INFO  app[][o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\meneses\git\sonar-enterprise\sonar-application\build\distributions\sonarqube-9.4-SNAPSHOT\temp
      jvm 1    | 2022.02.02 15:31:47 ERROR app[][o.s.a.SchedulerImpl] Failed to restart
      jvm 1    | java.nio.file.AccessDeniedException: C:\Users\meneses\git\sonar-enterprise\sonar-application\build\distributions\sonarqube-9.4-SNAPSHOT\temp\jna3507256401777430707.dll
      jvm 1    |      at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:89)
      jvm 1    |      at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
      jvm 1    |      at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
      jvm 1    |      at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:270)
      jvm 1    |      at java.base/sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:105)
      jvm 1    |      at java.base/java.nio.file.Files.delete(Files.java:1141)
      jvm 1    |      at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:121)
      jvm 1    |      at org.sonar.application.AppFileSystem$CleanTempDirFileVisitor.visitFile(AppFileSystem.java:101)
      jvm 1    |      at java.base/java.nio.file.Files.walkFileTree(Files.java:2724)
      jvm 1    |      at org.sonar.application.AppFileSystem.createOrCleanTempDirectory(AppFileSystem.java:96)
      jvm 1    |      at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:62)
      jvm 1    |      at org.sonar.application.AppReloaderImpl.reload(AppReloaderImpl.java:60)
      jvm 1    |      at org.sonar.application.SchedulerImpl$RestarterThread.run(SchedulerImpl.java:444)
      jvm 1    | 2022.02.02 15:31:47 INFO  app[][o.s.a.SchedulerImpl] Hard stopping SonarQube
      jvm 1    | 2022.02.02 15:31:47 INFO  app[][o.s.a.SchedulerImpl] SonarQube is stopped
      wrapper  | <-- Wrapper Stopped
      

        Attachments

          Activity

            People

            Assignee:
            duarte.meneses Duarte Meneses
            Reporter:
            duarte.meneses Duarte Meneses
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: