Error 500 when trying to access repo in UI #10144

Closed
opened 2025-11-02 08:59:19 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @christerjohansson on GitHub (Jan 22, 2023).

Description

I had to reinstall Gitea from a volume crash on my Synology. I had backup in the cloud, and restored all my files from it through Hyper Backup. But when Gitea is installed, and set up, I can not access the repositories at all. I can create a new repository and access it, but I can not use my old repos.

I have tried "Resynchronize pre-receive, update and post-receive hooks of all repositories." to no end. The admin features seem to do nothing. I have noticed that these bare repos are missing some files, compared to the new one I created from the web ui. Also, I can not clone these repos outside as server say they aren't a repo or I do not have access. I have tried setting both myself and root as owner (chown), but still get same message.

I really need help restoring my repo's, they are in bare version now. And git does not seem to recognize them anymore, not sure what to do? It worked fine a week ago, before I reinstalled Gitea.

Error message:
"exit status 128 - fatal: not a git repository (or any parent up to mount point /volume1)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)."

Log:
"2023/01/23 00:18:41 ...ules/context/repo.go:630:RepoAssignment() [E] [63cdc451] RepoAssignment Invalid repo /volume1/gitea/christer.johansson/eken-dashboard.git: exit status 128 - fatal: not a git repository (or any parent up to mount point /volume1)
Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).
2023/01/23 00:18:41 ...s/context/context.go:219:HTML() [D] [63cdc451] Template: status/500
2023/01/23 00:18:41 [63cdc451] router: completed GET /christer.johansson/eken-dashboard for 192.168.0.xxx:60863, 500 Internal Server Error in 219.5ms @ context/repo.go:429(context.RepoAssignment)"

Gitea Version

1.17.3-10

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Screenshot:
image

Screenshot of repo files:

  1. Bare repo (old)
    image

  2. Screenshot of Hello World repo created in UI after installation
    image

Git Version

2.39.1-26

Operating System

Linux

How are you running Gitea?

I am running Gitea as a SynoCommunity package installed on my Synology DS720+ with DSM 7.1.1.x

Database

MySQL

Originally created by @christerjohansson on GitHub (Jan 22, 2023). ### Description I had to reinstall Gitea from a volume crash on my Synology. I had backup in the cloud, and restored all my files from it through Hyper Backup. But when Gitea is installed, and set up, I can not access the repositories at all. I can create a new repository and access it, but I can not use my old repos. I have tried "Resynchronize pre-receive, update and post-receive hooks of all repositories." to no end. The admin features seem to do nothing. I have noticed that these bare repos are missing some files, compared to the new one I created from the web ui. Also, I can not clone these repos outside as server say they aren't a repo or I do not have access. I have tried setting both myself and root as owner (chown), but still get same message. I really need help restoring my repo's, they are in bare version now. And git does not seem to recognize them anymore, not sure what to do? It worked fine a week ago, before I reinstalled Gitea. Error message: "exit status 128 - fatal: not a git repository (or any parent up to mount point /volume1) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set)." Log: "2023/01/23 00:18:41 ...ules/context/repo.go:630:RepoAssignment() [E] [63cdc451] RepoAssignment Invalid repo /volume1/gitea/christer.johansson/eken-dashboard.git: exit status 128 - fatal: not a git repository (or any parent up to mount point /volume1) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set). 2023/01/23 00:18:41 ...s/context/context.go:219:HTML() [D] [63cdc451] Template: status/500 2023/01/23 00:18:41 [63cdc451] router: completed GET /christer.johansson/eken-dashboard for 192.168.0.xxx:60863, 500 Internal Server Error in 219.5ms @ context/repo.go:429(context.RepoAssignment)" ### Gitea Version 1.17.3-10 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots Screenshot: ![image](https://user-images.githubusercontent.com/3787897/213945975-001aa7c9-cc80-4140-8df1-963cda638f42.png) Screenshot of repo files: 1. Bare repo (old) ![image](https://user-images.githubusercontent.com/3787897/213946130-3053e707-3a27-4227-8aee-a7f99a72c7dc.png) 2. Screenshot of Hello World repo created in UI after installation ![image](https://user-images.githubusercontent.com/3787897/213946201-1407f4fd-5f44-469e-9043-ea9530c66190.png) ### Git Version 2.39.1-26 ### Operating System Linux ### How are you running Gitea? I am running Gitea as a SynoCommunity package installed on my Synology DS720+ with DSM 7.1.1.x ### Database MySQL
GiteaMirror added the type/bug label 2025-11-02 08:59:19 -06:00
Author
Owner

@zeripath commented on GitHub (Jan 23, 2023):

