Migration error in foreman_bootdisk upgrading from 6.1 to 6.2
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):
Steps to Reproduce:
1. Install Satellite 6.1
2. Perform a Satellite 6.2 upgrade (e.g. update repos/packages, foreman-installer --upgrade)
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
NoMethodError: undefined method `request_uuid' for #<Audited::Adapters::ActiveRecord::Audit:0x0000000a4b69a0>
/usr/share/foreman/app/models/setting.rb:201:in `block in create_existing'
/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 `block in load_defaults'
Fixes #14965 - turn off auditing during DB migrations
Move code turning off auditing during db:migrations so that it is
executed earlier than initializers
#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.