storage_directory[/var/opt/gitlab/.ssh](gitlab::gitlab-shell line 38)had an error:Mixlib::shellout::

报错信息

storage_directory[/var/opt/gitlab/.ssh](gitlab::gitlab-shell line 38)had an error:Mixlib::shellout::shellcommandfailed:
ruby_block[directory resource: /var/opt/gitlab/.ssh](/opt/gitlab/embedded/cookbooks/cache/cookbooks/package/resources/storage_directory.rb line 33) had an error:Mixlib::shellout::shellcommandfailed:Expected process to exit with [0] ,but received ‘1’
-------- begin output of stat --printf=’%U’ $(readlink -f /var/opt/gitlab/.ssh)------
stout:
stderr: stat:missing oprand
try stat --help
------- end output of stat --printf =’%U’ $(readlink -f /var/opt/gitlab/.ssh)-----
ran stat --print=’%U’ $(readlink -f /var/opt/gitlab/.ssh) returned 1

报错信息分析

$(readlink -f /data/gitlab/ssh)返回空

原因

与权限有关。git用户需要对包含.ssh目录的文件夹(包含父文件夹)执行权限。

确定是否权限缺失

按照步骤输入命令
1、

/bin/sh

2、

stat --printf=’%U’ $(readlink -f /var/opt/gitlab/.ssh)

若有输出,则执行下面命令
3、

sudo su git

4、

stat --printf=’%U’ $(readlink -f /var/opt/gitlab/.ssh)

5、如果出现如下错误信息,则确定git缺失执行权限

stat: missing operand
Try `stat --help’ for more information.

解决方案

链接: gitlab官方issue有相似问题及解决方案.

以下是本次问题解决方案

即使/var/opt/gitlab/.ssh的所有者和用户组都是git,由于父权限,它也不能到这级目录执行shell命令。即,给 /var/opt/gitlab/目录执行权限:

chmod +x /var/opt/gitlab/
chmod +x /var/opt/
chmod +x /var/

总结

1、找专业的人解决问题,比自己一人琢磨要省很多时间。
2、外国开源组件,尽量去他们的社区issues去找,没有相似问题,则自己提问题。

附:这是我提的问题
https://gitlab.com/gitlab-org/omnibus-gitlab/issues/3937

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值