/volume1/gitea/christer.johansson/eken-dashboard.git: exit status 128 - fatal: not a git repository (or any parent up to mount point /volume1)

Git can't find a git repository in that directory. It's likely it's just empty directories but whatever is there is not a valid repo.

Are you sure that /volume1/gitea is where the Gitea repositories have been restored to?

@zeripath commented on GitHub (Jan 23, 2023): ``` /volume1/gitea/christer.johansson/eken-dashboard.git: exit status 128 - fatal: not a git repository (or any parent up to mount point /volume1) ``` Git can't find a git repository in that directory. It's likely it's just empty directories but whatever is there is not a valid repo. Are you sure that /volume1/gitea is where the Gitea repositories have been restored to?
Author
Owner

@christerjohansson commented on GitHub (Jan 23, 2023):

/volume1/gitea/christer.johansson/eken-dashboard.git: exit status 128 - fatal: not a git repository (or any parent up to mount point /volume1)

Git can't find a git repository in that directory. It's likely it's just empty directories but whatever is there is not a valid repo.

Are you sure that /volume1/gitea is where the Gitea repositories have been restored to?

Yes, the sub folders in that directory exist, and they have objects...
For example, /volume1/gitea/christer.johansson/eken-dashboard.git have following content under objects/pack

image

But I can't get Git or Gitea to see these bare repositories, and need help figuring out how to do it. I can see the repo in my list of repos in Gitea, but generates the error 500 when clicking on it.

image

@christerjohansson commented on GitHub (Jan 23, 2023): > ``` > /volume1/gitea/christer.johansson/eken-dashboard.git: exit status 128 - fatal: not a git repository (or any parent up to mount point /volume1) > ``` > > Git can't find a git repository in that directory. It's likely it's just empty directories but whatever is there is not a valid repo. > > Are you sure that /volume1/gitea is where the Gitea repositories have been restored to? Yes, the sub folders in that directory exist, and they have objects... For example, `/volume1/gitea/christer.johansson/eken-dashboard.git` have following content under `objects/pack` ![image](https://user-images.githubusercontent.com/3787897/213997607-a7c716c9-a0f5-44a4-97b2-18e965f68fe7.png) But I can't get Git or Gitea to see these bare repositories, and need help figuring out how to do it. I can see the repo in my list of repos in Gitea, but generates the error 500 when clicking on it. ![image](https://user-images.githubusercontent.com/3787897/213998213-f0f5bf14-af85-4ede-a74b-2ffd45858e05.png)
Author
Owner

@silverwind commented on GitHub (Jan 24, 2023):

Check file system permissions for the user that runs gitea and maybe try starting gitea with GIT_DISCOVERY_ACROSS_FILESYSTEM=1 to see if it makes any difference. I'm not totally sure if such env vars are inherited to git processes thought.

@silverwind commented on GitHub (Jan 24, 2023): Check file system permissions for the user that runs gitea and maybe try starting gitea with `GIT_DISCOVERY_ACROSS_FILESYSTEM=1` to see if it makes any difference. I'm not totally sure if such env vars are inherited to git processes thought.
Author
Owner

@christerjohansson commented on GitHub (Jan 24, 2023):

I am closing this issue. The repo's were all broken and were missing config files. I went scouring across clients and got hold of most repos from client side and copied most recent files from .git folder into appropiate repsoitories in Gitea. I also switched from running Gitea as package to Docker container version in Synology instead. All repositories are mounted on host system, and will not be affected if container is reinstalled etc.

Not sure what actually went wrong in this process, or if Gitea had anything to do with it. But all the repo's lacked all config files, and only had pack-files. I have about 95% of them restored, it's close enough. :)

@christerjohansson commented on GitHub (Jan 24, 2023): I am closing this issue. The repo's were all broken and were missing config files. I went scouring across clients and got hold of most repos from client side and copied most recent files from .git folder into appropiate repsoitories in Gitea. I also switched from running Gitea as package to Docker container version in Synology instead. All repositories are mounted on host system, and will not be affected if container is reinstalled etc. Not sure what actually went wrong in this process, or if Gitea had anything to do with it. But all the repo's lacked all config files, and only had pack-files. I have about 95% of them restored, it's close enough. :)
Author
Owner

@zeripath commented on GitHub (Jan 24, 2023):

If it was only config files that were missing, then simply setting the below as the config file should have worked:

[core]
        repositoryformatversion = 0
        filemode = true
        bare = true
@zeripath commented on GitHub (Jan 24, 2023): If it was only config files that were missing, then simply setting the below as the config file should have worked: ``` [core] repositoryformatversion = 0 filemode = true bare = true ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10144