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

Restart from the UI fails on Windows

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.4
    • Fix Version/s: 5.6
    • Component/s: Ops
    • Labels:

      Description

      I've just locally tested SQ 5.5-M6, uninstalled the bundled C# 4.4 plugin and click on the restart button.

      This didn't work, and here is what I got in the logs:

      jvm 1    | 2016.03.03 09:00:39 INFO  app[o.s.p.m.Monitor] Process[search] is stopping
      jvm 1    | 2016.03.03 09:00:41 INFO  app[o.s.p.m.Monitor] Process[search] is stopped
      jvm 1    | 2016.03.03 09:00:41 INFO  app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\Dinesh\Desktop\sonarsource\sonarqube-5.5-M6_2016-03-02\temp
      jvm 1    | Exception in thread "Restartor 0" java.lang.RuntimeException: Failed to reset file system
      jvm 1    |      at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:125)
      jvm 1    |      at org.sonar.process.monitor.Monitor.startProcesses(Monitor.java:105)
      jvm 1    |      at org.sonar.process.monitor.Monitor.access$500(Monitor.java:38)
      jvm 1    |      at org.sonar.process.monitor.Monitor$RestartorThread.run(Monitor.java:282)
      jvm 1    | Caused by: java.nio.file.FileSystemException: C:\Users\Dinesh\Desktop\sonarsource\sonarqube-5.5-M6_2016-03-02\temp\sharedmemory: The process cannot access the file because it is being used by another process.
      jvm 1    |
      jvm 1    |      at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
      jvm 1    |      at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
      jvm 1    |      at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
      jvm 1    |      at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
      jvm 1    |      at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
      jvm 1    |      at java.nio.file.Files.delete(Files.java:1126)
      jvm 1    |      at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:151)
      jvm 1    |      at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:135)
      jvm 1    |      at java.nio.file.Files.walkFileTree(Files.java:2670)
      jvm 1    |      at org.sonar.process.FileUtils.cleanDirectoryImpl(FileUtils.java:123)
      jvm 1    |      at org.sonar.process.FileUtils.cleanDirectory(FileUtils.java:60)
      jvm 1    |      at org.sonar.application.AppFileSystem.createOrCleanDirectory(AppFileSystem.java:116)
      jvm 1    |      at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:73)
      jvm 1    |      at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:122)
      jvm 1    |      ... 3 more
      

        Issue Links

          Activity

          Hide
          sebastien.lesaint Sebastien Lesaint added a comment -

          Dinesh Bolkensteyn I can't reproduce on an (old) windows 2008. Could it be failing only on more recent versions? What was yours?

          Show
          sebastien.lesaint Sebastien Lesaint added a comment - Dinesh Bolkensteyn I can't reproduce on an (old) windows 2008. Could it be failing only on more recent versions? What was yours?
          Hide
          dinesh.bolkensteyn Dinesh Bolkensteyn added a comment - - edited

          I was able to reproduce this just now, with Windows 10 and the latest released version of SonarQube 5.5 on the default embedded DB and so on:

          Steps:
          1. Unzip SonarQube
          2. cd sonarqube-5.5\bin\windows-x86-64
          3. StartSonar.bat
          4. http://localhost:9000, admin & admin, update the C# plugin to latest release 5.2, and click Restart

          C:\Users\Dinesh\Desktop\sonarsource\sonarqube-5.5\bin\windows-x86-64>java -version
          java version "1.7.0_79"
          Java(TM) SE Runtime Environment (build 1.7.0_79-b15)
          Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode)
          
          2016.05.09 14:38:44 INFO  app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\Dinesh\Desktop\sonarsource\sonarqube-5.5\temp
          Exception in thread "Restartor 0" java.lang.RuntimeException: Failed to reset file system
          	at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:124)
          	at org.sonar.process.monitor.Monitor.startProcesses(Monitor.java:104)
          	at org.sonar.process.monitor.Monitor.access$500(Monitor.java:37)
          	at org.sonar.process.monitor.Monitor$RestartorThread.run(Monitor.java:281)
          Caused by: java.nio.file.FileSystemException: C:\Users\Dinesh\Desktop\sonarsource\sonarqube-5.5\temp\sharedmemory: The process cannot access the file because it is being used by another process.
          
          	at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86)
          	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97)
          	at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102)
          	at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269)
          	at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103)
          	at java.nio.file.Files.delete(Files.java:1079)
          	at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:151)
          	at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:135)
          	at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:135)
          	at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:199)
          	at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:69)
          	at java.nio.file.Files.walkFileTree(Files.java:2602)
          	at org.sonar.process.FileUtils.cleanDirectoryImpl(FileUtils.java:123)
          	at org.sonar.process.FileUtils.cleanDirectory(FileUtils.java:60)
          	at org.sonar.application.AppFileSystem.createOrCleanDirectory(AppFileSystem.java:116)
          	at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:73)
          	at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:121)
          	... 3 more
          
          Show
          dinesh.bolkensteyn Dinesh Bolkensteyn added a comment - - edited I was able to reproduce this just now, with Windows 10 and the latest released version of SonarQube 5.5 on the default embedded DB and so on: Steps: 1. Unzip SonarQube 2. cd sonarqube-5.5\bin\windows-x86-64 3. StartSonar.bat 4. http://localhost:9000 , admin & admin, update the C# plugin to latest release 5.2, and click Restart C:\Users\Dinesh\Desktop\sonarsource\sonarqube-5.5\bin\windows-x86-64>java -version java version "1.7.0_79" Java(TM) SE Runtime Environment (build 1.7.0_79-b15) Java HotSpot(TM) 64-Bit Server VM (build 24.79-b02, mixed mode) 2016.05.09 14:38:44 INFO app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Users\Dinesh\Desktop\sonarsource\sonarqube-5.5\temp Exception in thread "Restartor 0" java.lang.RuntimeException: Failed to reset file system at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:124) at org.sonar.process.monitor.Monitor.startProcesses(Monitor.java:104) at org.sonar.process.monitor.Monitor.access$500(Monitor.java:37) at org.sonar.process.monitor.Monitor$RestartorThread.run(Monitor.java:281) Caused by: java.nio.file.FileSystemException: C:\Users\Dinesh\Desktop\sonarsource\sonarqube-5.5\temp\sharedmemory: The process cannot access the file because it is being used by another process. at sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:86) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:97) at sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:102) at sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:269) at sun.nio.fs.AbstractFileSystemProvider.delete(AbstractFileSystemProvider.java:103) at java.nio.file.Files.delete(Files.java:1079) at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:151) at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:135) at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:135) at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:199) at java.nio.file.FileTreeWalker.walk(FileTreeWalker.java:69) at java.nio.file.Files.walkFileTree(Files.java:2602) at org.sonar.process.FileUtils.cleanDirectoryImpl(FileUtils.java:123) at org.sonar.process.FileUtils.cleanDirectory(FileUtils.java:60) at org.sonar.application.AppFileSystem.createOrCleanDirectory(AppFileSystem.java:116) at org.sonar.application.AppFileSystem.reset(AppFileSystem.java:73) at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:121) ... 3 more
          Hide
          dinesh.bolkensteyn Dinesh Bolkensteyn added a comment -

          Manually tested!

          Show
          dinesh.bolkensteyn Dinesh Bolkensteyn added a comment - Manually tested!
          Show
          sebastien.lesaint Sebastien Lesaint added a comment - https://github.com/SonarSource/sonarqube/pull/940
          Hide
          sebastien.lesaint Sebastien Lesaint added a comment -

          reopening because fix for this issue broke SQ restart from orchestrator

          Show
          sebastien.lesaint Sebastien Lesaint added a comment - reopening because fix for this issue broke SQ restart from orchestrator
          Hide
          christophe.levis Christophe Levis added a comment -

          Ok.
          On windows, restart for UI now works. No error in logs.

          Show
          christophe.levis Christophe Levis added a comment - Ok. On windows, restart for UI now works. No error in logs.

            People

            • Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              dinesh.bolkensteyn Dinesh Bolkensteyn
            • Votes:
              1 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Due:
                Created:
                Updated:
                Resolved: