jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Sonar
  • SONAR-1819

Unable to restore a Sonar backup which contains some manual metric definitions

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.2
  • Fix Version/s: 2.5
  • Component/s: Backup, Manual Review
  • Labels:
    None
  • Environment:
    Tomcat : apache-tomcat-6.0.29
    apache-maven-2.2.1
    MySQL-server-5.1.50-1.glibc23.x86_64

    Linux se1p0xwamp009.gameop.net 2.6.18-128.7.1.el5 #1 SMP Wed Aug 19 04:00:49 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux


Description

The restore operation doesn't work. It gives following error:
The backup on version 1.12 works fine and produces enclosed file below

NativeException (javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: org.sonar.api.measures.Metric):
org/hibernate/ejb/AbstractEntityManagerImpl.java:614:in `throwPersistenceException'
org/hibernate/ejb/AbstractEntityManagerImpl.java:226:in `persist'
org/sonar/api/database/daos/MeasuresDao.java:97:in `persistMetric'
org/sonar/api/database/daos/MeasuresDao.java:84:in `registerMetrics'
org/sonar/server/configuration/MetricsBackup.java:66:in `registerMetrics'
org/sonar/server/configuration/MetricsBackup.java:56:in `importXml'
org/sonar/server/configuration/Backup.java:112:in `importBackupablesXml'
org/sonar/server/configuration/Backup.java:104:in `importXml'
/app/controllers/backup_controller.rb:41:in `import'
/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'
file:/lib/jruby-complete-1.4.0.jar!/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'
file:/lib/jruby-rack-0.9.6.jar!/rack/adapter/rails_cgi.rb:25:in `call'
file:/lib/jruby-rack-0.9.6.jar!/rack/adapter/rails.rb:36:in `serve_rails'
file:/lib/jruby-rack-0.9.6.jar!/rack/adapter/rails.rb:41:in `call'
file:/lib/jruby-rack-0.9.6.jar!/jruby/rack/rails.rb:149:in `call'
file:/lib/jruby-rack-0.9.6.jar!/rack/handler/servlet.rb:19:in `call'
:1

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. XML File
    sonar_backup_2010-09-27.xml
    27/Sep/10 9:13 AM
    454 kB
    Mikael Lejdstrom

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Freddy Mallet added a comment - 07/Oct/10 8:35 AM

Hi Mickaël, in fact the problem comes from the manual metrics section. If you delete this section the backup is well restored. I've updated the title of the ticket.
Thanks

Show
Freddy Mallet added a comment - 07/Oct/10 8:35 AM Hi Mickaël, in fact the problem comes from the manual metrics section. If you delete this section the backup is well restored. I've updated the title of the ticket. Thanks
Hide
Permalink
Freddy Mallet added a comment - 07/Oct/10 8:37 AM

Additional information : When the manual metric already exists, the restore operation doesn't fail.

Show
Freddy Mallet added a comment - 07/Oct/10 8:37 AM Additional information : When the manual metric already exists, the restore operation doesn't fail.
Hide
Permalink
Evgeny Mandrikov added a comment - 07/Dec/10 7:24 AM

Hi,
Problem comes from the fact that each manual metric in backup contains ID. If someone experiencing the same problem, then workaround - is to delete those IDs.
Fixed in r6183.

Show
Evgeny Mandrikov added a comment - 07/Dec/10 7:24 AM Hi, Problem comes from the fact that each manual metric in backup contains ID. If someone experiencing the same problem, then workaround - is to delete those IDs. Fixed in r6183.

People

  • Assignee:
    Evgeny Mandrikov
    Reporter:
    Mikael Lejdstrom
Vote (0)
Watch (0)

Dates

  • Created:
    27/Sep/10 9:13 AM
    Updated:
    26/Apr/11 7:23 AM
    Resolved:
    07/Dec/10 7:24 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.