搭建git 服务器出现 Error executing action `create` on resource 'user[GitLab user and group]'

在尝试使用Chef更新GitLab用户和组配置时遇到错误,具体为用户mod命令失败,原因是用户git正被进程15309使用。此问题发生在Ubuntu 18.04上,使用Chef版本13.6.4。

错误:
    
    ================================================================================
    Error executing action `create` on resource 'account[GitLab user and group]'
    ================================================================================
    
    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    linux_user[GitLab user and group] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/account.rb line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '8'
    ---- Begin output of ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] ----
    STDOUT:
    STDERR: usermod: user git is currently used by process 15309
    ---- End output of ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] ----
    Ran ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] returned 8
    
    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/users.rb
    
     28: account "GitLab user and group" do
     29:   username gitlab_username
     30:   uid node['gitlab']['user']['uid']
     31:   ugid gitlab_group
     32:   groupname gitlab_group
     33:   gid node['gitlab']['user']['gid']
     34:   shell node['gitlab']['user']['shell']
     35:   home gitlab_home
     36:   manage node['gitlab']['manage-accounts']['enable']
     37: end
     38:
    
    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/users.rb:28:in `from_file'
    
    account("GitLab user and group") do
      action [:create]
      default_guard_interpreter :default
      declared_type :account
      cookbook_name "gitlab"
      recipe_name "users"
      username "git"
      uid nil
      ugid "git"
      groupname "git"
      gid nil
      shell "/bin/sh"
      home "/var/opt/gitlab"
      manage true
    end
    
    System Info:
    ------------
    chef_version=13.6.4
    platform=ubuntu
    platform_version=18.04
    ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client
    

Running handlers:
There was an error running gitlab-ctl reconfigure:

account[GitLab user and group] (gitlab::users line 28) had an error: Mixlib::ShellOut::ShellCommandFailed: linux_user[GitLab user and group] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/account.rb line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '8'
---- Begin output of ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] ----
STDOUT:
STDERR: usermod: user git is currently used by process 15309
---- End output of ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] ----
Ran ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] returned 8

 

解决方案

评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值