cybertoast
cybertoast

Reputation: 1423

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

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:

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

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.

Upvotes: 8

Views: 7369

Answers (3)

Kurt
Kurt

Reputation: 2403

Make sure that the repos are owned by git and then clear the cache.

chown -R git /var/opt/gitlab/git-data/repositories
gitlab-rake cache:clear

Upvotes: 2

soung
soung

Reputation: 1614

If you are using docker-compose or docker run, check if the gitlab repository directory has right permissions.

In my case, inside the container /var/opt/gitlab/git-data/repositories/user/my_repos hasn't the right permission(for some reason i ignore). To solve the issu i had to change the ownership of the repos directory.

Even if you are not using docker, permission issues on the repository directory could explain the "No repository" error.

Hope this could help

Upvotes: 0

Callie Jones
Callie Jones

Reputation: 217

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

sudo gitlab-rake cache:clear

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.

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]

Upvotes: 2

Related Questions