Project

General

Profile

Actions

Bug #12986

closed

Facet migration fails with can't cast ActiveSupport::HashWithIndifferentAccess to string

Added by Stephen Benjamin almost 9 years ago. Updated over 6 years ago.

Status:
Duplicate
Priority:
High
Category:
Hosts
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

2016-01-04T16:05:57 [app] [I] Processing content host b7ff8c7a-709e-451a-8a8a-e9efc64e89ec katello-centos7-devel.example.com
2016-01-04T16:05:57 [app] [I] Found host with hostname katello-centos7-devel.example.com.
2016-01-04T16:05:57 [app] [I] Creating content facet for host katello-centos7-devel.example.com.
2016-01-04T16:05:57 [app] [I] Creating subscription facet for host katello-centos7-devel.example.com.
rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

can't cast ActiveSupport::HashWithIndifferentAccess to string/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/quoting.rb:76:in `type_cast'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/quoting.rb:127:in `type_cast'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:828:in `block in exec_cache'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:827:in `map'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:827:in `exec_cache'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `exec_delete'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:101:in `update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/relation.rb:77:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/persistence.rb:493:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/locking/optimistic.rb:70:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:83:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:310:in `block in _update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `run_callbacks'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:310:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/timestamp.rb:70:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/persistence.rb:482:in `create_or_update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:302:in `block in create_or_update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `run_callbacks'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:302:in `create_or_update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/persistence.rb:125:in `save!'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `block in save!'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:199:in `transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:208:in `transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `save!'
/home/vagrant/katello/db/migrate/20150930183738_migrate_content_hosts.rb:68:in `create_subscription_facet'
/home/vagrant/katello/db/migrate/20150930183738_migrate_content_hosts.rb:205:in `block in up'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in `each'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in `each'
/home/vagrant/katello/db/migrate/20150930183738_migrate_content_hosts.rb:171:in `up'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:598:in `exec_migration'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:578:in `block in migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:577:in `migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:752:in `migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:1038:in `block in ddl_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:208:in `transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:1038:in `ddl_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:953:in `block in migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:949:in `each'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:949:in `migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:807:in `up'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:785:in `migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/vagrant/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/home/vagrant/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
TypeError: can't cast ActiveSupport::HashWithIndifferentAccess to string
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/quoting.rb:76:in `type_cast'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/quoting.rb:127:in `type_cast'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:828:in `block in exec_cache'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:827:in `map'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql_adapter.rb:827:in `exec_cache'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/postgresql/database_statements.rb:155:in `exec_delete'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:101:in `update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/query_cache.rb:14:in `update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/relation.rb:77:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/persistence.rb:493:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/locking/optimistic.rb:70:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:83:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:310:in `block in _update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:215:in `block in halting_and_conditional'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `run_callbacks'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:310:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/timestamp.rb:70:in `_update_record'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/persistence.rb:482:in `create_or_update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:302:in `block in create_or_update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:113:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:166:in `block in halting'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `call'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activesupport-4.1.5/lib/active_support/callbacks.rb:86:in `run_callbacks'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/callbacks.rb:302:in `create_or_update'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/persistence.rb:125:in `save!'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/validations.rb:57:in `save!'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/attribute_methods/dirty.rb:29:in `save!'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `block in save!'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:329:in `block in with_transaction_returning_status'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:199:in `transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:208:in `transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:326:in `with_transaction_returning_status'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:273:in `save!'
/home/vagrant/katello/db/migrate/20150930183738_migrate_content_hosts.rb:68:in `create_subscription_facet'
/home/vagrant/katello/db/migrate/20150930183738_migrate_content_hosts.rb:205:in `block in up'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in `each'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/relation/delegation.rb:46:in `each'
/home/vagrant/katello/db/migrate/20150930183738_migrate_content_hosts.rb:171:in `up'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:598:in `exec_migration'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:578:in `block in migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:577:in `migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:752:in `migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:1038:in `block in ddl_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `block in transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:209:in `within_new_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/connection_adapters/abstract/database_statements.rb:201:in `transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/transactions.rb:208:in `transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:1038:in `ddl_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:953:in `block in migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:949:in `each'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:949:in `migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:807:in `up'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/migration.rb:785:in `migrate'
/home/vagrant/.rvm/gems/ruby-2.1.5/gems/activerecord-4.1.5/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/vagrant/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `eval'
/home/vagrant/.rvm/gems/ruby-2.1.5/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)

Related issues 2 (1 open1 closed)

Is duplicate of Katello - Bug #13679: content facet migration failsClosedWalden Raines02/11/2016Actions
Blocks Katello - Feature #11435: Host Unification TrackerNewActions
Actions

Also available in: Atom PDF