Gitea storing repositories in /var/lib/gitea/git/repositories causing repositories to be broken on docker image update #10041

Closed
opened 2025-11-02 08:56:36 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @navanshu on GitHub (Jan 2, 2023).

Description

I recently deployed Gitea with docker rootless and configured it with Postgres and MinIO but Gitea is storing repository in local file system as <RepoName>.git . Is this how it should be?

It should store this folder in database right? Does this part have to stateful

I noticed it when docker container image must have updated and it said that my git repository is broken. This repositories folder was empty.

I did not provide any volume for repositories or git folder. Inside the git folder it is storing ~/repositories/<UserName>/<RepoName>.git

The content of the above folder is

drwxr-xr-x    7 git      git         4.0K Jan  1 18:39 .
drwxr-xr-x    3 git      git         4.0K Jan  1 18:34 ..
-rw-r--r--    1 git      git           23 Jan  1 18:39 HEAD
drwxr-xr-x    2 git      git         4.0K Jan  1 18:34 branches
-rw-r--r--    1 git      git           66 Jan  1 18:34 config
-rw-r--r--    1 git      git           73 Jan  1 18:34 description
drwxr-xr-x    6 git      git         4.0K Jan  1 18:34 hooks
drwxr-xr-x    2 git      git         4.0K Jan  1 18:39 info
drwxr-xr-x    4 git      git         4.0K Jan  1 18:39 objects
drwxr-xr-x    4 git      git         4.0K Jan  1 18:34 refs

Also gitea is not removing old avatar from minio bucket when a user uploads a new one.

Gitea Version

1.18.0+rc1

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

No response

Git Version

No response

Operating System

No response

How are you running Gitea?

Docker rootless image provided by Gitea

Database

PostgreSQL

Originally created by @navanshu on GitHub (Jan 2, 2023). ### Description I recently deployed Gitea with docker rootless and configured it with Postgres and MinIO but Gitea is storing repository in local file system as `<RepoName>.git `. Is this how it should be? It should store this folder in database right? Does this part have to stateful I noticed it when docker container image must have updated and it said that my git repository is broken. This repositories folder was empty. I did not provide any volume for repositories or git folder. Inside the git folder it is storing `~/repositories/<UserName>/<RepoName>.git ` The content of the above folder is ```console drwxr-xr-x 7 git git 4.0K Jan 1 18:39 . drwxr-xr-x 3 git git 4.0K Jan 1 18:34 .. -rw-r--r-- 1 git git 23 Jan 1 18:39 HEAD drwxr-xr-x 2 git git 4.0K Jan 1 18:34 branches -rw-r--r-- 1 git git 66 Jan 1 18:34 config -rw-r--r-- 1 git git 73 Jan 1 18:34 description drwxr-xr-x 6 git git 4.0K Jan 1 18:34 hooks drwxr-xr-x 2 git git 4.0K Jan 1 18:39 info drwxr-xr-x 4 git git 4.0K Jan 1 18:39 objects drwxr-xr-x 4 git git 4.0K Jan 1 18:34 refs ``` Also gitea is not removing old avatar from minio bucket when a user uploads a new one. ### Gitea Version 1.18.0+rc1 ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots _No response_ ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? Docker rootless image provided by Gitea ### Database PostgreSQL
GiteaMirror added the type/bug label 2025-11-02 08:56:36 -06:00
Author
Owner

@savyajha commented on GitHub (Jan 2, 2023):

Edit: I misunderstood the issue. Ignore.

@savyajha commented on GitHub (Jan 2, 2023): Edit: I misunderstood the issue. Ignore.
Author
Owner

@yardenshoham commented on GitHub (Jan 2, 2023):

Edit: I misunderstood the issue. Ignore.

so close the issue?

@yardenshoham commented on GitHub (Jan 2, 2023): > Edit: I misunderstood the issue. Ignore. so close the issue?
Author
Owner

@evanferrao commented on GitHub (May 13, 2023):

I'm facing the exact same Issue, when I update the docker image, all repositories are broken. The logs state the following Repository 9:test/heroku-schedule has a broken repository on the file system: /var/lib/gitea/git/repositories/test/heroku-schedule.git Error: no such file or directory where test is the username and heroku-schedule is the repository name. Shouldn't the data be stored in the /data partition?

@evanferrao commented on GitHub (May 13, 2023): I'm facing the exact same Issue, when I update the docker image, all repositories are broken. The logs state the following `Repository 9:test/heroku-schedule has a broken repository on the file system: /var/lib/gitea/git/repositories/test/heroku-schedule.git Error: no such file or directory` where `test` is the username and `heroku-schedule` is the repository name. Shouldn't the data be stored in the `/data` partition?
Author
Owner

@techknowlogick commented on GitHub (May 13, 2023):

@evanferrao in the rootless container FHS is used for the appropriate directories. /data is a legacy artifact for the rootful image that is difficult to fix in a non-breaking manner, but luckily for rootless we were able to fix prior to publishing the image.

@techknowlogick commented on GitHub (May 13, 2023): @evanferrao in the rootless container FHS is used for the appropriate directories. /data is a legacy artifact for the rootful image that is difficult to fix in a non-breaking manner, but luckily for rootless we were able to fix prior to publishing the image.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#10041