Error 500 for single repository - problem with config file #13226

Closed
opened 2025-11-02 10:35:30 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @Rhinogradentia on GitHub (Jul 2, 2024).

Description

One of my repositories suddenly went to Error 500 in the Webinterface and the commandline error after trying to access it is

sh-3.2$ git pull
fatal: Could not read from remote repository.

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

All other repositories are still available. It seems that this occurred after/when a pull request got updated with the base branch.

The concerning repo is still in the mounted data directory:

5e228626d056:/data/gitea/log# ls -lsah /data/git/repositories/ngs-software/<repo-with-erro>.git/
total 13K    
     0 drwxrwx---    2 git      993            0 Jul  2 11:02 .
     0 drwxrwx---    2 git      993            0 May 19  2022 ..
     4 -rwxrwx---    1 git      993          108 Jul  2 08:46 FETCH_HEAD
     0 -rwxrwx---    1 git      993           23 Apr 23  2019 HEAD
     0 drwxrwx---    2 git      993            0 Apr 23  2019 branches
     4 -rwxrwx---    1 git      993           93 Jul  2 11:02 config
     4 -rwxrwx---    1 git      993           73 Apr 23  2019 description
     0 drwxrwx---    2 git      993            0 Jul  2 10:24 hooks
     0 drwxrwx---    2 git      993            0 Jul  2 09:32 info
     0 drwxrwx---    2 git      993            0 Jul  2 09:32 objects
     0 -rwxrwx---    1 git      993           46 Jul  2 08:46 packed-refs
     0 drwxrwx---    2 git      993            0 Oct 31  2019 pulls
     0 drwxrwx---    2 git      993            0 May 17  2019 refs

I checked the config file - initially it was "missing", respectively empty. I added the following content:

less config 
less: can't open 'config': No such file or directory
#################
[core]
          repositoryformatversion = 0
          filemode = true
          bare = true
config (END)
########

But it still says the file is not there, even though it clearly is listed and has a size.

The HEAD and FETCH_HEAD files are not empty

I'm running gitea 1.17.3 ( I know - it is an older release - but I can not upgrade for a reason ) in a docker container.

I tried to re-initialize the repositories, I ran the garbage collector and health checked the repos.

The log entries are:

# this seems to be the first error, I see no reason for the permissions problem
2024/07/02 08:42:42 ...ervices/pull/pull.go:280:func1() [E] checkIfPRContentChanged: AddRemote: ngs-software/<repo-with-error>-checkIfPRContentChanged-1719909762630277219: exit status 128 - error: could not write config file config: Permission denied
	fatal: could not set 'remote.checkIfPRContentChanged-1719909762630277219.url' to '/data/git/repositories/ngs-software/<repo-with-error>.git'
	 - error: could not write config file config: Permission denied
	fatal: could not set 'remote.checkIfPRContentChanged-1719909762630277219.url' to '/data/git/repositories/ngs-software/<repo-with-error>.git'

2024/07/02 09:32:34 ...ules/convert/pull.go:94:ToAPIPullRequest() [E] [6683c932-11] OpenRepository[/data/git/repositories/ngs-software/<repo-with-error>.git]: exit status 128 - fatal: unknown error occurred while reading the configuration files

2024/07/02 09:38:01 ...pi/v1/repo/status.go:66:NewCommitStatus() [E] [6683ca79-2] CreateCommitStatus: OpenRepository[/data/git/repositories/ngs-software/<repo-with-error>.git]: exit status 128 - fatal: unknown error occurred while reading the configuration files

2024/07/02 11:25:50 .../repository/check.go:44:func1() [W] [6683e06e-2] Failed to health check repository (&{44 13 ngs-software <nil>  <repo-with-erro> <RepoName>  0  master 20 1 0 439 373 66 181 177 4 0 0 0 1 0 1 true false false false <nil> 0 map[] map[] [] <nil> false 0 <nil> false 0 60263488 <nil> <nil> true false [infrastructure] defau
lt 44-67d3a0cb73e1e0d5e13dbdcf81ba377b 1556050338 1719912754}): exit status 128

2024/07/02 12:49:42 ...ules/context/repo.go:630:RepoAssignment() [E] [6683f766] RepoAssignment Invalid repo /data/git/repositories/ngs-software/<repo-with-error>.git: exit status 128 - fatal: unknown error occurred while reading the configuration files

Essentially I would assume it has something to do with the config file, but my approaches did not work.
How can I fix this?

Any help appreciated.

Best,
Nadine

Gitea Version

1.17.3

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

2.36.2

Operating System

gitea docker container

How are you running Gitea?

It is running in the original docker container

Database

PostgreSQL

Originally created by @Rhinogradentia on GitHub (Jul 2, 2024). ### Description One of my repositories suddenly went to Error 500 in the Webinterface and the commandline error after trying to access it is ``` sh-3.2$ git pull fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. ``` All other repositories are still available. It seems that this occurred after/when a pull request got updated with the base branch. The concerning repo is still in the mounted data directory: ``` 5e228626d056:/data/gitea/log# ls -lsah /data/git/repositories/ngs-software/<repo-with-erro>.git/ total 13K 0 drwxrwx--- 2 git 993 0 Jul 2 11:02 . 0 drwxrwx--- 2 git 993 0 May 19 2022 .. 4 -rwxrwx--- 1 git 993 108 Jul 2 08:46 FETCH_HEAD 0 -rwxrwx--- 1 git 993 23 Apr 23 2019 HEAD 0 drwxrwx--- 2 git 993 0 Apr 23 2019 branches 4 -rwxrwx--- 1 git 993 93 Jul 2 11:02 config 4 -rwxrwx--- 1 git 993 73 Apr 23 2019 description 0 drwxrwx--- 2 git 993 0 Jul 2 10:24 hooks 0 drwxrwx--- 2 git 993 0 Jul 2 09:32 info 0 drwxrwx--- 2 git 993 0 Jul 2 09:32 objects 0 -rwxrwx--- 1 git 993 46 Jul 2 08:46 packed-refs 0 drwxrwx--- 2 git 993 0 Oct 31 2019 pulls 0 drwxrwx--- 2 git 993 0 May 17 2019 refs ``` I checked the config file - initially it was "missing", respectively empty. I added the following content: ``` less config less: can't open 'config': No such file or directory ################# [core] repositoryformatversion = 0 filemode = true bare = true config (END) ######## ``` But it still says the file is not there, even though it clearly is listed and has a size. The HEAD and FETCH_HEAD files are not empty I'm running gitea 1.17.3 ( I know - it is an older release - but I can not upgrade for a reason ) in a docker container. I tried to re-initialize the repositories, I ran the garbage collector and health checked the repos. The log entries are: ``` # this seems to be the first error, I see no reason for the permissions problem 2024/07/02 08:42:42 ...ervices/pull/pull.go:280:func1() [E] checkIfPRContentChanged: AddRemote: ngs-software/<repo-with-error>-checkIfPRContentChanged-1719909762630277219: exit status 128 - error: could not write config file config: Permission denied fatal: could not set 'remote.checkIfPRContentChanged-1719909762630277219.url' to '/data/git/repositories/ngs-software/<repo-with-error>.git' - error: could not write config file config: Permission denied fatal: could not set 'remote.checkIfPRContentChanged-1719909762630277219.url' to '/data/git/repositories/ngs-software/<repo-with-error>.git' 2024/07/02 09:32:34 ...ules/convert/pull.go:94:ToAPIPullRequest() [E] [6683c932-11] OpenRepository[/data/git/repositories/ngs-software/<repo-with-error>.git]: exit status 128 - fatal: unknown error occurred while reading the configuration files 2024/07/02 09:38:01 ...pi/v1/repo/status.go:66:NewCommitStatus() [E] [6683ca79-2] CreateCommitStatus: OpenRepository[/data/git/repositories/ngs-software/<repo-with-error>.git]: exit status 128 - fatal: unknown error occurred while reading the configuration files 2024/07/02 11:25:50 .../repository/check.go:44:func1() [W] [6683e06e-2] Failed to health check repository (&{44 13 ngs-software <nil> <repo-with-erro> <RepoName> 0 master 20 1 0 439 373 66 181 177 4 0 0 0 1 0 1 true false false false <nil> 0 map[] map[] [] <nil> false 0 <nil> false 0 60263488 <nil> <nil> true false [infrastructure] defau lt 44-67d3a0cb73e1e0d5e13dbdcf81ba377b 1556050338 1719912754}): exit status 128 2024/07/02 12:49:42 ...ules/context/repo.go:630:RepoAssignment() [E] [6683f766] RepoAssignment Invalid repo /data/git/repositories/ngs-software/<repo-with-error>.git: exit status 128 - fatal: unknown error occurred while reading the configuration files ``` Essentially I would assume it has something to do with the config file, but my approaches did not work. How can I fix this? Any help appreciated. Best, Nadine ### Gitea Version 1.17.3 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version 2.36.2 ### Operating System gitea docker container ### How are you running Gitea? It is running in the original docker container ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 10:35:31 -06:00
Author
Owner

@Rhinogradentia commented on GitHub (Jul 2, 2024):

I found a local reason for this error.

@Rhinogradentia commented on GitHub (Jul 2, 2024): I found a local reason for this error.
Author
Owner

@techknowlogick commented on GitHub (Jul 2, 2024):

@Rhinogradentia what was the issue? asking in case anyone else runs into the same thing.

@techknowlogick commented on GitHub (Jul 2, 2024): @Rhinogradentia what was the issue? asking in case anyone else runs into the same thing.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#13226