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

Request for existing resource and non-existing metric fails on Derby

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 3.0
    • Component/s: Web API
    • Labels:
      None

      Description

      Query :

      /api/resources?resource=org.codehaus.sonar-plugins:sonar-ldap-plugin&metrics=notfound&verbose=false&
      

      on postgresql returns resource without measures, but on derby returns HTTP 500 error :

      ActiveRecord::StatementInvalid (ActiveRecord::ActiveRecordError: Syntax error: Encountered "NULL" at line 1, column 399.: SELECT project_measures.id,project_measures.value,project_measures.metric_id,project_measures.snapshot_id,project_measures.rule_id,project_measures.rule_priority,project_measures.text_value,project_measures.characteristic_id FROM project_measures   INNER JOIN snapshots ON snapshots.id = project_measures.snapshot_id  WHERE (snapshots.islast=1 AND snapshots.id=1 AND project_measures.metric_id IN (NULL) AND project_measures.rule_id IS NULL AND project_measures.rule_priority IS NULL AND project_measures.characteristic_id IS NULL) ):
          /gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract_adapter.rb:188:in `log'
          /gems/gems/activerecord-jdbc-adapter-0.9.0.1/lib/active_record/connection_adapters/jdbc_adapter.rb:581:in `execute'
          /gems/gems/activerecord-2.2.2/lib/active_record/base.rb:635:in `find_by_sql'
          /gems/gems/activerecord-2.2.2/lib/active_record/base.rb:1490:in `find_every'
          /gems/gems/activerecord-2.2.2/lib/active_record/base.rb:589:in `find'
          /app/controllers/api/resources_controller.rb:106:in `index'
          /gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:1253:in `perform_action'
          /gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:617:in `call_filters'
          /gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:610:in `perform_action_with_filters'
          /gems/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
          /tmp/sonar/tomcat6/work/Catalina/localhost/_/loader/META-INF/jruby.home//lib/ruby/1.8/benchmark.rb:293:in `measure'
          /gems/gems/actionpack-2.2.2/lib/action_controller/benchmarking.rb:68:in `perform_action_with_benchmark'
          /gems/gems/actionpack-2.2.2/lib/action_controller/rescue.rb:136:in `perform_action_with_rescue'
          /gems/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:13:in `perform_action_with_caching'
          /gems/gems/activerecord-2.2.2/lib/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
          /gems/gems/activerecord-2.2.2/lib/active_record/query_cache.rb:8:in `cache'
          /gems/gems/actionpack-2.2.2/lib/action_controller/caching/sql_cache.rb:12:in `perform_action_with_caching'
          /gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:524:in `process'
          /gems/gems/actionpack-2.2.2/lib/action_controller/filters.rb:606:in `process_with_filters'
          /gems/gems/actionpack-2.2.2/lib/action_controller/session_management.rb:134:in `process_with_session_management_support'
          /gems/gems/actionpack-2.2.2/lib/action_controller/base.rb:392:in `process'
          /gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:183:in `handle_request'
          /gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:110:in `dispatch_unlocked'
          /gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:120:in `dispatch'
          /gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:132:in `dispatch_cgi'
          /gems/gems/actionpack-2.2.2/lib/action_controller/dispatcher.rb:39:in `dispatch'
          /tmp/sonar/tomcat6/work/Catalina/localhost/_/loader/rack/adapter/rails_cgi.rb:25:in `call'
          /tmp/sonar/tomcat6/work/Catalina/localhost/_/loader/rack/adapter/rails.rb:36:in `serve_rails'
          /tmp/sonar/tomcat6/work/Catalina/localhost/_/loader/rack/adapter/rails.rb:41:in `call'
          /tmp/sonar/tomcat6/work/Catalina/localhost/_/loader/jruby/rack/rails.rb:149:in `call'
          /tmp/sonar/tomcat6/work/Catalina/localhost/_/loader/rack/handler/servlet.rb:19:in `call'
          :1
      

        Attachments

          Activity

            People

            Assignee:
            simon.brandhof Simon Brandhof (Inactive)
            Reporter:
            godin OLD - Evgeny Mandrikov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: