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

Installer fails to create directory when using docker #1221

Closed
5 tasks
evilstiefel opened this issue Mar 11, 2017 · 7 comments
Closed
5 tasks

Installer fails to create directory when using docker #1221

evilstiefel opened this issue Mar 11, 2017 · 7 comments
Labels

Comments

@evilstiefel
Copy link

  • Gitea version (or commit ref): 1.1.0+3-gfac75b80
  • Git version: 2.8.3
  • Operating system: Linux Xubuntu 4.4.0-66-generic Replace all GOGS_* variables  #87-Ubuntu
  • Database (use [x]):
    • [x ] PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • [x ] No
    • Not relevant
  • Log gist:

Description

When using the docker image, the folder /data is owned by root (if using regular containers). Installing gitea now enables you to choose a folder for lfs, but if you input something like /data/lfs, the installation will fail with the following:

invalid_lfs_path%!(EXTRA *os.PathError=mkdir /data/lfs: permission denied)

Choosing one of the pre-existing directories and adding a subdirectory is fine (like /data/git/lfs), but it is unclear if that is advisable. Since the installer doesn't run as root, it can't create directories under /data. Maybe this can be fixed or clarified?

To solve this problem locally, I used created the directory /data/lfs and chown'd it to the user git manually and ran the installation.

Screenshots

Screenshot of the installer error

@lunny
Copy link
Member

lunny commented Mar 11, 2017

You can specify any directory git has permissions.

@lunny lunny added the type/question Issue needs no code to be fixed, only a description on how to fix it yourself. label Mar 11, 2017
@evilstiefel
Copy link
Author

Sure, but the user doesn't know that /data isn't owned by git in a docker-environment and it might be inappropriate to just add another subfolder to /data/git oder /data/gitea.

@ghost
Copy link

ghost commented May 16, 2017

Why isn't there just an LFS directory by default? Enabling LFS doesn't do anything for people who don't use it, and it would no longer require the user to change this setting and possibly create a directory just to enable it.

@sapk
Copy link
Member

sapk commented May 16, 2017

This could maybe fix simply fixed by adding "/data/lfs" to https://github.com/go-gitea/gitea/blob/master/docker/usr/bin/entrypoint#L3 and https://github.com/go-gitea/gitea/blob/master/docker/etc/s6/gitea/setup#L18 ? I can't test it right now but this should work.

@ghost
Copy link

ghost commented May 16, 2017

@sapk sounds like a splendid idea! However, the startup wizard should also be changed to have "/data/lfs" as a default path instead of an empty text field as of right now. Then people could simply launch with default settings and LFS would work out-of-the-box

@lunny lunny added type/bug and removed type/question Issue needs no code to be fixed, only a description on how to fix it yourself. labels May 17, 2017
@lunny lunny added this to the 1.x.x milestone May 17, 2017
@lunny
Copy link
Member

lunny commented Dec 12, 2017

This seems be fixed some time and please feel free to reopen it.

@lunny lunny closed this as completed Dec 12, 2017
@lunny lunny removed this from the 1.x.x milestone Dec 12, 2017
@m-a-v
Copy link

m-a-v commented Feb 2, 2019

@lunny It doesn't work with version v1.7.1. I think the solution from @sapk and @Jonast would be the best. In my point of view it makes sense to put lfs in a separate directory (/data/lfs).

@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
Projects
None yet
Development

No branches or pull requests

4 participants