{"action":"created","issue":{"url":"https://api.github.com/repos/cloudfoundry/cloud_controller_ng/issues/1135","repository_url":"https://api.github.com/repos/cloudfoundry/cloud_controller_ng","labels_url":"https://api.github.com/repos/cloudfoundry/cloud_controller_ng/issues/1135/labels{/name}","comments_url":"https://api.github.com/repos/cloudfoundry/cloud_controller_ng/issues/1135/comments","events_url":"https://api.github.com/repos/cloudfoundry/cloud_controller_ng/issues/1135/events","html_url":"https://github.com/cloudfoundry/cloud_controller_ng/issues/1135","id":320138531,"number":1135,"title":"pre-start script is failing on dbmigrate","user":{"login":"lerytke","id":14815279,"avatar_url":"https://avatars2.githubusercontent.com/u/14815279?v=4","gravatar_id":"","url":"https://api.github.com/users/lerytke","html_url":"https://github.com/lerytke","followers_url":"https://api.github.com/users/lerytke/followers","following_url":"https://api.github.com/users/lerytke/following{/other_user}","gists_url":"https://api.github.com/users/lerytke/gists{/gist_id}","starred_url":"https://api.github.com/users/lerytke/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lerytke/subscriptions","organizations_url":"https://api.github.com/users/lerytke/orgs","repos_url":"https://api.github.com/users/lerytke/repos","events_url":"https://api.github.com/users/lerytke/events{/privacy}","received_events_url":"https://api.github.com/users/lerytke/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-05-04T02:38:55Z","updated_at":"2018-05-04T02:38:57Z","closed_at":null,"author_association":"NONE","body":"Thanks for submitting an issue to `cloud_controller_ng`. We are always trying to improve! To help us, please fill out the following template.\r\n\r\n## Issue\r\n\r\nWe are upgrading from capi  1.21.34 to capi 1.44.29  and when the pre-start script runs we get and error out a table already exisiting \r\n\r\n## Context\r\n\r\n[2018-05-04 01:21:35+0000] Tasks: TOP => db:migrate\r\n[2018-05-04 01:21:35+0000] (See full trace by running task with --trace)\r\n[2018-05-04 01:21:35+0000] + result=1\r\n[2018-05-04 01:21:35+0000] + [[ 1 -eq 0 ]]\r\n[2018-05-04 01:21:35+0000] + sleep 5\r\n[2018-05-04 01:21:40+0000] + (( counter++ ))\r\n[2018-05-04 01:21:40+0000] + [[ 3 -le 3 ]]\r\n[2018-05-04 01:21:40+0000] + echo 'Running migration try number 3 of 3'\r\n[2018-05-04 01:21:40+0000] + bundle exec rake db:migrate\r\n[2018-05-04 01:21:43+0000] rake aborted!\r\n[2018-05-04 01:21:43+0000] Sequel::DatabaseError: Mysql2::Error: Table 'staging_security_groups_spaces' already exists\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:120:in `_query'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:120:in `block in query'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:119:in `handle_interrupt'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:119:in `query'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/mysql2.rb:141:in `block in _execute'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/logging.rb:49:in `log_connection_yield'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/mysql2.rb:136:in `_execute'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/utils/mysql_mysql2.rb:37:in `block in execute'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/connecting.rb:301:in `block in synchronize'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/connection_pool/threaded.rb:107:in `hold'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/connecting.rb:301:in `synchronize'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/utils/mysql_mysql2.rb:37:in `execute'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/mysql2.rb:71:in `execute_dui'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/query.rb:47:in `execute_ddl'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/schema_methods.rb:697:in `create_table_from_generator'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/schema_methods.rb:213:in `create_table'\r\n[2018-05-04 01:21:43+0000] /var/vcap/data/packages/cloud_controller_ng/ecc5b5c2e755c52b9e3c548d34e49edb6549a0ec/cloud_controller_ng/db/migrations/20161104184720_create_staging_security_groups_spaces.rb:3:in `block (2 levels) in <top (required)>'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:106:in `instance_eval'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:106:in `apply'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:705:in `block (2 levels) in run'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:479:in `checked_transaction'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:704:in `block in run'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:701:in `each'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:701:in `run'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:404:in `run'\r\n[2018-05-04 01:21:43+0000] /var/vcap/data/packages/cloud_controller_ng/ecc5b5c2e755c52b9e3c548d34e49edb6549a0ec/cloud_controller_ng/lib/cloud_controller/db_migrator.rb:18:in `apply_migrations'\r\n[2018-05-04 01:21:43+0000] /var/vcap/data/packages/cloud_controller_ng/ecc5b5c2e755c52b9e3c548d34e49edb6549a0ec/cloud_controller_ng/lib/tasks/db.rake:50:in `migrate'\r\n[2018-05-04 01:21:43+0000] /var/vcap/data/packages/cloud_controller_ng/ecc5b5c2e755c52b9e3c548d34e49edb6549a0ec/cloud_controller_ng/lib/tasks/db.rake:57:in `block (2 levels) in <top (required)>'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/ruby-2.4/bin/bundle:23:in `load'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/ruby-2.4/bin/bundle:23:in `<main>'\r\n[2018-05-04 01:21:43+0000] Mysql2::Error: Table 'staging_security_groups_spaces' already exists\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:120:in `_query'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:120:in `block in query'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:119:in `handle_interrupt'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/mysql2-0.4.8/lib/mysql2/client.rb:119:in `query'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/mysql2.rb:141:in `block in _execute'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/logging.rb:49:in `log_connection_yield'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/mysql2.rb:136:in `_execute'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/utils/mysql_mysql2.rb:37:in `block in execute'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/connecting.rb:301:in `block in synchronize'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/connection_pool/threaded.rb:107:in `hold'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/connecting.rb:301:in `synchronize'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/utils/mysql_mysql2.rb:37:in `execute'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/adapters/mysql2.rb:71:in `execute_dui'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/query.rb:47:in `execute_ddl'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/schema_methods.rb:697:in `create_table_from_generator'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/database/schema_methods.rb:213:in `create_table'\r\n[2018-05-04 01:21:43+0000] /var/vcap/data/packages/cloud_controller_ng/ecc5b5c2e755c52b9e3c548d34e49edb6549a0ec/cloud_controller_ng/db/migrations/20161104184720_create_staging_security_groups_spaces.rb:3:in `block (2 levels) in <top (required)>'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:106:in `instance_eval'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:106:in `apply'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:705:in `block (2 levels) in run'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:479:in `checked_transaction'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:704:in `block in run'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:701:in `each'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:701:in `run'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/sequel-4.49.0/lib/sequel/extensions/migration.rb:404:in `run'\r\n[2018-05-04 01:21:43+0000] /var/vcap/data/packages/cloud_controller_ng/ecc5b5c2e755c52b9e3c548d34e49edb6549a0ec/cloud_controller_ng/lib/cloud_controller/db_migrator.rb:18:in `apply_migrations'\r\n[2018-05-04 01:21:43+0000] /var/vcap/data/packages/cloud_controller_ng/ecc5b5c2e755c52b9e3c548d34e49edb6549a0ec/cloud_controller_ng/lib/tasks/db.rake:50:in `migrate'\r\n[2018-05-04 01:21:43+0000] /var/vcap/data/packages/cloud_controller_ng/ecc5b5c2e755c52b9e3c548d34e49edb6549a0ec/cloud_controller_ng/lib/tasks/db.rake:57:in `block (2 levels) in <top (required)>'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/cloud_controller_ng/cloud_controller_ng/vendor/bundle/ruby/2.4.0/gems/rake-12.1.0/exe/rake:27:in `<top (required)>'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/ruby-2.4/bin/bundle:23:in `load'\r\n[2018-05-04 01:21:43+0000] /var/vcap/packages/ruby-2.4/bin/bundle:23:in `<main>'\r\n\r\n\r\n## Steps to Reproduce\r\n\r\nwe are using Pivotal bits so we are doing and upgrade from 1.10.22 to 2.0.10, this databse was first deployed using 1.7?\r\n\r\n## Expected result\r\n\r\ndb migration to work successfully \r\n\r\n## Current result\r\n\r\nthe cloud_controller_ng pre-start script is failing\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/cloudfoundry/cloud_controller_ng/issues/comments/386492596","html_url":"https://github.com/cloudfoundry/cloud_controller_ng/issues/1135#issuecomment-386492596","issue_url":"https://api.github.com/repos/cloudfoundry/cloud_controller_ng/issues/1135","id":386492596,"user":{"login":"cf-gitbot","id":5589368,"avatar_url":"https://avatars3.githubusercontent.com/u/5589368?v=4","gravatar_id":"","url":"https://api.github.com/users/cf-gitbot","html_url":"https://github.com/cf-gitbot","followers_url":"https://api.github.com/users/cf-gitbot/followers","following_url":"https://api.github.com/users/cf-gitbot/following{/other_user}","gists_url":"https://api.github.com/users/cf-gitbot/gists{/gist_id}","starred_url":"https://api.github.com/users/cf-gitbot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cf-gitbot/subscriptions","organizations_url":"https://api.github.com/users/cf-gitbot/orgs","repos_url":"https://api.github.com/users/cf-gitbot/repos","events_url":"https://api.github.com/users/cf-gitbot/events{/privacy}","received_events_url":"https://api.github.com/users/cf-gitbot/received_events","type":"User","site_admin":false},"created_at":"2018-05-04T02:38:57Z","updated_at":"2018-05-04T02:38:57Z","author_association":"COLLABORATOR","body":"We have created an issue in Pivotal Tracker to manage this: \n\nhttps://www.pivotaltracker.com/story/show/157303367 \n\nThe labels on this github issue will be updated when the story is started."}}
{"actor":{"display_login":"cf-gitbot"}}