Foreman 1.7.2 db:migrate fails

We have foreman 1.7.2 installed, but our db:migrate is failing with the
following trace…

== AddProvisionMethodToHosts: migrating

··· ====================================== -- add_column(:hosts, :provision_method, :string) -> 0.0357s rake aborted! An error has occurred, all later migrations canceled: undefined method `grub_pass=' for # /opt/rh/ruby193/root/usr/share/gems/gems/activemodel-3.2.8/lib/active_model/attribute_methods.rb:407:in `method_missing' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods.rb:149:in `method_missing' /usr/share/foreman/app/models/concerns/host_common.rb:114:in `crypt_root_pass' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:649:in `_run__1255548035901262592__save__3724573348736209837__callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:405:in `__run_callback' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:385:in `_run_save_callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activesupport-3.2.8/lib/active_support/callbacks.rb:81:in `run_callbacks' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/callbacks.rb:264:in `create_or_update' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/persistence.rb:84:in `save' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/validations.rb:50:in `save' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/attribute_methods/dirty.rb:22:in `save' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:241:in `block (2 levels) 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:241:in `block in save' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:252:in `rollback_active_record_state!' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/transactions.rb:240:in `save' /usr/share/foreman/app/models/concerns/foreman/sti.rb:29:in `save_with_type' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/persistence.rb:184:in `update_attribute' /usr/share/foreman/db/migrate/20140304184854_add_provision_method_to_hosts.rb:5: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/20140304184854_add_provision_method_to_hosts.rb:4:in `up' /opt/rh/ruby193/root/usr/share/gems/gems/activerecord-3.2.8/lib/active_record/migration.rb:370: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

which version of foreman are you upgrading from?

Ohad

··· On Wed, Feb 11, 2015 at 5:31 PM, LuckDuck71 wrote:

ethod `grub_pass=’ for #<Host

1.7.1

··· On Wednesday, February 11, 2015 at 10:54:18 AM UTC-5, ohad wrote:

On Wed, Feb 11, 2015 at 5:31 PM, LuckDuck71 <will.h...@gmail.com > <javascript:>> wrote:

ethod `grub_pass=’ for #<Host

which version of foreman are you upgrading from?

Ohad

I was able to workaround this issue by moving
/usr/share/foreman/db/migrate/20140304184854_add_provision_method_to_hosts.rb
to
/usr/share/foreman/db/migrate/20141204184854_add_provision_method_to_hosts.rb

essentially changing the order in which this update was called.
With this modification the foreman-rake db:migrate completed without any
errors and after the foreman-rake db:seed I was able to login to the
dashboard and everything was up and running again.

Thanks
W.

··· On Wednesday, February 11, 2015 at 10:57:06 AM UTC-5, LuckDuck71 wrote: > > > 1.7.1 > > On Wednesday, February 11, 2015 at 10:54:18 AM UTC-5, ohad wrote: > >> >> On Wed, Feb 11, 2015 at 5:31 PM, LuckDuck71 wrote: >> >>> ethod `grub_pass=' for #> >> >> which version of foreman are you upgrading from? >> >> Ohad >> >

Just wanted to report I had the same issue migrating from 1.7 to 1.8.3. The
fix LuckDuck71 reported worked for my migration as well.

Thanks,
Keith.

··· On Wednesday, February 11, 2015 at 3:56:45 PM UTC-5, LuckDuck71 wrote: > > I was able to workaround this issue by moving > /usr/share/foreman/db/migrate/20140304184854_add_provision_method_to_hosts.rb > to > /usr/share/foreman/db/migrate/20141204184854_add_provision_method_to_hosts.rb > > essentially changing the order in which this update was called. > With this modification the foreman-rake db:migrate completed without any > errors and after the foreman-rake db:seed I was able to login to the > dashboard and everything was up and running again. > > Thanks > W. > > > > On Wednesday, February 11, 2015 at 10:57:06 AM UTC-5, LuckDuck71 wrote: >> >> >> 1.7.1 >> >> On Wednesday, February 11, 2015 at 10:54:18 AM UTC-5, ohad wrote: >> >>> >>> On Wed, Feb 11, 2015 at 5:31 PM, LuckDuck71 wrote: >>> >>>> ethod `grub_pass=' for #>> >>> >>> which version of foreman are you upgrading from? >>> >>> Ohad >>> >>

Just another follow up. I had the same issue going from 1.8.3 to 1.9.0-1. I
had to move the file again after the install had moved it back.

Thanks,
Keith.

··· On Thursday, September 3, 2015 at 12:55:27 PM UTC-4, Keith O'Brien wrote: > > Just wanted to report I had the same issue migrating from 1.7 to 1.8.3. > The fix LuckDuck71 reported worked for my migration as well. > > Thanks, > Keith. > > On Wednesday, February 11, 2015 at 3:56:45 PM UTC-5, LuckDuck71 wrote: >> >> I was able to workaround this issue by moving >> /usr/share/foreman/db/migrate/20140304184854_add_provision_method_to_hosts.rb >> to >> /usr/share/foreman/db/migrate/20141204184854_add_provision_method_to_hosts.rb >> >> essentially changing the order in which this update was called. >> With this modification the foreman-rake db:migrate completed without any >> errors and after the foreman-rake db:seed I was able to login to the >> dashboard and everything was up and running again. >> >> Thanks >> W. >> >> >> >> On Wednesday, February 11, 2015 at 10:57:06 AM UTC-5, LuckDuck71 wrote: >>> >>> >>> 1.7.1 >>> >>> On Wednesday, February 11, 2015 at 10:54:18 AM UTC-5, ohad wrote: >>> >>>> >>>> On Wed, Feb 11, 2015 at 5:31 PM, LuckDuck71 >>>> wrote: >>>> >>>>> ethod `grub_pass=' for #>>> >>>> >>>> which version of foreman are you upgrading from? >>>> >>>> Ohad >>>> >>>