Bug #16070
closedforeman-rake db:migrate fails with Mysql2::Error: Error on rename of './foreman/#sql-38c_9b' to './foreman/containers' (errno: 150): ALTER TABLE `containers` DROP `docker_image_id`
Description
Foreman 1.12.1 running on Ubuntu 14.04. This happens with an empty database.
== 20141209182008 RemoveDockerTables: migrating =============================== -- change_table(:containers) -> 0.0079s -- supports_foreign_keys?() -> 0.0000s -- foreign_keys(:containers) -> 0.0006s -- supports_foreign_keys?() -> 0.0000s -- foreign_keys(:containers) -> 0.0005s -- remove_column(:containers, :docker_image_id) rake aborted! StandardError: An error has occurred, all later migrations canceled: Mysql2::Error: Error on rename of './foreman/#sql-38c_a0' to './foreman/containers' (errno: 150): ALTER TABLE `containers` DROP `docker_image_id` /usr/share/foreman/vendor/ruby/2.0.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:107:in `_query' /usr/share/foreman/vendor/ruby/2.0.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:107:in `block in query' /usr/share/foreman/vendor/ruby/2.0.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:106:in `handle_interrupt' /usr/share/foreman/vendor/ruby/2.0.0/gems/mysql2-0.4.4/lib/mysql2/client.rb:106:in `query' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `block in execute' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:472:in `block in log' /usr/share/foreman/vendor/ruby/2.0.0/gems/activesupport-4.2.6/lib/active_support/notifications/instrumenter.rb:20:in `instrument' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract_adapter.rb:466:in `log' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:305:in `execute' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/mysql2_adapter.rb:231:in `execute' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/schema_statements.rb:429:in `remove_column' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:665:in `block in method_missing' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:634:in `block in say_with_time' /usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:634:in `say_with_time' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:654:in `method_missing' /usr/share/foreman/vendor/ruby/2.0.0/gems/foreman_docker-2.1.1/db/migrate/20141209182008_remove_docker_tables.rb:31:in `up' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:611:in `exec_migration' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:592:in `block (2 levels) in migrate' /usr/lib/ruby/2.0.0/benchmark.rb:281:in `measure' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:591:in `block in migrate' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/connection_adapters/abstract/connection_pool.rb:292:in `with_connection' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:590:in `migrate' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:768:in `migrate' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:998:in `block in execute_migration_in_transaction' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:1046:in `ddl_transaction' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:997:in `execute_migration_in_transaction' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:959:in `block in migrate' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:955:in `each' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:955:in `migrate' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:823:in `up' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/migration.rb:801:in `migrate' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/tasks/database_tasks.rb:137:in `migrate' /usr/share/foreman/vendor/ruby/2.0.0/gems/activerecord-4.2.6/lib/active_record/railties/databases.rake:44:in `block (2 levels) in <top (required)>' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:248:in `call' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:248:in `block in execute' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:243:in `each' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:243:in `execute' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:187:in `block in invoke_with_call_chain' /usr/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:180:in `invoke_with_call_chain' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/task.rb:173:in `invoke' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:152:in `invoke_task' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `block (2 levels) in top_level' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `each' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:108:in `block in top_level' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:117:in `run_with_threads' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:102:in `top_level' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:80:in `block in run' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:178:in `standard_exception_handling' /usr/share/foreman/vendor/ruby/2.0.0/gems/rake-11.2.2/lib/rake/application.rb:77:in `run' /usr/bin/rake2.0:37:in `<main>' Tasks: TOP => db:migrate
Updated by Dominic Cleal over 8 years ago
- Project changed from Foreman to Docker
- Category deleted (
Database)
I think this is addressed in foreman_docker 3.0.0, but packages for Ubuntu aren't available yet (https://github.com/theforeman/foreman-packaging/pull/1256). It's also only being published to nightly, but would appear to be necessary for 1.12.
(https://github.com/theforeman/foreman-docker/commit/588fbfb34042b545116605466168c9606798ea28)
Updated by Stijn Tintel over 8 years ago
Dominic Cleal wrote:
I think this is addressed in foreman_docker 3.0.0, but packages for Ubuntu aren't available yet (https://github.com/theforeman/foreman-packaging/pull/1256). It's also only being published to nightly, but would appear to be necessary for 1.12.
(https://github.com/theforeman/foreman-docker/commit/588fbfb34042b545116605466168c9606798ea28)
You're right, I updated that file and retried db:migrate. It works just fine now.
Thanks
Updated by Tomer Brisker about 5 years ago
- Status changed from New to Rejected
Foreman is dropping support for MySQL database - see https://community.theforeman.org/t/rfc-dropping-support-for-mysql/14185 for further details. Closing this issue.