Gitlab returns “No Repository” even though the repository exists in the git_data_dirs path(s)

柔情痞子 提交于 2019-12-22 08:21:36

问题


Summary

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.

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.

Steps to reproduce

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

  • backup project on primary server
  • restore tarball on new server
  • go to project path in the new server's web dashboard, and get "No Repository".

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"} })

  • 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

  • Try restarting the server - same result
  • Try sudo gitlab-ctl reconfigure - same result
  • Try restarting the runsv services: sudo systemctl restart gitlab-runsvdir - same result

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.

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.

SOLUTION

Run sudo gitlab-rake cache:clear once the migration is completed.

来源:https://stackoverflow.com/questions/51179946/gitlab-returns-no-repository-even-though-the-repository-exists-in-the-git-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!