SonarQube 5.2 fails to start when temp folder does not exist - windows 10 -> windows service

2,788 views
Skip to first unread message

Jorge Costa

unread,
Nov 17, 2015, 11:27:28 AM11/17/15
to SonarQube
Hi,

using this configuration in the wrapper config:

wrapper.java.additional.1=-Djava.awt.headless=true -Djava.io.tmpdir=d:\SonarVersions\sonarqube-5.2-RC3\temp2

i get this error

WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: Temp directory is not writable: d:\SonarVersions\sonarqube-5.2-RC3\temp2
java.lang.IllegalStateException: Temp directory is not writable: d:\SonarVersions\sonarqube-5.2-RC3\temp2
at org.sonar.process.MinimumViableSystem.checkWritableDir(MinimumViableSystem.java:60)
at org.sonar.process.MinimumViableSystem.checkWritableTempDir(MinimumViableSystem.java:52)
at org.sonar.process.MinimumViableSystem.check(MinimumViableSystem.java:45)
at org.sonar.application.App.main(App.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(Unknown Source)
at org.sonar.process.MinimumViableSystem.checkWritableDir(MinimumViableSystem.java:57)
... 9 more
<-- Wrapper Stopped
The SonarQube service was launched, but failed to start.

if i create the folder d:\SonarVersions\sonarqube-5.2-RC3\temp2 then the server starts. However the problems do not stop here.

After running  one analysis, it fails  with this server stack trace:
2015.11.17 18:21:59 INFO  app[o.s.p.m.Monitor] Process[web] is up
2015.11.17 18:23:30 ERROR web[rails] /!\ FAILSAFE /!\  Tue Nov 17 18:23:30 +0200 2015
  Status: 500 Internal Server Error
  No such file or directory - C:/WINDOWS/system32/config/systemprofile/AppData/Local/Temp
    org/jruby/RubyFile.java:842:in `stat'
    jar:file:/D:/SonarVersions/sonarqube-5.2-RC3/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:33:in `tmpdir'
    org/jruby/RubyArray.java:1613:in `each'
    jar:file:/D:/SonarVersions/sonarqube-5.2-RC3/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:30:in `tmpdir'
    jar:file:/D:/SonarVersions/sonarqube-5.2-RC3/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:109:in `tmpdir'
    jar:file:/D:/SonarVersions/sonarqube-5.2-RC3/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:141:in `create'
    org/jruby/ext/tempfile/Tempfile.java:88:in `initialize'
    org/jruby/RubyIO.java:852:in `new'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/utils.rb:559:in `parse_multipart'
    org/jruby/RubyKernel.java:1519:in `loop'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/utils.rb:537:in `parse_multipart'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/request.rb:268:in `parse_multipart'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/request.rb:146:in `POST'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/methodoverride.rb:15:in `call'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:15:in `call'
    file:/D:/SonarVersions/sonarqube-5.2-RC3/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/session_store.rb:70:in `context'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/session/abstract/id.rb:58:in `call'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26:in `call'
    D:/SonarVersions/sonarqube-5.2-RC3/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106:in `call'
    file:/D:/SonarVersions/sonarqube-5.2-RC3/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:34:in `serve_rails'
    file:/D:/SonarVersions/sonarqube-5.2-RC3/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:39:in `call'
    file:/D:/SonarVersions/sonarqube-5.2-RC3/lib/server/jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22:in `call'


So it seems some parts for sonar use the -Djava.io.tmpdir=d:\SonarVersions\sonarqube-5.2-RC3\temp2 others do not.

How can i set a temporary folder that works everywhere?

br,
Jorge Costa






Jorge Costa

unread,
Nov 17, 2015, 11:34:36 AM11/17/15
to SonarQube
same happens in 5.1

Simon Brandhof

unread,
Nov 19, 2015, 3:31:05 AM11/19/15
to Jorge Costa, SonarQube
Hi,

The property sonar.path.temp, defined in conf/sonar.properties, must be used for that.

Regards 


Simon BRANDHOF | SonarSource
Tech Lead & Co-Founder
http://twitter.com/SimonBrandhof

--
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/80b7f47d-acc8-4f98-8c95-82efda50ea42%40googlegroups.com.

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

Jorge Costa

unread,
Nov 19, 2015, 3:47:05 AM11/19/15
to Simon Brandhof, SonarQube
Hi Simon,

thanks for the reply.

after changing the suggested property in 5.2-RC3

# Paths to persistent data files (embedded database and search index) and temporary files.
# Can be absolute or relative to installation directory.
# Defaults are respectively <installation home>/data and <installation home>/temp
#sonar.path.data=data
sonar.path.temp=temp

I get this:
SonarQube installed.
Starting the SonarQube service...
--> Wrapper Started as Service
Launching a JVM...
Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
  Copyright 1999-2006 Tanuki Software, Inc.  All Rights Reserved.


WrapperSimpleApp: Encountered an error running main: java.lang.IllegalStateException: Temp directory is not writable: C:\WINDOWS\system32\config\systemprofile\AppData\Local\Temp\
java.lang.IllegalStateException: Temp directory is not writable: C:\WINDOWS\system32\config\systemprofile\AppData\Local\Temp\
at org.sonar.process.MinimumViableSystem.checkWritableDir(MinimumViableSystem.java:60)
at org.sonar.process.MinimumViableSystem.checkWritableTempDir(MinimumViableSystem.java:52)
at org.sonar.process.MinimumViableSystem.check(MinimumViableSystem.java:45)
at org.sonar.application.App.main(App.java:112)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimpleApp.java:240)
at java.lang.Thread.run(Unknown Source)
Caused by: java.io.IOException: The system cannot find the path specified
at java.io.WinNTFileSystem.createFileExclusively(Native Method)
at java.io.File.createTempFile(Unknown Source)
at org.sonar.process.MinimumViableSystem.checkWritableDir(MinimumViableSystem.java:57)
... 9 more
<-- Wrapper Stopped
The SonarQube service was launched, but failed to start.


Additionally, perhaps can also update this thread: http://stackoverflow.com/questions/29019848/sonarqube-temp-directory-is-not-writable since it was there i got the first idea.

Br,
Jc





Jorge Costa

unread,
Dec 3, 2015, 2:48:16 AM12/3/15
to SonarQube, jmec...@gmail.com
Hi Simon,

was this a answer saying how its done, so i am doing something wrong and you i need to figure it by myself. or is someone investigating this issue, other people have also complained about this same issue.

Just for reference we are trying to have some integration tests in AppVeyour: https://ci.appveyor.com/project/SonarOpenCommunity/sonar-cxx/build/91 but i cant get sonar started in that environment.

Br,
Jorge Costa

Christopher Corp-Myer

unread,
Aug 2, 2016, 7:27:55 PM8/2/16
to SonarQube, jmec...@gmail.com
I'm seeing this on Server 2012/Windows 10 with the latest build of Sonar.

Do we have a complete fix for this? Or a workaround?

nicolas...@sonarsource.com

unread,
Aug 3, 2016, 2:23:22 AM8/3/16
to SonarQube, jmec...@gmail.com
Hi all,

Please refer to SONAR-7896 for the latest findings (on SonarQube 5.6 and 5.6.1) and workarounds on this topic (issues when running SonarQube as a Windows Service).

Best regards,
Nicolas
Reply all
Reply to author
Forward
0 new messages