Project

General

Profile

Bug #14965

Migration error in foreman_bootdisk upgrading from 6.1 to 6.2

Added by Martin Bacovsky over 4 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Category:
Audit Log
Target version:
Difficulty:
Triaged:
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1333027
Description of problem:

Attempting to upgrade to an early version of Satellite 6.2 Beta (internal build) from 6.1 is resulting in an error during the migration of the foreman_bootdisk plugin.

Version-Release number of selected component (if applicable):

foreman-1.11.0.17-1.el7sat.noarch
tfm-rubygem-foreman_bootdisk-6.1.0-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. Install Satellite 6.1
2. Perform a Satellite 6.2 upgrade (e.g. update repos/packages, foreman-installer --upgrade)

Actual results:

Partial error: (Full log will be attached)

[ INFO 2016-05-04 12:50:12 main] Upgrade Step: migrate_foreman...
[ERROR 2016-05-04 12:50:20 main] /opt/theforeman/tfm/root/usr/share/gems/gems/docker-api-1.17.0/lib/docker.rb:103: warning: circular argument reference - connection
rake aborted!
NoMethodError: undefined method `request_uuid' for #<Audited::Adapters::ActiveRecord::Audit:0x0000000a4b69a0>
/opt/rh/rh-ror41/root/usr/share/gems/gems/activemodel-4.1.5/lib/active_model/attribute_methods.rb:435:in `method_missing'
/opt/rh/rh-ror41/root/usr/share/gems/gems/activerecord-4.1.5/lib/active_record/attribute_methods.rb:208:in `method_missing'
...
...
/usr/share/foreman/app/models/setting.rb:201:in `block in create_existing'
/usr/share/foreman/app/models/setting.rb:210:in `bypass_readonly'
/usr/share/foreman/app/models/setting.rb:197:in `create_existing'
/usr/share/foreman/app/models/setting.rb:173:in `create'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-6.1.0/app/models/setting/bootdisk.rb:17:in `block (2 levels) in load_defaults'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-6.1.0/app/models/setting/bootdisk.rb:17:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_bootdisk-6.1.0/app/models/setting/bootdisk.rb:17:in `block in load_defaults'
...
...

Expected results:

No error.

Additional info:


Related issues

Related to Foreman - Bug #10740: Audits created during DB migration of ptables to templatesClosed2015-06-09

Associated revisions

Revision 75bb05af (diff)
Added by Martin Bacovsky over 4 years ago

Fixes #14965 - turn off auditing during DB migrations

Move code turning off auditing during db:migrations so that it is
executed earlier than initializers

Revision b624b40b (diff)
Added by Martin Bacovsky over 4 years ago

Fixes #14965 - turn off auditing during DB migrations

Move code turning off auditing during db:migrations so that it is
executed earlier than initializers

(cherry picked from commit 75bb05afca82e564ecf4172e33c4dc7d394d23a6)

History

#1 Updated by Martin Bacovsky over 4 years ago

  • Related to Bug #10740: Audits created during DB migration of ptables to templates added

#2 Updated by Martin Bacovsky over 4 years ago

  • Category set to Audit Log
  • Status changed from New to Assigned

Some engines (e.g. bootdisk, discovery) are accessing Settings in their initializers which are executed before the audited initializer that turns off auditing during db:migrate. If audited itself depends on pending migration (e.g. during upgrade) it can fail during rake db:migrate.

#3 Updated by The Foreman Bot over 4 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3505 added

#4 Updated by Martin Bacovsky over 4 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal over 4 years ago

  • Legacy Backlogs Release (now unused) set to 155

Also available in: Atom PDF