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

Problem displaying History when project has a Green Alert event

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.13.1
    • Fix Version/s: 3.0
    • Component/s: Activity, Quality Gate
    • Labels:
    • Environment:
      Solaris 10 (x86), Oracle 10g DB

      Description

      I've just upgraded from Sonar 2.8 to Sonar 2.13.1 and noticed that, for a lot of my projects, when I click on Configuration -> History I get the "We're sorry, but something went wrong" error.
      In the sonar.log I see this error:

      2012.03.06 16:40:28 ERROR o.s.s.ui.JRubyFacade  Fail to render: http://<host>:<port>/sonar/project/history/23187
      can't convert nil into String
              On line #32 of app/views/project/history.html.erb
      
          29: <td class="thin nowrap"><b><%= time.year unless time.year == current_year -%></b></td>
          30: <td class="thin nowrap"><b><%= l(time, :format => '%B').capitalize unless time.month == current_month -%></b></td>
          31: <td class="thin nowrap">
          32: <%= image_tag "event_alert.png", :alt => (message('project_history.col.alert') + ": " + alert_event.name + ". " + alert_event.description) if alert_event -%>
          33: </td>
          34: <td class="thin nowrap">
          35: <%= image_tag "event_profile.png", :alt => message('project_history.col.profile') + ": " + profile_event.description if profile_event -%>
      
          app/views/project/history.html.erb:32
          org/jruby/RubyArray.java:1602:in `each'
          org/jruby/RubyEnumerable.java:909:in `each_with_index'
          app/views/project/history.html.erb:21
          org/jruby/RubyKernel.java:2056:in `send'
          org/jruby/RubyKernel.java:2064:in `send'
          org/jruby/RubyProc.java:268:in `call'
          org/jruby/RubyProc.java:228:in `call'
          /usr/apache-tomcat-6.0.29/work/Catalina/localhost/sonar/loader/vendor/rack-1.2.1/rack/head.rb:9:in `call'
          /usr/apache-tomcat-6.0.29/work/Catalina/localhost/sonar/loader/vendor/rack-1.2.1/rack/methodoverride.rb:24:in `call'
          /usr/apache-tomcat-6.0.29/work/Catalina/localhost/sonar/loader/rack/adapter/rails.rb:36:in `serve_rails'
          /usr/apache-tomcat-6.0.29/work/Catalina/localhost/sonar/loader/rack/adapter/rails.rb:41:in `call'
          /usr/apache-tomcat-6.0.29/work/Catalina/localhost/sonar/loader/jruby/rack/rails.rb:185:in `call'
          /usr/apache-tomcat-6.0.29/work/Catalina/localhost/sonar/loader/rack/handler/servlet.rb:19:in `call'
      

      Some investigation indicates that this is because Alert events where the status goes Green have a null description. Any project where this has happened gets this error when the History section is viewed.

      If I manually update the EVENT table e.g.
      update EVENTS set description = 'something' where name like 'Green%'
      This fixes the problem and the History view displays correctly.

      I lowered my Alert threshold in order to trigger a new Green alert in Sonar 2.13.1 and the Alert EVENT created still had a null description so this seems to be a general problem and not just due to my historic data.

      Presumably the safest fix is to protect against a null description...

        Attachments

          Activity

            People

            Assignee:
            fabemn OLD - Fabrice Bellingard
            Reporter:
            cowplater Paul Harris
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: