自搭gitlab报错--git operation was rejected by pre-receive hook

自己编译gitlab源码搭建中文版gitlab完成后突然无法提交,gitlab服务使用正常,可是新建库文件,gitclone的时候报错。用gitlab本身也报错。
报错git operation was rejected by pre-receive hook

img_5a6e96fe797001a4e27dabe67add19bc.png

无意间找到一个检测gitlab的是否完整的命令
sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production

img_590f69a81ec588655dfc1a46a598f3f5.png

GitLab Shell version >= 2.7.2 ? ... OK (2.7.2)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
hooks directories in repos are links: ... 
Administrator / tgrambaseline1.0 ... repository is empty
Administrator / testing ... ok
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: FAILED. code: 404
gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /home/git/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.


从日志可以看出 提示我 gitlab-shell有问题 让我改 /home/git/gitlab-shell/config.yml 文件

先查看一下这个文件
sudo -u git -H vi /home/git/gitlab-shell/config.yml

user: git
gitlab_url: http://xxx.xxx.xxx.xx/
http_settings:
  self_signed_cert: false
repos_path: "/home/git/repositories/"
auth_file: "/home/git/.ssh/authorized_keys"
redis:
  bin: "/usr/bin/redis-cli"
  namespace: resque:gitlab
  socket: "/var/run/redis/redis.sock"
log_level: INFO
audit_usernames: false


GitLab设置IP或者域名有两个配置文件:
1、GitLab的:/home/git/gitlab/config/gitlab.yml
2、GitLab-Shell的:/home/git/gitlab-shell/config.yml
把两个配置文件的IP或者域名修正过来即可。在GitLab-Shell的配置文件中,如果域名带端口号,也要把端口号写上。例如我的是gitlab_url: "http://gitlab.xxxx.xxxx.com:8088/"
加上端口号就好了。

img_478f0719f111403e942e66e95de94796.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值