Skip to content

Instantly share code, notes, and snippets.

@tateisu
Created January 20, 2019 18:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tateisu/e8ae30f84e21d4423c1439d5677c5da7 to your computer and use it in GitHub Desktop.
Save tateisu/e8ae30f84e21d4423c1439d5677c5da7 to your computer and use it in GitHub Desktop.
weird migration error
+ docker-compose up -d
mastodon1_db_backend_1 is up-to-date
mastodon1_redis_1 is up-to-date
mastodon1_db_1 is up-to-date
Creating mastodon1_sidekiq_push_1
Creating mastodon1_web_1
Creating mastodon1_sidekiq_pull_1
Creating mastodon1_sidekiq_default_1
Creating mastodon1_streaming_1
+ date
Mon Jan 21 03:01:03 JST 2019
+ echo '# waiting service start...'
# waiting service start...
+ sleep 30
+ date
Mon Jan 21 03:01:33 JST 2019
+ echo '# DB migration (post deployment)...'
# DB migration (post deployment)...
+ docker-compose run --rm web rails db:migrate
Migrating to CopyAccountStatsCleanup (20181116184611)
== 20181116184611 CopyAccountStatsCleanup: migrating ==========================
-- remove_column(:accounts, :statuses_count, :integer, {:default=>0, :null=>false})
-> 0.1187s
-- remove_column(:accounts, :following_count, :integer, {:default=>0, :null=>false})
-> 0.0660s
-- remove_column(:accounts, :followers_count, :integer, {:default=>0, :null=>false})
-> 0.1045s
== 20181116184611 CopyAccountStatsCleanup: migrated (0.2908s) =================
WARNING: you don't own a lock of type ExclusiveLock
rails aborted!
ActiveRecord::ConcurrentMigrationError:
Failed to release advisory lock
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1366:in `with_advisory_lock'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/railtie.rb:37:in `block in migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/strategy.rb:70:in `wrap'
/mastodon/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy.rb:201:in `strategy'
/mastodon/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/railtie.rb:37:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1036:in `up'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1011:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/strong_migrations-0.3.1/lib/strong_migrations/database_tasks.rb:4:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command.rb:48:in `invoke'
/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<top (required)>'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
/mastodon/bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
01/21_03:01 tateisu@mast1 /mnt/hdd/mastodon/mastodon1 $ docker-compose run --rm web rails db:migrate
rails aborted!
ActiveRecord::ConcurrentMigrationError:
Cannot run migrations because another migration process is currently running.
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1361:in `with_advisory_lock'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1210:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/railtie.rb:37:in `block in migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/strategy.rb:70:in `wrap'
/mastodon/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy.rb:201:in `strategy'
/mastodon/vendor/bundle/ruby/2.6.0/gems/chewy-5.0.0/lib/chewy/railtie.rb:37:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1036:in `up'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/migration.rb:1011:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/tasks/database_tasks.rb:172:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/strong_migrations-0.3.1/lib/strong_migrations/database_tasks.rb:4:in `migrate'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activerecord-5.2.2/lib/active_record/railties/databases.rake:60:in `block (2 levels) in <top (required)>'
/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/command.rb:48:in `invoke'
/mastodon/vendor/bundle/ruby/2.6.0/gems/railties-5.2.2/lib/rails/commands.rb:18:in `<top (required)>'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
/mastodon/vendor/bundle/ruby/2.6.0/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `block in require'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:257:in `load_dependency'
/mastodon/vendor/bundle/ruby/2.6.0/gems/activesupport-5.2.2/lib/active_support/dependencies.rb:291:in `require'
/mastodon/bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
01/21_03:02 tateisu@mast1 /mnt/hdd/mastodon/mastodon1 $ docker-compose down
Stopping mastodon1_sidekiq_default_1 ... done
Stopping mastodon1_sidekiq_push_1 ... done
Stopping mastodon1_streaming_1 ... done
Stopping mastodon1_web_1 ... done
Stopping mastodon1_sidekiq_pull_1 ... done
Stopping mastodon1_db_1 ... done
Stopping mastodon1_db_backend_1 ... done
Stopping mastodon1_redis_1 ... done
Removing mastodon1_sidekiq_default_1 ... done
Removing mastodon1_sidekiq_push_1 ... done
Removing mastodon1_streaming_1 ... done
Removing mastodon1_web_1 ... done
Removing mastodon1_sidekiq_pull_1 ... done
Removing mastodon1_db_1 ... done
Removing mastodon1_db_backend_1 ... done
Removing mastodon1_redis_1 ... done
Removing network mastodon1_internal_network
Removing network mastodon1_external_network
01/21_03:06 tateisu@mast1 /mnt/hdd/mastodon/mastodon1 $ docker-compose run --rm web rails db:migrate
Creating network "mastodon1_internal_network" with the default driver
Creating network "mastodon1_external_network" with the default driver
Creating mastodon1_redis_1
Creating mastodon1_db_backend_1
Creating mastodon1_db_1
01/21_03:06 tateisu@mast1 /mnt/hdd/mastodon/mastodon1 $ docker-compose run --rm web rails db:migrate
01/21_03:07 tateisu@mast1 /mnt/hdd/mastodon/mastodon1 $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment