Project

General

Profile

Actions

Bug #24993

closed

migration broken on nightly mysql

Added by Ohad Levy over 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
DB migrations
Target version:
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

Mysql2::Error: Duplicate column name 'type': ALTER TABLE `tokens` ADD `type` varchar(255) DEFAULT 'Token::Build' NOT NULL
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `_query'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `block in query'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `handle_interrupt'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `query'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:579:in `block (2 levels) in log'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:578:in `block in log'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:569:in `log'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:581:in `add_column'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:871:in `block in method_missing'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:840:in `block in say_with_time'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:840:in `say_with_time'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:860:in `method_missing'
/home/foreman/git/foreman/db/migrate/20180613100703_add_type_to_token.rb:7:in `up'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:817:in `exec_migration'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:797:in `block in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:414:in `with_connection'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:796:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:977:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1345:in `ddl_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `each'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `block in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1036:in `up'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1011:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/home/foreman/gems/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:74:in `load'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:28:in `run'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:424:in `exec'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:27:in `dispatch'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:18:in `start'
/home/foreman/gems/gems/bundler-1.16.5/exe/bundle:30:in `block in <top (required)>'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/home/foreman/gems/gems/bundler-1.16.5/exe/bundle:22:in `<top (required)>'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `load'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: Mysql2::Error: Duplicate column name 'type': ALTER TABLE `tokens` ADD `type` varchar(255) DEFAULT 'Token::Build' NOT NULL
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `_query'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `block in query'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `handle_interrupt'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `query'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:579:in `block (2 levels) in log'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:578:in `block in log'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:569:in `log'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:581:in `add_column'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:871:in `block in method_missing'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:840:in `block in say_with_time'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:840:in `say_with_time'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:860:in `method_missing'
/home/foreman/git/foreman/db/migrate/20180613100703_add_type_to_token.rb:7:in `up'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:817:in `exec_migration'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:797:in `block in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:414:in `with_connection'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:796:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:977:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1345:in `ddl_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `each'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `block in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1036:in `up'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1011:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/home/foreman/gems/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:74:in `load'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:28:in `run'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:424:in `exec'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:27:in `dispatch'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:18:in `start'
/home/foreman/gems/gems/bundler-1.16.5/exe/bundle:30:in `block in <top (required)>'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/home/foreman/gems/gems/bundler-1.16.5/exe/bundle:22:in `<top (required)>'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `load'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `<main>'

Caused by:
Mysql2::Error: Duplicate column name 'type'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `_query'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:131:in `block in query'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `handle_interrupt'
/home/foreman/gems/gems/mysql2-0.5.2/lib/mysql2/client.rb:130:in `query'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:187:in `block (2 levels) in execute'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:48:in `block in permit_concurrent_loads'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/concurrency/share_lock.rb:187:in `yield_shares'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/dependencies/interlock.rb:47:in `permit_concurrent_loads'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:186:in `block in execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:579:in `block (2 levels) in log'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:578:in `block in log'
/home/foreman/gems/gems/activesupport-5.2.1/lib/active_support/notifications/instrumenter.rb:23:in `instrument'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_adapter.rb:569:in `log'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:185:in `execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/mysql/database_statements.rb:28:in `execute'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/schema_statements.rb:581:in `add_column'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:871:in `block in method_missing'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:840:in `block in say_with_time'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:840:in `say_with_time'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:860:in `method_missing'
/home/foreman/git/foreman/db/migrate/20180613100703_add_type_to_token.rb:7:in `up'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:817:in `exec_migration'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:798:in `block (2 levels) in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:797:in `block in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:414:in `with_connection'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:796:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:977:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1292:in `block in execute_migration_in_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1345:in `ddl_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1291:in `execute_migration_in_transaction'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1263:in `block in migrate_without_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `each'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1262:in `migrate_without_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `block in migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1363:in `with_advisory_lock'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1210:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1036:in `up'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/migration.rb:1011:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/home/foreman/gems/gems/activerecord-5.2.1/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/home/foreman/gems/gems/rake-12.3.1/exe/rake:27:in `<top (required)>'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:74:in `load'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:28:in `run'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:424:in `exec'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:27:in `dispatch'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/cli.rb:18:in `start'
/home/foreman/gems/gems/bundler-1.16.5/exe/bundle:30:in `block in <top (required)>'
/home/foreman/gems/gems/bundler-1.16.5/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/home/foreman/gems/gems/bundler-1.16.5/exe/bundle:22:in `<top (required)>'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `load'
/opt/rh/rh-ruby24/root/usr/bin/bundle:22:in `<main>'


Related issues 1 (0 open1 closed)

Related to Foreman - Feature #23210: PuppetCA: Token Based AutosigningClosedJulian TodtActions
Actions

Also available in: Atom PDF