Summary of gitlab ce 7 deployment problems

The git service is deployed on CentOS7 and gitlab-ce 7.10.0-omnibus.2

  • Super administrator password forgotten

 

[root@ycx bin]# gitlab-rails console production

     Enter the management console to find the user with id 1, which is the default super user/administrator information. You can also use User.find_by(email: '[email protected]') to search based on email information.

 

    

irb(main):001:0> user = User.where(id: 1).first

    The result is as follows:

=> #<User id: 1, email: "######@dingtalk.com", encrypted_password: "$2a$10$qqfJ8mbiS/e6G5NfFwji.e96jsGLqw2ox3xnkfusmuW...", reset_password_token: nil, reset_password_sent_at: nil, remember_created_at: nil, sign_in_count: 9, current_sign_in_at: "2018-03-07 02:31:43", last_sign_in_at: "2017-11-02 07:49:40", current_sign_in_ip: "127.0.0.1", last_sign_in_ip: "127.0.0.1", created_at: "2017-10-13 15:08:14", updated_at: "2018-03-07 02:36:00", name: "admin", admin: true, projects_limit: 10000, skype: "", linkedin: "", twitter: "", authentication_token: "ekRH377HhNt5gpaTruoq", theme_id: 3, bio: "", failed_attempts: 0, locked_at: nil, username: "root", can_create_group: true, can_create_team: false,state: "active", color_scheme_id: 4, notification_level: 1, password_expires_at: nil, created_by_id: nil, last_credential_check_at: nil, avatar: nil, confirmation_token: nil, confirmed_at: "2017-10-13 15:08:15", confirmation_sent_at: "2017-10-13 15:08:15", unconfirmed_email: nil, hide_no_ssh_key: false, website_url: "", github_access_token: nil, gitlab_access_token: nil, notification_email: "######@dingtalk.com", hide_no_password: false, password_automatically_set: false, bitbucket_access_token: nil, bitbucket_access_token_secret: nil, location: "", public_email: "">2017-10-13 15:08:15", confirmation_sent_at: "2017-10-13 15:08:15", unconfirmed_email: nil, hide_no_ssh_key: false, website_url: "", github_access_token: nil, gitlab_access_token: nil, notification_email: "######@dingtalk.com", hide_no_password: false, password_automatically_set: false, bitbucket_access_token: nil, bitbucket_access_token_secret: nil, location: "", public_email: "">2017-10-13 15:08:15", confirmation_sent_at: "2017-10-13 15:08:15", unconfirmed_email: nil, hide_no_ssh_key: false, website_url: "", github_access_token: nil, gitlab_access_token: nil, notification_email: "######@dingtalk.com", hide_no_password: false, password_automatically_set: false, bitbucket_access_token: nil, bitbucket_access_token_secret: nil, location: "", public_email: "">">">

   Reset and save new password

 

irb(main):001:0> user.password = 'new_pwd'
irb(main):001:0> user.save!

    Restart the gitlab service

    

[root@ycx bin]# gitlab-ctl restart

 

  • Unable to create new user

    Create a user page and return 500 directly when saving.

     The tail command found the following errors in the produced.log:

Started POST "/admin/users" for 127.0.0.1 at 2018-03-07 13:12:06 +0800
Processing by Admin::UsersController#create as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"name"=>"zhaolijun", "username"=>"zhaolijun", "email"=>"zhaolijun", "projects_limit"=>"10", "can_create_group"=>"1", "admin"=>"0", "skype"=>"", "linkedin"=>"", "twitter"=>"", "website_url"=>""}}
Completed 500 Internal Server Error in 198ms

NoMethodError (undefined method `skip_confirmation!' for #<User:0x0000000dca8778>):
  app/controllers/admin/users_controller.rb:51:in `create'

 

First contact with ruby, based on other code experience.

Revise

/opt/gitlab/embedded/service/gitlab-rails/app/controllers/admin/users_controller.rb

Notes

# @user.skip_confirmation!

Modify page validation

/opt/gitlab/embedded/service/gitlab-rails/app/views/admin/users/_form.html.haml

搜索    f.text_field :email, required: true

Modified to f.text_field :email, required: false

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326053253&siteId=291194637