Database migration failed with ActiveModel::UnknownAttributeError: unknown attribute 'total_tuple_count' for Gitlab::Database::BackgroundMigration::BatchedMigration.
Overview
After a gdk update
the output of gdk doctor
was
Database Migrations
--------------------------------------------------------------------------------
There are pending database migrations.
To update your database, run `bundle exec rails db:migrate` in your `gitlab` directory.
However when I change to the gitlab
directory and run
yarn install && bundle install
followed by bundle exec rails db:migrate RAILS_ENV=development
the result is:
== 20210311120155 BackfillEventsIdForBigintConversion: migrating ==============
-- table_exists?(:events)
-> 0.0013s
-- column_exists?(:events, :id)
-> 0.0015s
-- column_exists?(:events, :id)
-> 0.0010s
-- column_exists?(:events, "id_convert_to_bigint")
-> 0.0008s
unknown OID 28: failed to recognize type of 'relfrozenxid'. It will be treated as String.
unknown OID 1034: failed to recognize type of 'relacl'. It will be treated as String.
unknown OID 194: failed to recognize type of 'relpartbound'. It will be treated as String.
rails aborted!
StandardError: An error has occurred, this and all later migrations canceled:
unknown attribute 'total_tuple_count' for Gitlab::Database::BackgroundMigration::BatchedMigration.
/Users/erickbanks/Development/gitlab-development-kit/gitlab/lib/gitlab/database/migrations/background_migration_helpers.rb:197:in `queue_batched_background_migration'
/Users/erickbanks/Development/gitlab-development-kit/gitlab/lib/gitlab/database/migration_helpers.rb:1039:in `backfill_conversion_of_integer_to_bigint'
/Users/erickbanks/Development/gitlab-development-kit/gitlab/db/post_migrate/20210311120155_backfill_events_id_for_bigint_conversion.rb:11:in `up'
/Users/erickbanks/Development/gitlab-development-kit/gitlab/lib/gitlab/database.rb:342:in `block in transaction'
/Users/erickbanks/Development/gitlab-development-kit/gitlab/lib/gitlab/database.rb:341:in `transaction'
bin/rails:4:in `<main>'
Caused by:
ActiveModel::UnknownAttributeError: unknown attribute 'total_tuple_count' for Gitlab::Database::BackgroundMigration::BatchedMigration.
/Users/erickbanks/Development/gitlab-development-kit/gitlab/lib/gitlab/database/migrations/background_migration_helpers.rb:197:in `queue_batched_background_migration'
/Users/erickbanks/Development/gitlab-development-kit/gitlab/lib/gitlab/database/migration_helpers.rb:1039:in `backfill_conversion_of_integer_to_bigint'
/Users/erickbanks/Development/gitlab-development-kit/gitlab/db/post_migrate/20210311120155_backfill_events_id_for_bigint_conversion.rb:11:in `up'
/Users/erickbanks/Development/gitlab-development-kit/gitlab/lib/gitlab/database.rb:342:in `block in transaction'
/Users/erickbanks/Development/gitlab-development-kit/gitlab/lib/gitlab/database.rb:341:in `transaction'
bin/rails:4:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
Steps to replicate (optional)
Proposal (optional)
Environment (optional)
- Operating system: macOS
- The contents of your
gdk.yml
hostname: gdk.test
gitlab.cache_classes: true
runner:
extra_hosts: ["gdk.test:172.16.123.1"]%
- Ruby version:
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
- GDK version:
GitLab Development Kit gem version 0.2.10