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

本文涉及的产品
Redis 开源版,标准版 2GB
推荐场景:
搭建游戏排行榜
简介: 自己编译gitlab源码搭建中文版gitlab完成后突然无法提交,gitlab服务使用正常,可是新建库文件,gitclone的时候报错。用gitlab本身也报错。 报错git operation was rejected by pre-receive hook 无意间找到一个检测gitl...
自己编译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

目录
相关文章
|
1月前
|
安全 开发工具 git
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
229 5
git添加远程仓库报错To add an exception for this directory解决方案-优雅草卓伊凡
|
4月前
|
算法 安全 网络安全
git clone操作报错diffie-hellman-group1-sha1的解决方案
在处理这一问题时,需要确保了解相关操作的安全影响。`diffie-hellman-group1-sha1`算法被认为是不够安全的,这是因为随着计算能力的提高,`SHA-1`算法可以在合理的时间内被破解,而且其对应的 `1024位`Diffie-Hellman组也可能不够强大。因此,在确保Git操作的同时,也要考虑提升安全性的长期解决办法。强烈推荐与管理员或相关技术支持团队合作,升级和加强服务器端的安全配置。
133 12
|
7月前
|
Shell 开发工具 git
解决git bash报错:在仓库中检测到可疑的所有权
总的来说,解决“在仓库中检测到可疑的所有权”的报错,关键在于理解和调整文件或目录的所有权。只要我们正确地设置了文件或目录的所有权,那么我们就可以避免这种问题,让Git Bash正常工作。
283 22
|
8月前
|
开发工具 git 索引
warning: You ran ‘git add’ with neither ‘-A (—all)’ or ‘—ignore-removal’,报错如何解决 git报错 ‘git add —ignore-removal <pathspec>优雅草卓伊凡
warning: You ran ‘git add’ with neither ‘-A (—all)’ or ‘—ignore-removal’,报错如何解决 git报错 ‘git add —ignore-removal <pathspec>优雅草卓伊凡
161 21
warning: You ran ‘git add’ with neither ‘-A (—all)’ or ‘—ignore-removal’,报错如何解决 git报错 ‘git add —ignore-removal <pathspec>优雅草卓伊凡
|
10月前
|
jenkins 持续交付 开发工具
git hook
Hook 机制 用于拦截、修改或扩展程序的行为。通过 Hook 机制,程序可以在不修改源代码或核心逻辑的情况下,向特定的事件、函数调用之前或之后插入自定义代码。Hook 机制通常被用于调试、监控、拦截系统调用、修改程序的行为等场景。
234 66
git hook
|
5月前
|
网络协议 开发工具 git
解决 git 报错 “fatal: unable to access ‘https://github.com/.../.git‘: Recv failure Connection was rese
在使用 Git/Git小乌龟 进行代码管理的过程中,经常会遇到各种各样的问题,其中之一就是在执行 git clone 或 git pull 等操作时出现 “fatal: unable to access ‘https://github.com/…/.git’: Recv failure Connection was reset” 的报错。这个问题通常是由网络连接问题或代理设置不正确导致的。在我的个人使用经验中,我亲自尝试了四种方法,它们都能够有效地解决这个报错。个人比较推荐方法二。
2785 0
|
9月前
|
开发工具 git
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
748 3
git 使用之remote: File [4e21e71a555febaa4dfaaa05cf7eeb606ea96ae2] size 104.090MB, exceeds quota 100MB remote: Please remove the file[s] from history and try again 报错如何解决-优雅草卓伊凡
|
存储 开发工具 数据安全/隐私保护
git报错The project you were looking for could not be found 解决方式
git报错The project you were looking for could not be found 解决方式
3624 1
|
前端开发 开发工具 git
如何清理 docker 磁盘空间+修改 Gitea 服务器的 Webhook 设置+前端一些好学好用的代码规范-git hook+husky + commitlint
如何清理 docker 磁盘空间+修改 Gitea 服务器的 Webhook 设置+前端一些好学好用的代码规范-git hook+husky + commitlint
217 5
|
机器学习/深度学习 Shell 开发工具
Python使用管道执行git命令报错|4-7
Python使用管道执行git命令报错|4-7