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

Analysis fails if SonarQube runs as a Windows Service

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.6
    • Fix Version/s: 5.6.2, 6.1
    • Component/s: None
    • Labels:

      Description

      When running SonarQube as a service on Windows, any analysis will fail on the client side with an Error 500 (on api/ce/submit). Logs on the server side:

      2016.07.18 07:58:27 ERROR web[rails] /!\ FAILSAFE /!\  Mon Jul 18 07:58:27 -0700 2016
        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:/C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/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:/C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:30:in `tmpdir'
          jar:file:/C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/lib/server/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/shared/tmpdir.rb:109:in `tmpdir'
          jar:file:/C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/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'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/utils.rb:559:in `parse_multipart'
          org/jruby/RubyKernel.java:1519:in `loop'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/utils.rb:537:in `parse_multipart'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/request.rb:268:in `parse_multipart'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/request.rb:146:in `POST'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/methodoverride.rb:15:in `call'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/params_parser.rb:15:in `call'
          file:/C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/lib/server/jruby-rack-1.1.13.2.jar!/jruby/rack/session_store.rb:70:in `context'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/rack-1.1.6/lib/rack/session/abstract/id.rb:58:in `call'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/failsafe.rb:26:in `call'
          C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/web/WEB-INF/gems/gems/actionpack-2.3.15/lib/action_controller/dispatcher.rb:106:in `call'
          file:/C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:34:in `serve_rails'
          file:/C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/lib/server/jruby-rack-1.1.13.2.jar!/rack/adapter/rails.rb:39:in `call'
          file:/C:/Users/Administrator/Downloads/sonarqube-5.6/sonarqube-5.6/lib/server/jruby-rack-1.1.13.2.jar!/rack/handler/servlet.rb:22:in `call'
      2016.07.18 07:58:27 DEBUG web[http] POST /api/ce/submit?projectKey=org.sonarqube:java-simple-sq-scanner&projectName=Java%20::%20Simple%20Project%20Not%20Compiled%20::%20SonarQube%20Scanner | time=93ms
      

      Environment:

      • Windows OS (actually seen on Server 2008 and Server 2012)
      • SonarQube 5.6 running as a service (as documented)

      Workarounds:

      • in <sonar_install_dir>/conf/wrapper.conf , add set.TMPDIR=../../temp
      • OR in the Windows Services Administrative Tool, edit the SonarQube service properties, change 'Log on' from 'Local System account' to 'This account' (providing your local admin username/password)
      • OR manually run SonarQube from command line

      Troubleshooting notes:

      • issue is de-facto fixed in 6.0 (due to architectural changes in the Web API)
      • (technical detail) JRuby stack seems to not even care about java.io.tmpdir JVM setting, as setting it in wrapper.conf did not work. Only set.TMPDIR did the trick.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              sebastien.lesaint Sebastien Lesaint
              Reporter:
              nicolas.bontoux Nicolas Bontoux
              Votes:
              3 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Due:
                Created:
                Updated:
                Resolved: