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

Fail to upgrade to SQ 4.3 on migration UpdateMeasureFiltersOnDebtToMinutes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 4.3
    • Fix Version/s: 4.4
    • Component/s: Database, Measures
    • Labels:
      None

      Description

      The migration can fail in the following case:

      • a user has defined a measure filter with a condition on the technical debt metric
      • this measure filter is shared

      In such case, the error is the following one:

      2014.06.25 16:11:35 INFO  [DbMigration]  ==  UpdateConditionsOnDebtToMinutes: migrated (0.0560s) =======================
      2014.06.25 16:11:35 INFO  [DbMigration]  
      2014.06.25 16:11:35 INFO  [DbMigration]  ==  UpdateMeasureFiltersOnDebtToMinutes: migrating ============================
      2014.06.25 16:11:35 ERROR [o.s.s.ui.JRubyFacade]  Fail to upgrade database
      An error has occurred, all later migrations canceled:
      
      undefined method `globalPermissions' for nil:NilClass
      	xxx/sonar/web/WEB-INF/lib/need_authorization.rb:62:in `has_role?'
      	org/jruby/RubyKernel.java:2227:in `send'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/associations/association_proxy.rb:215:in `method_missing'
      	xxx/sonar/web/WEB-INF/app/models/measure_filter.rb:331:in `validate'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/validations.rb:1110:in `valid?'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/callbacks.rb:315:in `valid_with_callbacks?'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/validations.rb:1098:in `save_with_validation!'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/dirty.rb:87:in `save_with_dirty!'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/transactions.rb:200:in `save_with_transactions!'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/connection_adapters/abstract/database_statements.rb:136:in `transaction'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/transactions.rb:182:in `transaction'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/transactions.rb:200:in `save_with_transactions!'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/transactions.rb:208:in `rollback_active_record_state!'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/transactions.rb:200:in `save_with_transactions!'
      	xxx/sonar/web/WEB-INF/config/../lib/../db/migrate/519_update_measure_filters_on_debt_to_minutes.rb:57:in `up'
      	org/jruby/RubyArray.java:1613:in `each'
      	xxx/sonar/web/WEB-INF/config/../lib/../db/migrate/519_update_measure_filters_on_debt_to_minutes.rb:45:in `up'
      	org/jruby/RubyKernel.java:2223:in `send'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:282:in `migrate'
      	jar:file:/xxx/sonar/web/WEB-INF/lib/jruby-complete-1.7.9.jar!/META-INF/jruby.home/lib/ruby/1.8/benchmark.rb:293:in `measure'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:282:in `migrate'
      	org/jruby/RubyKernel.java:2227:in `send'
      	C:1:in `migrate'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:491:in `migrate'
      	org/jruby/RubyProc.java:290:in `call'
      	org/jruby/RubyProc.java:224:in `call'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:567:in `ddl_transaction'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:490:in `migrate'
      	org/jruby/RubyArray.java:1613:in `each'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:477:in `migrate'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:401:in `up'
      	xxx/sonar/web/WEB-INF/gems/gems/activerecord-2.3.15/lib/active_record/migration.rb:383:in `migrate'
      	xxx/sonar/web/WEB-INF/config/../lib/database_version.rb:62:in `upgrade_and_start'
      	xxx/sonar/web/WEB-INF/app/models/database_migration_manager.rb:109:in `start_migration'
      	org/jruby/RubyProc.java:290:in `call'
      	org/jruby/RubyProc.java:228:in `call'
      

        Attachments

          Activity

            People

            Assignee:
            julien.lancelot Julien Lancelot
            Reporter:
            simon.brandhof Simon Brandhof (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Due:
              Created:
              Updated:
              Resolved: