Can not access to repository "code = NotFound desc = GetRepoPath: not a git repository"

I run gitlab CE local normally but it suddenly lost data in repository, the webpage always show error 500.

the log sudo gitlab-ctl tail show error rpc error: code = NotFound desc = GetRepoPath: not a git repository :

==> /var/log/gitlab/gitlab-exporter/current <==
2021-11-26_10:18:17.49578 127.0.0.1 - - [26/Nov/2021:17:18:16 +07] "GET /sidekiq HTTP/1.1" 200 54498
2021-11-26_10:18:17.49585 - -> /sidekiq

==> /var/log/gitlab/gitaly/current <==
{"correlation_id":"01FNDW1EA4PNQD11BHY3VV1E3D","error":"rpc error: code = NotFound desc = GetRepoPath: not a git repository: \"/GITLAB/gitlab/data/git-data/repositories/@hashed/45/4f/454f63ac30c8322997ef025edff6abd23e0dbe7b8a3d5126a894e4a168c1b59b.git\"","grpc.code":"NotFound","grpc.meta.auth_version":"v2","grpc.meta.client_name":"gitlab-web","grpc.meta.deadline_type":"regular","grpc.method":"FindDefaultBranchName","grpc.request.deadline":"2021-11-26T10:18:28.010Z","grpc.request.fullMethod":"/gitaly.RefService/FindDefaultBranchName","grpc.request.glProjectPath":"my-project/my-project-docs","grpc.request.glRepository":"project-103","grpc.request.repoPath":"@hashed/45/4f/454f63ac30c8322997ef025edff6abd23e0dbe7b8a3d5126a894e4a168c1b59b.git","grpc.request.repoStorage":"default","grpc.request.topLevelGroup":"@hashed","grpc.service":"gitaly.RefService","grpc.start_time":"2021-11-26T10:18:18.110Z","grpc.time_ms":0.177,"level":"info","msg":"finished unary call with code NotFound","peer.address":"@","pid":30566,"remote_ip":"112.69.108.121","span.kind":"server","system":"grpc","time":"2021-11-26T10:18:18.110Z","username":"tri.bui"}

==> /var/log/gitlab/gitlab-rails/production.log <==
Completed 500 Internal Server Error in 1642ms (ActiveRecord: 221.7ms | Elasticsearch: 0.0ms | Allocations: 59997)

my system info:

System information
System:         Ubuntu 18.04
Current User:   git
Using RVM:      no
Ruby Version:   2.7.2p137
Gem Version:    3.1.4
Bundler Version:2.1.4
Rake Version:   13.0.3
Redis Version:  6.0.14
Git Version:    2.31.1
Sidekiq Version:5.2.9
Go Version:     go1.10.4 linux/amd64

GitLab information
Version:        13.12.15
Revision:       6614e1562c6
Directory:      /opt/gitlab/embedded/service/gitlab-rails
DB Adapter:     PostgreSQL
DB Version:     12.6
URL:            http://<my-repository-url.com>
HTTP Clone URL: http://<my-repository-url.com>/some-group/some-project.git
SSH Clone URL:  ssh://git@<my-repository-url.com>:12345/some-group/some-project.git
Using LDAP:     yes
Using Omniauth: yes
Omniauth Providers:

GitLab Shell
Version:        13.18.1
Repository storage paths:
- default:      /GITLAB/gitlab/data/git-data/repositories
GitLab Shell path:              /opt/gitlab/embedded/service/gitlab-shell
Git:            /opt/gitlab/embedded/bin/git

Does anyone know how to fix this issue ?

A similar problem. It turned out that repositories were encrypted through an exploit in gitlab. There was a warning in the folder / srv / gitlab / gitlab / data / git-data

1 Like

Thanks for this. Yeah, same thing happened to me…

It’s gonna be annoying to fix, but thankfully with how git is designed, pretty much all my stuff is somewhere…

1 Like

Thanks MishaArmi. It hit me as well with a decryptor message once I saw your message and started looking.

Here is a link if anyone needs to understand it as well - https://www.bleepingcomputer.com/news/security/over-30-000-gitlab-servers-still-unpatched-against-critical-bug/