GitLab 重新配置错误:在资源“user[git]”上执行操作“create”

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/26794162/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 10:31:50  来源:igfitidea点击:

GitLab reconfigure Error: executing action `create` on resource 'user[git]'

gitgitlab

提问by Daizy

I tried to install Gitlab gitlab_7.4.3-omnibus.5.1.0.ci-1_amd64.debon my server.

我试图gitlab_7.4.3-omnibus.5.1.0.ci-1_amd64.deb在我的服务器上安装 Gitlab 。

And there is an error when I ran sudo gitlab-ctl reconfigure.

运行时出现错误sudo gitlab-ctl reconfigure

The is the error log:

这是错误log

[2014-11-07T12:26:33+08:00] INFO: Forking chef instance to converge...
[2014-11-07T12:26:33+08:00] INFO: *** Chef 11.12.2 ***
[2014-11-07T12:26:33+08:00] INFO: Chef-client pid: 17502
[2014-11-07T12:26:35+08:00] INFO: Setting the run_list to ["recipe[gitlab]"] from CLI options
[2014-11-07T12:26:35+08:00] INFO: Run List is [recipe[gitlab]]
[2014-11-07T12:26:35+08:00] INFO: Run List expands to [gitlab]
[2014-11-07T12:26:35+08:00] INFO: Starting Chef Run for R710
[2014-11-07T12:26:35+08:00] INFO: Running start handlers
[2014-11-07T12:26:35+08:00] INFO: Start handlers complete.
[2014-11-07T12:26:35+08:00] WARN: Cloning resource attributes for directory[/var/opt/gitlab] from prior resource (CHEF-3694)
[2014-11-07T12:26:35+08:00] WARN: Previous directory[/var/opt/gitlab]: /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb:40:in `from_file'
[2014-11-07T12:26:35+08:00] WARN: Current  directory[/var/opt/gitlab]: /opt/gitlab/embedded/cookbooks/gitlab/recipes/users.rb:23:in `from_file'
[2014-11-07T12:26:35+08:00] WARN: Cloning resource attributes for directory[/var/opt/gitlab/gitlab-rails/etc] from prior resource (CHEF-3694)
[2014-11-07T12:26:35+08:00] WARN: Previous directory[/var/opt/gitlab/gitlab-rails/etc]: /opt/gitlab/embedded/cookbooks/gitlab/recipes/gitlab-rails.rb:37:in `block in from_file'
[2014-11-07T12:26:35+08:00] WARN: Current  directory[/var/opt/gitlab/gitlab-rails/etc]: /opt/gitlab/embedded/cookbooks/gitlab/definitions/unicorn_config.rb:21:in `block in from_file'
[2014-11-07T12:26:35+08:00] WARN: Cloning resource attributes for service[unicorn] from prior resource (CHEF-3694)
[2014-11-07T12:26:35+08:00] WARN: Previous service[unicorn]: /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb:64:in `block in from_file'
[2014-11-07T12:26:35+08:00] WARN: Current  service[unicorn]: /opt/gitlab/embedded/cookbooks/runit/definitions/runit_service.rb:191:in `block in from_file'
[2014-11-07T12:26:35+08:00] WARN: Cloning resource attributes for service[sidekiq] from prior resource (CHEF-3694)
[2014-11-07T12:26:35+08:00] WARN: Previous service[sidekiq]: /opt/gitlab/embedded/cookbooks/gitlab/recipes/default.rb:64:in `block in from_file'
[2014-11-07T12:26:35+08:00] WARN: Current  service[sidekiq]: /opt/gitlab/embedded/cookbooks/runit/definitions/runit_service.rb:191:in `block in from_file'

================================================================================
[31mError executing action `create` on resource 'user[git]'
================================================================================


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 logged in
---- 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/gitlab/recipes/users.rb

 34: user gitlab_username do
 35:   shell node['gitlab']['user']['shell']
 36:   home gitlab_home
 37:   uid node['gitlab']['user']['uid']
 38:   gid gitlab_group
 39:   system true
 40: end
 41:



Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/gitlab/recipes/users.rb:34:in `from_file'

user("git") do
  action :create
  supports {:manage_home=>false, :non_unique=>false}
  retries 0
  retry_delay 2
  guard_interpreter :default
  username "git"
  gid 1014
  home "/var/opt/gitlab"
  shell "/bin/sh"
  system true
  cookbook_name :gitlab
  recipe_name "users"
end



[2014-11-07T12:26:35+08:00] INFO: Running queued delayed notifications before re-raising exception
[2014-11-07T12:26:35+08:00] ERROR: Running exception handlers
[2014-11-07T12:26:35+08:00] ERROR: Exception handlers complete
[2014-11-07T12:26:35+08:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/chef-stacktrace.out
[2014-11-07T12:26:35+08:00] ERROR: user[git] (gitlab::users line 34) 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 logged in
---- End output of ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] ----
Ran ["usermod", "-s", "/bin/sh", "-d", "/var/opt/gitlab", "git"] returned 8
[2014-11-07T12:26:36+08:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)

Something else is:

还有一点是:

I saw usermod: user git is currently logged inin my log. And I already have a user on my server named git. So is there any problem, and how to fix it?

usermod: user git is currently logged in在我的日志里看到了。我的服务器上已经有一个名为git. 那么有什么问题吗,如何解决?

Thanks a lot!

非常感谢!

回答by Rodrigo Lopez Guerra

The previous answer is right , you've already a git user. This can be because you already create it or because your gitlab installation is running. If this is the case , you'll be creating a new user not need it.

上一个答案是对的,您已经是 git 用户。这可能是因为您已经创建了它,或者因为您的 gitlab 安装正在运行。如果是这种情况,您将创建一个不需要它的新用户。

Try :

尝试 :

sudo service gitlab stop 

and Run

并运行

sudo gitlab-ctl reconfigure 

for the change to take effect.

以使更改生效。