Upgrade Failure on db:migrate v1.7.5 to 1.13 - what now?

Greetings!

Updating to the latest and greatest foreman - following the outstanding
online documentation and received the following error (please note paste is
with --trace option):

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

··· =================== -- Migrating Unmanaged Host interfaces to standalone Interfaces -- ... migrating %DBSERVER-EDITED% rake aborted! StandardError: An error has occurred, all later migrations canceled:

undefined local variable or method ip6' for #<Nic::Managed:0x00000004e08a18>/opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/attribute_methods.rb:433:inmethod_missing’
/usr/share/foreman/app/models/nic/interface.rb:92:in normalize_ip' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/ active_support/callbacks.rb:432:inblock in make_lambda’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:164:in
call' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:164:inblock in halting’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/
active_support/callbacks.rb:504:in call' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:inblock in call’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:in
each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/ active_support/callbacks.rb:504:incall’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:in
__run_callbacks__' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:778:in_run_validation_callbacks’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/
active_model/validations/callbacks.rb:113:in run_validations!' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/validations.rb:338:invalid?’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/validations.rb:58:in
valid?' /usr/share/foreman/app/models/concerns/orchestration.rb:77:invalid?’
/usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb:27:in
block in up' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:ineach’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/relation/delegation.rb:46:in each' /usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb:21:inup’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:611:in
exec_migration' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/migration.rb:592:inblock (2 levels) in migrate’
/opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:288:in measure' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:591:inblock in migrate’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/connection_adapters/abstract/connection_pool.rb:292:in
with_connection' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:590:inmigrate’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:768:in
migrate' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/migration.rb:998:inblock in
execute_migration_in_transaction’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:1046:in
ddl_transaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:997:inexecute_migration_in_transaction’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/migration.rb:959:in block in migrate' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:ineach’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in
migrate' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/migration.rb:823:inup’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:801:in
migrate' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:137:inmigrate’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/railties/databases.rake:44:in block (2 levels) in <top (required)>' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:incall’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in
block in execute' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235: ineach’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in
execute' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:inblock in invoke_with_call_chain’
/opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in mon_synchronize' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:ininvoke_with_call_chain’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:in
invoke' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application. rb:150:ininvoke_task’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in
block (2 levels) in top_level' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:ineach’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.
rb:106:in block in top_level' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:inrun_with_threads’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:in
top_level' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application. rb:78:inblock in run’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in
standard_exception_handling' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:inrun’
/opt/rh/rh-ruby22/root/usr/bin/rake:33:in <main>' NameError: undefined local variable or methodip6’ for
#Nic::Managed:0x00000004e08a18
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/attribute_methods.rb:433:in
method_missing' /usr/share/foreman/app/models/nic/interface.rb:92:innormalize_ip’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:432:in
block in make_lambda' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:164:incall’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/
active_support/callbacks.rb:164:in block in halting' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:incall’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:in
block in call' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/ active_support/callbacks.rb:504:ineach’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:504:in
call' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/callbacks.rb:92:inrun_callbacks
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/
active_support/callbacks.rb:778:in _run_validation_callbacks' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/validations/callbacks.rb:113:inrun_validations!’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activemodel-4.2.5.1/lib/active_model/validations.rb:338:in
valid?' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/validations.rb:58:invalid?’
/usr/share/foreman/app/models/concerns/orchestration.rb:77:in valid?' /usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb:27:inblock in up’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/relation/delegation.rb:46:in each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/relation/delegation.rb:46:ineach’
/usr/share/foreman/db/migrate/20150508124600_copy_unmanaged_hosts_to_interfaces.rb:21:in
up' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/migration.rb:611:inexec_migration’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:592:in
block (2 levels) in migrate' /opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:288:inmeasure’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/migration.rb:591:in block in migrate' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:inwith_connection’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:590:in
migrate' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/migration.rb:768:inmigrate’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:998:in
block in execute_migration_in_transaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:1046:inddl_transaction’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/migration.rb:997:in execute_migration_in_transaction' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:959:inblock in migrate’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in
each' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/ active_record/migration.rb:955:inmigrate’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:823:in
up' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:801:inmigrate’
/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/
active_record/tasks/database_tasks.rb:137:in migrate' /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:44:inblock (2 levels) in <top (required)>’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in
call' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240: inblock in execute’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in
each' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:inexecute’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:
in block in invoke_with_call_chain' /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:inmon_synchronize’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:in
invoke_with_call_chain' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165: ininvoke’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:in
invoke_task' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:inblock (2 levels) in top_level’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.
rb:106:in each' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:inblock in top_level’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:in
run_with_threads' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application. rb:100:intop_level’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:in
block in run' /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:instandard_exception_handling’
/opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.
rb:75:in run' /opt/rh/rh-ruby22/root/usr/bin/rake:33:in'
Tasks: TOP => db:migrate

Did some googling w/ no such luck.

From what it seems - ipv6 error? IPV6 is disabled on this system. CentOS7
x64.

Any guidance is appreciated!!

This is issue Bug #15920: migration CopyUnmanagedHostsToInterfaces may fail on interface conversations when ipv6 migration has not occurred - Foreman. It might be
possible to run foreman-rake db:migrate:up VERSION=20160415134454
first before the main db:migrate run. (After restoring the DB from backup.)

Note that our upgrades are not supported over multiple versions, it's
strongly recommended to upgrade each version in turn and to follow each
set of upgrade notes.

··· On 18/10/16 04:26, Austin Smith wrote: > Updating to the latest and greatest foreman - following the outstanding > online documentation and received the following error (please note paste > is with --trace option): > > > > [root@%FOREMANSERVER-EDITED%~]# foreman-rake db:migrate --trace > **Invokedb:migrate (first_time) > **Invokeenvironment (first_time) > **Executeenvironment > **Invokedb:load_config (first_time) > **Executedb:load_config > **Executedb:migrate > ==20150508124600CopyUnmanagedHostsToInterfaces:migrating =================== > --MigratingUnmanagedHostinterfaces to standalone Interfaces > -- ...migrating %DBSERVER-EDITED% > rake aborted! > StandardError:Anerror has occurred,all later migrations canceled: > > > undefinedlocalvariable ormethod `ip6' for # > >


Dominic Cleal
dominic@cleal.org

Thank you for the reply - wonder why this did not show up in search
results. If appears to have run successfully w/o a restoration of the DB.

I would like to request the upgrade documetnation be updated on the foreman
site to reflect the version step-up needing to take place. Happy to submit
the changes to contribute to the document if instructions can be provided :wink:

Thanks again! I appreciate your hard work and prompt reply!!

··· On Tuesday, October 18, 2016 at 4:27:03 AM UTC-4, Dominic Cleal wrote: > > On 18/10/16 04:26, Austin Smith wrote: > > Updating to the latest and greatest foreman - following the outstanding > > online documentation and received the following error (please note paste > > is with --trace option): > > > > > > > [root@%FOREMANSERVER-EDITED%~]# foreman-rake db:migrate --trace > > **Invokedb:migrate (first_time) > > **Invokeenvironment (first_time) > > **Executeenvironment > > **Invokedb:load_config (first_time) > > **Executedb:load_config > > **Executedb:migrate > > ==20150508124600CopyUnmanagedHostsToInterfaces:migrating > =================== > > --MigratingUnmanagedHostinterfaces to standalone Interfaces > > -- ...migrating %DBSERVER-EDITED% > > rake aborted! > > StandardError:Anerror has occurred,all later migrations canceled: > > > > > > undefinedlocalvariable ormethod `ip6' for > # > > > > > This is issue http://projects.theforeman.org/issues/15920. It might be > possible to run `foreman-rake db:migrate:up VERSION=20160415134454` > first before the main db:migrate run. (After restoring the DB from > backup.) > > Note that our upgrades are not supported over multiple versions, it's > strongly recommended to upgrade each version in turn and to follow each > set of upgrade notes. > > -- > Dominic Cleal > dom...@cleal.org >

There is a note at the top of the upgrade instructions here:
https://theforeman.org/manuals/1.13/index.html#3.6Upgrade

Improvements can be sent by editing


and sending a pull request (all possible via the GitHub web UI, using
the edit button in the top-right).

··· On 19/10/16 10:09, Austin Smith wrote: > Thank you for the reply - wonder why this did not show up in search > results. If appears to have run successfully w/o a restoration of the DB. > > I would like to request the upgrade documetnation be updated on the > foreman site to reflect the version step-up needing to take place. > Happy to submit the changes to contribute to the document if > instructions can be provided ;)


Dominic Cleal
dominic@cleal.org

You got me! I totally missed that!! :frowning:

And perhaps I spoke too soon - Got another error… :frowning: :frowning:

I ran the command you pasted, everything ran successfully. I attempted to
step to foreman-rake db:seed and received notice I had 63 pending
transactions.

So I ran the following:

[root@v-atl-centos-7-puppet-01 ~]# foreman-rake db:migrate --trace

··· > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Invoke db:load_config (first_time) > ** Execute db:load_config > ** Execute db:migrate > == 20151104100257 AddHostsCountToHostgroup: migrating > ========================= > -- add_column(:hostgroups, :hosts_count, :integer, {:default=>0}) > rake aborted! > StandardError: An error has occurred, all later migrations canceled: > Mysql2::Error: Duplicate column name 'hosts_count': ALTER TABLE > `hostgroups` ADD `hosts_count` int(11) DEFAULT > 0/opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `query' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `block in execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:472:in > `block in log' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in > `instrument' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:466:in > `log' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in > `execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:393:in > `add_column' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:665:in > `block in method_missing' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:634:in > `block in say_with_time' > /opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:288:in `measure' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:634:in > `say_with_time' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:654:in > `method_missing' > /usr/share/foreman/db/migrate/20151104100257_add_hosts_count_to_hostgroup.rb:3:in > `up' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:611:in > `exec_migration' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:592:in > `block (2 levels) in migrate' > /opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:288:in `measure' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:591:in > `block in migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in > `with_connection' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:590:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:768:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:998:in > `block in execute_migration_in_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:1046:in > `ddl_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:997:in > `execute_migration_in_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:959:in > `block in migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in > `each' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:823:in > `up' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:801:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:137:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:44:in > `block (2 levels) in ' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in > `call' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in > `block in execute' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in > `each' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in > `execute' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:in > `block in invoke_with_call_chain' > /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:in > `invoke_with_call_chain' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:in > `invoke' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:in > `invoke_task' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in > `block (2 levels) in top_level' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in > `each' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in > `block in top_level' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:in > `run_with_threads' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:in > `top_level' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:in > `block in run' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in > `standard_exception_handling' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in > `run' > /opt/rh/rh-ruby22/root/usr/bin/rake:33:in `' > ActiveRecord::StatementInvalid: Mysql2::Error: Duplicate column name > 'hosts_count': ALTER TABLE `hostgroups` ADD `hosts_count` int(11) DEFAULT 0 > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `query' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `block in execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:472:in > `block in log' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in > `instrument' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:466:in > `log' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in > `execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:393:in > `add_column' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:665:in > `block in method_missing' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:634:in > `block in say_with_time' > /opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:288:in `measure' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:634:in > `say_with_time' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:654:in > `method_missing' > /usr/share/foreman/db/migrate/20151104100257_add_hosts_count_to_hostgroup.rb:3:in > `up' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:611:in > `exec_migration' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:592:in > `block (2 levels) in migrate' > /opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:288:in `measure' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:591:in > `block in migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in > `with_connection' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:590:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:768:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:998:in > `block in execute_migration_in_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:1046:in > `ddl_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:997:in > `execute_migration_in_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:959:in > `block in migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in > `each' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:823:in > `up' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:801:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:137:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:44:in > `block (2 levels) in ' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in > `call' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in > `block in execute' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in > `each' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in > `execute' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:in > `block in invoke_with_call_chain' > /opt/rh/rh-ruby22/root/usr/share/ruby/monitor.rb:211:in `mon_synchronize' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:172:in > `invoke_with_call_chain' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:165:in > `invoke' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:150:in > `invoke_task' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in > `block (2 levels) in top_level' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in > `each' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:106:in > `block in top_level' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:115:in > `run_with_threads' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:100:in > `top_level' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:78:in > `block in run' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:176:in > `standard_exception_handling' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/application.rb:75:in > `run' > /opt/rh/rh-ruby22/root/usr/bin/rake:33:in `' > Mysql2::Error: Duplicate column name 'hosts_count' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `query' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `block in execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:472:in > `block in log' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/notifications/instrumenter.rb:20:in > `instrument' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_adapter.rb:466:in > `log' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in > `execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in > `execute' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:393:in > `add_column' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:665:in > `block in method_missing' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:634:in > `block in say_with_time' > /opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:288:in `measure' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:634:in > `say_with_time' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:654:in > `method_missing' > /usr/share/foreman/db/migrate/20151104100257_add_hosts_count_to_hostgroup.rb:3:in > `up' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:611:in > `exec_migration' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:592:in > `block (2 levels) in migrate' > /opt/rh/rh-ruby22/root/usr/share/ruby/benchmark.rb:288:in `measure' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:591:in > `block in migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in > `with_connection' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:590:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:768:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:998:in > `block in execute_migration_in_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:1046:in > `ddl_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:997:in > `execute_migration_in_transaction' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:959:in > `block in migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in > `each' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:955:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:823:in > `up' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/migration.rb:801:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/tasks/database_tasks.rb:137:in > `migrate' > /opt/rh/sclo-ror42/root/usr/share/gems/gems/activerecord-4.2.5.1/lib/active_record/railties/databases.rake:44:in > `block (2 levels) in ' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in > `call' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:240:in > `block in execute' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in > `each' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:235:in > `execute' > /opt/rh/rh-ruby22/root/usr/share/gems/gems/rake-10.4.2/lib/rake/task.rb:179:in >

This suggests that the migration's been run already but the fact it ran
hasn't been recorded (in schema_migrations). I'd consider restoring the
DB and running the migration again in case it's been left in a
half-migrated state from earlier errors.

··· On 19/10/16 10:20, Austin Smith wrote: > You got me! I totally missed that!! :( > > And perhaps I spoke too soon - Got another error.. :( :( > > I ran the command you pasted, everything ran successfully. I attempted > to step to foreman-rake db:seed and received notice I had 63 pending > transactions. > > So I ran the following: > > [root@v-atl-centos-7-puppet-01 ~]# foreman-rake db:migrate --trace > ** Invoke db:migrate (first_time) > ** Invoke environment (first_time) > ** Execute environment > ** Invoke db:load_config (first_time) > ** Execute db:load_config > ** Execute db:migrate > == 20151104100257 AddHostsCountToHostgroup: migrating > ========================= > -- add_column(:hostgroups, :hosts_count, :integer, {:default=>0}) > rake aborted! > StandardError: An error has occurred, all later migrations canceled: > Mysql2::Error: Duplicate column name 'hosts_count': ALTER TABLE > `hostgroups` ADD `hosts_count` int(11) DEFAULT [..]


Dominic Cleal
dominic@cleal.org

Ahh… I see :frowning:

I elected for reinstall - and received this error upon running
foreman-installer:

Execution of '/usr/bin/yum -d 0 -e 0 -y list
ruby193-rubygem-passenger-native' returned 1: Error: No matching Packages
to list

when I do a manual search for that package, I find:

yum search ruby193-rubygem-passenger
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

··· ===================================================================== ruby193-rubygem-passenger40-debuginfo.x86_64 : Debug information for package ruby193-rubygem-passenger40 ruby193-rubygem-passenger40.x86_64 : Passenger Ruby web application server ruby193-rubygem-passenger40-devel.x86_64 : Apache Module for Phusion Passenger ruby193-rubygem-passenger40-doc.noarch : Apache Module for Phusion Passenger ruby193-rubygem-passenger40-native.x86_64 : Phusion Passenger native extensions ruby193-rubygem-passenger40-native-libs.x86_64 : Phusion Passenger native extensions

I verified all my repos are up to date against the install documentation…
Either I am missing a repo that contains this package or they updated the
packages and foreman is looking for the old one?

On Wednesday, October 19, 2016 at 10:26:43 AM UTC-4, Dominic Cleal wrote:

On 19/10/16 10:20, Austin Smith wrote:

You got me! I totally missed that!! :frowning:

And perhaps I spoke too soon - Got another error… :frowning: :frowning:

I ran the command you pasted, everything ran successfully. I attempted
to step to foreman-rake db:seed and received notice I had 63 pending
transactions.

So I ran the following:

[root@v-atl-centos-7-puppet-01 ~]# foreman-rake db:migrate --trace 
** Invoke db:migrate (first_time) 
** Invoke environment (first_time) 
** Execute environment 
** Invoke db:load_config (first_time) 
** Execute db:load_config 
** Execute db:migrate 
== 20151104100257 AddHostsCountToHostgroup: migrating 
========================= 
-- add_column(:hostgroups, :hosts_count, :integer, {:default=>0}) 
rake aborted! 
StandardError: An error has occurred, all later migrations canceled: 
Mysql2::Error: Duplicate column name 'hosts_count': ALTER TABLE 
`hostgroups` ADD `hosts_count` int(11) DEFAULT [..] 

This suggests that the migration’s been run already but the fact it ran
hasn’t been recorded (in schema_migrations). I’d consider restoring the
DB and running the migration again in case it’s been left in a
half-migrated state from earlier errors.


Dominic Cleal
dom...@cleal.org <javascript:>

We've not used this package name in quite a few versions. How exactly
are you reinstalling, and are you using an answers file from an old version?

If so then you might have a few changes to make the answers file work.
For this error, add
–foreman-passenger-ruby-package=tfm-rubygem-passenger-native to update
the package name. If you didn't intend to use an old answers file,
delete it from /etc/foreman-installer before reinstalling the
foreman-installer package.

··· On 21/10/16 04:24, Austin Smith wrote: > Ahh.. I see :( > > I elected for reinstall - and received this error upon running > foreman-installer: > > > > Executionof '/usr/bin/yum -d 0 -e 0 -y list > ruby193-rubygem-passenger-native'returned 1:Error:Nomatching Packagesto list > >


Dominic Cleal
dominic@cleal.org

Thank you for the guidance - I will probably deploy a new instance then to
"keep it clean"

Curious as well - Is it a better practice to put katello on a separate
instance or install on same as foreman? Very low node count - 100 MAX in
the next year.

··· On Friday, October 21, 2016 at 3:05:12 AM UTC-4, Dominic Cleal wrote: > > On 21/10/16 04:24, Austin Smith wrote: > > Ahh.. I see :( > > > > I elected for reinstall - and received this error upon running > > foreman-installer: > > > > > > > Executionof '/usr/bin/yum -d 0 -e 0 -y list > > ruby193-rubygem-passenger-native'returned 1:Error:Nomatching Packagesto > list > > > > > We've not used this package name in quite a few versions. How exactly > are you reinstalling, and are you using an answers file from an old > version? > > If so then you might have a few changes to make the answers file work. > For this error, add > --foreman-passenger-ruby-package=tfm-rubygem-passenger-native to update > the package name. If you didn't intend to use an old answers file, > delete it from /etc/foreman-installer before reinstalling the > foreman-installer package. > > -- > Dominic Cleal > dom...@cleal.org >

Katello is a Foreman plugin, it can't be deployed as a standalone
application. Thus, you'll want it all on one box :slight_smile:

Greg

··· On 21 October 2016 at 14:59, Austin Smith wrote:

Thank you for the guidance - I will probably deploy a new instance then to
"keep it clean"

Curious as well - Is it a better practice to put katello on a separate
instance or install on same as foreman? Very low node count - 100 MAX in
the next year.

Thanks for the clarification :slight_smile:

··· On Oct 21, 2016 8:03 PM, "Greg Sutcliffe" wrote:

On 21 October 2016 at 14:59, Austin Smith smith.austin@gmail.com wrote:

Thank you for the guidance - I will probably deploy a new instance then
to “keep it clean”

Curious as well - Is it a better practice to put katello on a separate
instance or install on same as foreman? Very low node count - 100 MAX in
the next year.

Katello is a Foreman plugin, it can’t be deployed as a standalone
application. Thus, you’ll want it all on one box :slight_smile:

Greg


You received this message because you are subscribed to a topic in the
Google Groups “Foreman users” group.
To unsubscribe from this topic, visit https://groups.google.com/d/
topic/foreman-users/wX_3S7J_LXk/unsubscribe.
To unsubscribe from this group and all its topics, send an email to
foreman-users+unsubscribe@googlegroups.com.
To post to this group, send email to foreman-users@googlegroups.com.
Visit this group at https://groups.google.com/group/foreman-users.
For more options, visit https://groups.google.com/d/optout.