Skip to content

gitlab-ce reset root password

After upgrade I'm not able to login with any user exists before (db is still present).

I've tried to reset root-user login as shown here: https://docs.gitlab.com/ce/security/reset_root_password.html

$> sudo -u git -H bundle exec rails console production

Loading production environment (Rails 4.2.7.1)
irb(main):001:0> user = User.where(id: 1).first
=> nil
irb(main):002:0> user.password = 'secret_pass'
NoMethodError: undefined method `password=' for nil:NilClass
	from (irb):2
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/console.rb:110:in `start'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/console.rb:9:in `start'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:68:in `console'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
	from /home/git/gitlab/vendor/bundle/ruby/2.3.0/gems/railties-4.2.7.1/lib/rails/commands.rb:17:in `<top (required)>'
	from bin/rails:9:in `require'
	from bin/rails:9:in `<main>'

Result: It is throwing this error: NoMethodError: undefined method `password=' for nil:NilClass

Expected: Reset password as in documentation.

Why is this not working?

Edited by GKN