Skip to content

GitLab

  • Menu
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #7571

Closed
Open
Created Aug 22, 2014 by Administrator@rootOwner

Cannot migrate database when upgrading from7.0 to 7.2

Created by: keith9820

When I run the migrate task I get this error:

# sudo -u git -H bundle exec rake --trace db:migrate RAILS_ENV=production
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Execute db:load_config
** Execute db:migrate
== 20140729152420 MigrateTaggableLabels: migrating ============================
rake aborted!
StandardError: An error has occurred, all later migrations canceled:

undefined method `project' for nil:NilClass/home/git/gitlab/db/migrate/20140729152420_migrate_taggable_labels.rb:21:in `create_label_from_tagging'
/home/git/gitlab/db/migrate/20140729152420_migrate_taggable_labels.rb:5:in `block in up'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/relation/batches.rb:52:in `block (2 levels) in find_each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/relation/batches.rb:52:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/relation/batches.rb:52:in `block in find_each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/relation/batches.rb:125:in `find_in_batches'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/relation/batches.rb:51:in `find_each'
/home/git/gitlab/db/migrate/20140729152420_migrate_taggable_labels.rb:4:in `up'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:598:in `exec_migration'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:579:in `block (2 levels) in migrate'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/benchmark.rb:281:in `measure'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:578:in `block in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/connection_adapters/abstract/connection_pool.rb:294:in `with_connection'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:577:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:752:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:992:in `block in execute_migration_in_transaction'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:1040:in `ddl_transaction'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:991:in `execute_migration_in_transaction'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:953:in `block in migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:949:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:949:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:807:in `up'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/migration.rb:785:in `migrate'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/activerecord-4.1.1/lib/active_record/railties/databases.rake:34:in `block (2 levels) in <top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `call'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:240:in `block in execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:235:in `execute'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/monitor.rb:211:in `mon_synchronize'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/task.rb:165:in `invoke'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:150:in `invoke_task'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `each'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:106:in `block in top_level'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:115:in `run_with_threads'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:100:in `top_level'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:78:in `block in run'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/lib/rake/application.rb:75:in `run'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/gems/rake-10.3.2/bin/rake:33:in `<top (required)>'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/rake:23:in `load'
/home/git/gitlab/vendor/bundle/ruby/2.0.0/bin/rake:23:in `<main>'
Tasks: TOP => db:migrate

Everything looks good when I run the check task

Assignee
Assign to
Time tracking