1.7.5 to 1.8.1 rake migrate fails

When upgrading from 1.7.5 to 1.8.1 on EL6.6, our db:migrate fails. The
system it complains about is our server. We don't yet provision with
foreman.

The bug report for this issue is here:
http://projects.theforeman.org/issues/10642

Unfortunately we've found that our mysqldump backups are empty (not failed,
just empty), so we're stuck with fixing the 1.8.1 upgrade. Are there any
patches or manual intervention we can perform? Or is there a 1.8.2 branch
we can move to?

The trace of the migrate is as follows:

[root@lnxcuc ~]# foreman-rake --trace db:migrate
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== CopyUnmanagedHostsToInterfaces: migrating

··· ================================= -- Migrating Unmanaged Host interfaces to standalone Interfaces -- Migrated lnxcuc.classe.cornell.edu-eth0 to nics rake aborted! An error has occurred, all later migrations canceled:

Validation failed: IP address has already been taken
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in
save!' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:insave!’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in
block in save!' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:inblock in with_transaction_returning_status’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in
transaction' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:intransaction’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in
with_transaction_returning_status' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:insave!’
/usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb:36:in
block in up' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:ineach’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in
each' /usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb:21:inup’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:410:in
block (2 levels) in migrate' /opt/rh/ruby193/root/usr/share/ruby/benchmark.rb:280:inmeasure’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:410:in
block in migrate' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:123:inwith_connection’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:389:in
migrate' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:528:inmigrate’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:720:in
block (2 levels) in migrate' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:777:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:777:in
ddl_transaction' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:719:inblock in migrate’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:700:in
each' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:700:inmigrate’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:570:in
up' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:551:inmigrate’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:153:in
block (2 levels) in <top (required)>' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:incall’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in block in execute' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:ineach’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in execute' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:inblock in
invoke_with_call_chain’
/opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in mon_synchronize' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:ininvoke_with_call_chain’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in invoke' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:ininvoke_task’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in block (2 levels) in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:ineach’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in block in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:instandard_exception_handling’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:inblock in run’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:inrun’
/opt/rh/ruby193/root/usr/bin/rake:32:in `'
Tasks: TOP => db:migrate

I had to go through Foreman and manage each host. I ended up just skipping
this step since most of my hosts are unmanaged and I didn't want to go
through the trouble of managing each one.

··· On Tuesday, June 2, 2015 at 11:01:31 AM UTC-5, devin....@cornell.edu wrote: > > When upgrading from 1.7.5 to 1.8.1 on EL6.6, our db:migrate fails. The > system it complains about is our server. We don't yet provision with > foreman. > > The bug report for this issue is here: > http://projects.theforeman.org/issues/10642 > > Unfortunately we've found that our mysqldump backups are empty (not > failed, just empty), so we're stuck with fixing the 1.8.1 upgrade. Are > there any patches or manual intervention we can perform? Or is there a > 1.8.2 branch we can move to? > > The trace of the migrate is as follows: > > [root@lnxcuc ~]# foreman-rake --trace db:migrate > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Invoke db:load_config (first_time) > ** Execute db:load_config > ** Execute db:migrate > == CopyUnmanagedHostsToInterfaces: migrating > ================================= > -- Migrating Unmanaged Host interfaces to standalone Interfaces > -- Migrated lnxcuc.classe.cornell.edu-eth0 to nics > rake aborted! > An error has occurred, all later migrations canceled: > > Validation failed: IP address has already been taken > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:56:in > `save!' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:33:in > `save!' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in > `block in save!' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:295:in > `block in with_transaction_returning_status' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/database_statements.rb:192:in > `transaction' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:208:in > `transaction' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:293:in > `with_transaction_returning_status' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:246:in > `save!' > /usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb:36:in > `block in up' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in > `each' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/relation/delegation.rb:6:in > `each' > /usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb:21:in > `up' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:410:in > `block (2 levels) in migrate' > /opt/rh/ruby193/root/usr/share/ruby/benchmark.rb:280:in `measure' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:410:in > `block in migrate' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/connection_adapters/abstract/connection_pool.rb:123:in > `with_connection' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:389:in > `migrate' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:528:in > `migrate' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:720:in > `block (2 levels) in migrate' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:777:in > `call' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:777:in > `ddl_transaction' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:719:in > `block in migrate' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:700:in > `each' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:700:in > `migrate' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:570:in > `up' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:551:in > `migrate' > /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/railties/databases.rake:153:in > `block (2 levels) in ' > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `call' > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in `block in execute' > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `each' > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in `execute' > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:in `block in > invoke_with_call_chain' > /opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize' > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:in > `invoke_with_call_chain' > /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in `invoke' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:in > `invoke_task' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block (2 > levels) in top_level' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `each' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in `block in > top_level' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in > `standard_exception_handling' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in `top_level' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:in `block in > run' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in > `standard_exception_handling' > /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:in `run' > /opt/rh/ruby193/root/usr/bin/rake:32:in `' > Tasks: TOP => db:migrate > >

