Gitlab repository does not exists issue
Asked Answered
S

1

3

Facing issue with gitlab repository not available.

When accessing project form gitlab page it shows below error

No repository
The repository for this project does not exist. 
This means you can not push code until you create an empty repository or import existing one.

When check over project details from root login below is problem

Project info:
Name: app
Namespace: Administrator
Owned by: Administrator
Created by: Administrator
Created on: May 20, 2016 9:08am
http: http://192.168.1.123/root/app.git
ssh: [email protected]:root/app.git
repository: does not exist
access:  Private

And later checked in gitlab file system under below path

root@root:/var/opt/gitlab/git-data/repositories/root/app.git#

exists and folder size is of 3 mb which should be same.

And when checked for ssh access i am able to clone project but push to project isn't working and showing below error

Pushing to [email protected]:root/app.git
GitLab: A repository for this project does not exist yet.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

And when checked in the gitlab machine and checked for 'gitlab-rails dbconsole' Able to login and check table for project with above app project it exists fine.

Need help to fix issue of project path isn't pointed properly. Below is sample output of another project for which its showing proper project details.

Name: newname
Namespace: Administrator
Owned by: Administrator
Created by: Administrator
Created on: Sep 14, 2017 12:03pm
http: http://192.168.1.123/root/newname.git
ssh: [email protected]:root/newname.git
fs: /var/opt/gitlab/git-data/repositories/root/newname.git
Size 0.2 MB
last commit: 5 months ago
access:  Private
Sprat answered 30/1, 2018 at 9:44 Comment(3)
Hello Aman, facing the same issue here. Were you able to find a solution?Bet
@MihalyKR Just noticed this after posting (#51180446). The solution might be to run gitlab-rake cache:clear.Diapophysis
@cyber Yes, turned out that worked for us as well. Cheers!Bet
Y
2

In this case where the repository clearly does exist on the server, it is probably a stale cache:

sudo gitlab-rake cache:clear

You should also confirm that the files in the repository storage are owned by the git user and group:

sudo chown -R git:git /var/opt/gitlab/git-data/repositories

Also, though this was not an issue when this question was asked in 2018, it can come up again after migrating a legacy GitLab git repository to hashed storage due to a rare edge-case. In this case, there is a GitLab Support snippet which can help to diagnose and repair when GitLab is looking for the repository at it's pre-migrated location.

Yerkovich answered 16/7, 2022 at 7:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.