Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create repositories (incorrect read-only file system error) #6160

Closed
2 of 7 tasks
LBlaboon opened this issue Feb 22, 2019 · 3 comments
Closed
2 of 7 tasks

Can't create repositories (incorrect read-only file system error) #6160

LBlaboon opened this issue Feb 22, 2019 · 3 comments
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.

Comments

@LBlaboon
Copy link

  • Gitea version (or commit ref): 1.7.2
  • Git version: 2.20.1
  • Operating system: Arch Linux
  • Database:
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I have stood up a new instance of Gitea, and when I try to create a new repository I get a 500 server error. The syslog reports the following error:
[...routers/repo/repo.go:146 handleCreateError()] [E] CreatePost: initRepository: InitRepository: chdir /srv/gitea/lb.laboon/test.git: no such file or directory

(I have /srv/gitea configured as the repo directory, and can confirm that it does exist and gitea has appropriate permissions to write to it).

Upon further debugging the code, it appears that something incorrectly thinks that /srv is a read-only filesystem. I modified vendor/code.gitea.io/git/repo.go to print any errors related to os.MkdirAll and got the following:
[...routers/repo/repo.go:146 handleCreateError()] [E] CreatePost: initRepository: InitRepository: mkdir /srv/gitea/lb.laboon: read-only file system

I'm not sure why it is reporting that, because I can run mkdir /srv/gitea/lb.laboon manually as the gitea user and it works just fine, so I'm sort of at a loss here. Any help would be appreciated!

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Feb 23, 2019
@LBlaboon
Copy link
Author

I figured out the issue. In Arch's package of gitea the following line is included in the systemd unit file:
ReadWritePaths=/etc/gitea/app.ini

This makes all other filesystem paths non-writable to the gitea process, regardless of filesystem permissions. My solution was to create a unit override file that additionally includes my custom repo path in the ReadWritePaths directive.

@BluntlyCat
Copy link

Thank you so very much! I ran into the same error on arch and was wondering why and how to solve it.

@zeripath
Copy link
Contributor

zeripath commented Apr 7, 2019

@jolheiser I think a note about this could be added to #6524

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type/question Issue needs no code to be fixed, only a description on how to fix it yourself.
Projects
None yet
Development

No branches or pull requests

4 participants