Sorry for late answer. This should work with 1.8.2 so just installing newer
version and reruning migration task should help.

··· -- Marek

On Tuesday 09 of June 2015 14:39:42 TJ Walker wrote:

I had to go through Foreman and manage each host. I ended up just skipping
this step since most of my hosts are unmanaged and I didn’t want to go
through the trouble of managing each one.

On Tuesday, June 2, 2015 at 11:01:31 AM UTC-5, devin....@cornell.edu wrote:

When upgrading from 1.7.5 to 1.8.1 on EL6.6, our db:migrate fails. The
system it complains about is our server. We don’t yet provision with
foreman.

The bug report for this issue is here:
Bug #10642: Migration of unmanaged host can fail on primary interface - Foreman

Unfortunately we’ve found that our mysqldump backups are empty (not
failed, just empty), so we’re stuck with fixing the 1.8.1 upgrade. Are
there any patches or manual intervention we can perform? Or is there a
1.8.2 branch we can move to?

The trace of the migrate is as follows:

[root@lnxcuc ~]# foreman-rake --trace db:migrate
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== CopyUnmanagedHostsToInterfaces: migrating

– Migrating Unmanaged Host interfaces to standalone Interfaces
– Migrated lnxcuc.classe.cornell.edu-eth0 to nics
rake aborted!
An error has occurred, all later migrations canceled:

Validation failed: IP address has already been taken
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/validations.rb:56:in save!' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/attribute_methods/dirty.rb:33:insave!’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/transactions.rb:246:in block in save!' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/transactions.rb:295:inblock in with_transaction_returning_status’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/connection_adapters/abstract/database_statements.rb:192:in
transaction' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/transactions.rb:208:intransaction’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/transactions.rb:293:in with_transaction_returning_status' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/transactions.rb:246:insave!’
/usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_inter
faces.rb:36:in block in up' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/relation/delegation.rb:6:ineach’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/relation/delegation.rb:6:in each' /usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_inter faces.rb:21:inup’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/migration.rb:410:in block (2 levels) in migrate' /opt/rh/ruby193/root/usr/share/ruby/benchmark.rb:280:inmeasure’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/migration.rb:410:in block in migrate' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/connection_adapters/abstract/connection_pool.rb:123:inwith_connection’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/migration.rb:389:in migrate' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/migration.rb:528:inmigrate’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/migration.rb:720:in block (2 levels) in migrate' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/migration.rb:777:incall’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/migration.rb:777:in ddl_transaction' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/migration.rb:719:inblock in migrate’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/migration.rb:700:in each' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/migration.rb:700:inmigrate’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/migration.rb:570:in up' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec ord/migration.rb:551:inmigrate’
/opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_rec
ord/railties/databases.rake:153:in block (2 levels) in <top (required)>' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:incall’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:205:in block in execute' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:ineach’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:200:in execute' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:158:inblock in
invoke_with_call_chain’
/opt/rh/ruby193/root/usr/share/ruby/monitor.rb:211:in mon_synchronize' /opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:151:ininvoke_with_call_chain’
/opt/rh/ruby193/root/usr/share/ruby/rake/task.rb:144:in invoke' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:116:ininvoke_task’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in block (2 levels) in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:ineach’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:94:in block in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:instandard_exception_handling’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:88:in top_level' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:66:inblock in
run’
/opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:133:in
standard_exception_handling' /opt/rh/ruby193/root/usr/share/ruby/rake/application.rb:63:inrun’
/opt/rh/ruby193/root/usr/bin/rake:32:in `'
Tasks: TOP => db:migrate


Marek