* bash[Set proper security context on ssh files for selinux] action run (skipped due to only_if)
Recipe: gitlab::gitlab-rails
* storage_directory[/var/opt/gitlab/git-data] action create
* ruby_block[directory resource: /var/opt/gitlab/git-data] action run
- execute the ruby block directory resource: /var/opt/gitlab/git-data
* storage_directory[/var/opt/gitlab/git-data/repositories] action create
* ruby_block[directory resource: /var/opt/gitlab/git-data/repositories] action run
================================================================================
Error executing action `run` on resource "ruby_block[directory resource: /var/opt/gitlab/git-data/repositories]"
================================================================================
Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Failed asserting that mode permissions on "/var/opt/gitlab/git-data/repositories" is 2770
---- Begin output of set -x && [ "$(stat --printf="%04a" $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o "....$")" = "2770" ] ----
STDOUT:
STDERR: + grep -o ....$
+ readlink -f /var/opt/gitlab/git-data/repositories
+ stat --printf=%04a /var/opt/gitlab/git-data/repositories
+ [ 0770 = 2770 ]
---- End output of set -x && [ "$(stat --printf="%04a" $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o "....$")" = "2770" ] ----
Ran set -x && [ "$(stat --printf="%04a" $(readlink -f /var/opt/gitlab/git-data/repositories) | grep -o "....$")" = "2770" ] returned 1
Cookbook Trace:
---------------
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:125:in `validate_command"
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:113:in `block in validate"
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `each_index"
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:112:in `validate"
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/libraries/storage_directory_helper.rb:87:in `validate!"
/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:42:in `block (3 levels) in class_from_file"
Resource Declaration:
---------------------
# In /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb
33: ruby_block "directory resource: #{new_resource.path}" do
34: block do
35: # Ensure the directory exists
36: storage_helper.ensure_directory_exists(new_resource.path)
37:
38: # Ensure the permissions are set
39: storage_helper.ensure_permissions_set(new_resource.path)
40:
41: # Error out if we have not achieved the target permissions
42: storage_helper.validate!(new_resource.path)
43: end
44: not_if { storage_helper.validate(new_resource.path) }
45: end
46: end
Compiled Resource:
------------------
# Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:33:in `block in class_from_file"
ruby_block("directory resource: /var/opt/gitlab/git-data/repositories") do
action [:run]
default_guard_interpreter :default
block_name "directory resource: /var/opt/gitlab/git-data/repositories"
declared_type :ruby_block
cookbook_name "gitlab"
block #<0x00000000058b1e10>0x00000000058b1e10>
not_if { #code block }
end
System Info:
------------
chef_version=13.6.4
platform=ubuntu
platform_version=16.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
================================================================================
Error executing action `create` on resource "storage_directory[/var/opt/gitlab/git-data/repositories]"
================================================================================
如果出现如上错误,请修改下挂载目录下config/gitlab.rb,搜索git_data_dirs
把默认path,改成下面的目录,然后在docker start 镜像id启动,发现居然成功了!!!
在此记录一下,希望能帮到大家