Gitlab返回"No Repository".即使存储库存在于git_data_dirs路径中 [英] Gitlab returns "No Repository" even though the repository exists in the git_data_dirs path(s)

查看:1035
本文介绍了Gitlab返回"No Repository".即使存储库存在于git_data_dirs路径中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

备份和迁移后,某些存储库在Web控制台中返回"No Repository"错误,无法克隆.验证该存储库已存在,如git_data_dirs文件夹中指定的那样.

After backup and migrate, some repositories return "No Repository" error in the web console, and cannot be cloned. The repository is verified to exist as specified in the git_data_dirs folder.

作为测试,我可以直接从repositories/文件夹中克隆无存储库"项目,因此存储库本身似乎没有什么问题.

As a test I can clone the "No repository" project from the repositories/ folder directly, so there seems to be nothing wrong with the repo itself.

不确定如何复制它,但是这是我经历的步骤:

Not sure how it can be reproduced, but here are the steps i've gone through:

  • 主服务器上的备份项目
  • 在新服务器上还原tarball
  • 转到新服务器的Web仪表板中的项目路径,并获取无存储库".

我为诊断问题所采取的步骤.假设该项目名为myapp/myapp.foo.git:

The steps I've taken to diagnose the problem. Say the project is called myapp/myapp.foo.git:

  • Go to http://newgitserver.local/myapp/myapp.foo.git
  • Get "No Repository"
  • Look at git_data_dirs in /etc/gitlab/gitlab.rb:

git_data_dirs({ "default":{"path":"/var/opt/gitlab/git-data"}, "silo":{"path":"/mnt/reposbackup/git-data"} })

git_data_dirs({ "default": { "path": "/var/opt/gitlab/git-data"}, "silo": {"path": "/mnt/reposbackup/git-data"} })

请注意,我的项目在两个文件夹中均可用:/var/opt/gitlab/git-data/repositories/myapp/myapp.foo.git AND/mnt/reposbackup/git-data/repositories/myapp /myapp.foo.git

Note that my project is available in both the folders: /var/opt/gitlab/git-data/repositories/myapp/myapp.foo.git AND /mnt/reposbackup/git-data/repositories/myapp/myapp.foo.git

我也查看了数据库,并且'projects.repository_storage'值似乎正确.甚至将其更改为默认"与"silo"(这是我的备用目录)似乎也不起作用.

I've also looked at the database and the 'projects.repository_storage' value seems correct. Even changing it to 'default' vs 'silo' (which is my alternate dir) does not seem to work.

我试图了解gitlab如何确定存储库的位置,因为对repo-path的检查似乎是失败的原因.

I'm trying to understand how gitlab makes a determination of where the repository is, since the check for repo-path seems to be what's failing.

迁移完成后,运行sudo gitlab-rake cache:clear.

推荐答案

您可能需要清除Redis缓存.尝试运行以下命令:

You likely need to clear the Redis cache. Try running the following command:

sudo gitlab-rake cache:clear

Rake是一个通用维护命令,并不是很多用户都知道,因为如果您使用的是纯云产品,则永远不需要它.它实际上仅适用于本地产品.

Rake is a general maintenance command that not a lot of users know about, as you'd never need it if you are using the pure cloud offering. It really only applies to on-premise offerings.

有时,该问题纯粹是网络连接问题.您还可以使用rake进行检查:

Sometimes the issue is purely a network connectivity issue. You can also use rake to check that as well:

sudo gitlab-rake gitlab:tcp_check[ibm.com,80]

这篇关于Gitlab返回"No Repository".即使存储库存在于git_data_dirs路径中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