docker运行gitlab报权限错误"2770"

* 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 #<Proc:0x00000000058b1e10@/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb:34>
        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,改成下面的目录(自己配置文件挂载的data目录),然后在docker start 镜像id启动,发现居然成功了!!!

在此记录一下,希望能帮到大家

 


原文链接:https://blog.csdn.net/you1272586223/article/details/86512040

 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值