首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >GitLab重新配置错误:在资源'user[git]‘上执行操作’`create`‘

GitLab重新配置错误:在资源'user[git]‘上执行操作’`create`‘
EN

Stack Overflow用户
提问于 2014-11-07 04:38:43
回答 2查看 13.4K关注 0票数 8

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

当我运行sudo gitlab-ctl reconfigure时出现了一个错误。

是错误log

代码语言:javascript
复制
[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)

还有一件事是:

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

非常感谢!

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2014-11-07 09:21:20

事实上,您已经有一个名为git的用户,这可能是问题所在:您需要为GitLab保留一个用户。

你试过做正如自述中所解释的吗?

默认情况下,omnibus gitlab使用用户名git进行gitlab登录、Git数据本身的所有权以及在web界面上生成SSH。类似地,git组用于Git数据的组所有权。您可以通过向/etc/gitlab/gitlab.rb添加以下行来更改用户和组。

代码语言:javascript
复制
user['username'] = "gitlab"
user['group'] = "gitlab"

运行sudo gitlab-ctl reconfigure以使更改生效。

票数 19
EN

Stack Overflow用户

发布于 2015-03-18 21:55:44

前面的答案是正确的,您已经有了一个git用户。这可能是因为您已经创建了它,或者因为您的gitlab安装正在运行。如果是这样的话,您将创建一个不需要它的新用户。

试着:

代码语言:javascript
复制
sudo service gitlab stop 

然后跑

代码语言:javascript
复制
sudo gitlab-ctl reconfigure 

改变才能生效。

票数 4
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/26794162

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档