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
  • #2807

Closed
Open
Created Jan 28, 2013 by Administrator@rootOwner

Failed gitlab:enable_namespaces migration to 4.0

Created by: jasperla

It seems the upgrading instructions from 3.1 to 4.0 missing something, or I'm doing something wrong in the update.

Basically it comes down to this: The steps to migrate my database all succeed without errors, except for this step:

root@gitlab:/home/gitlab/gitlab# sudo -u gitlab -H bundle exec rake gitlab:enable_namespaces RAILS_ENV=production

Generate usernames for users without one: rake aborted! undefined method username' for #<User:0x00000004825a60> /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/activemodel-3.2.11/lib/active_model/attribute_methods.rb:407:inmethod_missing' /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/attribute_methods.rb:149:in method_missing' /home/gitlab/gitlab/lib/tasks/gitlab/enable_namespaces.rake:24:inblock in migrate_user_namespaces' /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/relation/batches.rb:21:in block (2 levels) in find_each' /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/relation/batches.rb:21:ineach' /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/relation/batches.rb:21:in block in find_each' /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/relation/batches.rb:72:infind_in_batches' /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/relation/batches.rb:20:in find_each' /home/gitlab/gitlab/vendor/bundle/ruby/1.9.1/gems/activerecord-3.2.11/lib/active_record/querying.rb:8:infind_each' /home/gitlab/gitlab/lib/tasks/gitlab/enable_namespaces.rake:18:in migrate_user_namespaces' /home/gitlab/gitlab/lib/tasks/gitlab/enable_namespaces.rake:6:inblock (2 levels) in <top (required)>' Tasks: TOP => gitlab:enable_namespaces (See full trace by running task with --trace)

This in turn results in the following message in production.log:

Completed 500 Internal Server Error in 5ms

ActiveRecord::StatementInvalid (Mysql2::Error: Unknown column 'namespace_id' in 'field list': SELECT namespace_id FROM projects INNER JOIN users_projects ON projects.id = users_projects.project_id WHERE users_projects.user_id = 2): config/initializers/connection_fix.rb:22:in execute' app/roles/account.rb:111:inauthorized_groups' app/controllers/dashboard_controller.rb:8:in `index'

Am I missing something obvious?

Assignee
Assign to
Time tracking