SonarQube 5.4: "java.nio.file.FileSystemException Error" during refresh of plugins in SonarQube portal when running as a service

6,193 views
Skip to first unread message

jeroen...@centric.nl

unread,
Mar 16, 2016, 11:38:49 AM3/16/16
to SonarQube
This is the relevant log:

2016.03.16 16:11:01 INFO  web[o.s.s.p.w.RestartAction] SonarQube restart requested by admin
2016.03.16 16:11:01 INFO  app[o.s.p.m.Monitor] Process [web] requested restart
2016.03.16 16:11:01 INFO  app[o.s.p.m.Monitor] Process[web] is stopping
2016.03.16 16:11:02 INFO  web[o.s.p.StopWatcher] Stopping process
2016.03.16 16:11:02 INFO  web[o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-0.0.0.0-80"]
2016.03.16 16:11:03 INFO  web[o.a.c.h.Http11NioProtocol] Pausing ProtocolHandler ["http-nio-0.0.0.0-443"]
2016.03.16 16:11:04 INFO  web[w.s.NegotiateSecurityFilter] [waffle.servlet.NegotiateSecurityFilter] stopped
2016.03.16 16:11:04 INFO  web[o.s.s.n.NotificationService] Notification service stopped
2016.03.16 16:11:05 INFO  web[o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-0.0.0.0-80"]
2016.03.16 16:11:05 INFO  web[o.a.c.h.Http11NioProtocol] Stopping ProtocolHandler ["http-nio-0.0.0.0-443"]
2016.03.16 16:11:06 INFO  web[o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-0.0.0.0-80"]
2016.03.16 16:11:06 INFO  web[o.a.c.h.Http11NioProtocol] Destroying ProtocolHandler ["http-nio-0.0.0.0-443"]
2016.03.16 16:11:06 INFO  web[o.s.s.a.TomcatAccessLog] Web server is stopped
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=160m; support was removed in 8.0
2016.03.16 16:11:06 INFO  app[o.s.p.m.Monitor] Process[web] is stopped
2016.03.16 16:11:06 INFO  app[o.s.p.m.Monitor] Process[search] is stopping
2016.03.16 16:11:07 INFO   es[o.s.p.StopWatcher]  Stopping process
2016.03.16 16:11:07 INFO   es[o.elasticsearch.node]  [sonar-1457639022997] stopping ...
2016.03.16 16:11:07 INFO   es[o.elasticsearch.node]  [sonar-1457639022997] stopped
2016.03.16 16:11:07 INFO   es[o.elasticsearch.node]  [sonar-1457639022997] closing ...
2016.03.16 16:11:07 INFO   es[o.elasticsearch.node]  [sonar-1457639022997] closed
2016.03.16 16:11:07 INFO  app[o.s.p.m.Monitor] Process[search] is stopped
2016.03.16 16:11:07 INFO  app[o.s.a.AppFileSystem] Cleaning or creating temp directory C:\Sonar\sonarqube-5.4\temp
Exception in thread "Restartor 0" java.lang.RuntimeException: Failed to reset file system
at org.sonar.process.monitor.Monitor.resetFileSystem(Monitor.java:125)
at org.sonar.process.monitor.Monitor.startProcesses(Monitor.java:105)
at org.sonar.process.monitor.Monitor.access$500(Monitor.java:38)
at org.sonar.process.monitor.Monitor$RestartorThread.run(Monitor.java:282)
Caused by: java.nio.file.FileSystemException: C:\Sonar\sonarqube-5.4\temp\sharedmemory: The process cannot access the file because it is being used by another process.

at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
at java.nio.file.Files.delete(Unknown Source)
at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:151)
at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:135)
at java.nio.file.Files.walkFileTree(Unknown Source)
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:122)
... 3 more

Solution: Restart SonarQube windows service yourself.

Alix Lourme

unread,
Mar 29, 2016, 4:39:53 PM3/29/16
to SonarQube, jeroen...@centric.nl
Hi,

Same issue with the standalone execution (StartSonar.bat), using the Restart function in the Update Center (after a plugins upgrade).

Technical informations :
* OS : Windows 10
* Arch : windows-x86-32
* Java version : 1.8.0_77-b03

SonarQube issue reference : SONAR-7422 (issue not googled when problem search, only this post).

Best regards.

Francis Galiegue

unread,
Mar 29, 2016, 8:05:56 PM3/29/16
to SonarQube, jeroen...@centric.nl
*sigh*

Thank you Windows.

More than one file handle on a same filesystem object and you end up with that error...

And here it seems that the problem is with a file which is being deleted while being used somewhere else:
 
at sun.nio.fs.WindowsException.translateToIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsException.rethrowAsIOException(Unknown Source)
at sun.nio.fs.WindowsFileSystemProvider.implDelete(Unknown Source)
at sun.nio.fs.AbstractFileSystemProvider.delete(Unknown Source)
at java.nio.file.Files.delete(Unknown Source)
at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:151)
at org.sonar.process.FileUtils$CleanDirectoryFileVisitor.visitFile(FileUtils.java:135)
at java.nio.file.Files.walkFileTree(Unknown Source)
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:122)


So, basically, SonarQube seems to be having a file descriptor open on a file in some execution path x1 while path x2 tries and deletes it, and throws the error.

Of course, you wouldn't even face that error with any Unix system... The question is now what x1 is.

Sebastien Lesaint

unread,
Mar 30, 2016, 5:46:57 AM3/30/16
to SonarQube
Hello,

Sorry for the late reply. I've opened a ticket to try and handle this case: SONAR-7506.

cheers,

Sébastien LESAINT | SonarSource
Platform Developer

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/b56a6687-c4fb-4ebf-8366-98c9b2bd591c%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages