go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
44.22k stars 5.42k forks source link

CreateIssuesIndexer: mkdir indexers: permission denied #1378

Closed NuLL3rr0r closed 6 years ago

NuLL3rr0r commented 7 years ago

Description

I updated two of my productions Gitea servers from v1.0.1 to v1.1.0 through FreeBSD ports and now Gitea service refuses to start with the following line in the logs:

2017/03/23 14:47:43 [...els/issue_indexer.go:77 InitIssueIndexer()] [E] CreateIssuesIndexer: mkdir indexers: permission denied

The error is very ambiguous and hard to understand. So, now both servers are simply out of production due to this error or whatever caused it.

cez81 commented 7 years ago

Have you got an indexers directory in the same directory as gitea? If yes, what permissions? If no, try creating it.

psolyca commented 7 years ago

I have the same issue and I have to delete them each time I update Gitea even of they have the right permissions.

I am using mysql and a compiled version (ae9b02b0).

lunny commented 7 years ago

@psolyca maybe the Gitea direcotry is not owned by user git.

psolyca commented 7 years ago

I am using Arch Linux version https://aur.archlinux.org/packages/gitea-git/ Which is installed, ran with gitea user and group. Everything is homogeneous with gitea user. I will try with git user.

@NuLL3rr0r do you use git user or an other one ?

NuLL3rr0r commented 7 years ago

@cez81 thank you for the suggestion. I do not have access to the server at the moment but I'll check and report back.

@psolyca if I recall correctly it was git user. I'll check on that too and report back.

NuLL3rr0r commented 7 years ago

@cez81 I have /var/db/gitea/data as APP_DATA_PATH and there is no indexers directory inside /var/db/gitea.

@psolyca The user and the group are git.

cez81 commented 7 years ago

@NuLL3rr0r I don't think indexers uses APP_DATA_PATH. Try setting something like this instead in your app.ini

[indexer]
ISSUE_INDEXER_PATH = /var/db/gitea/data/indexers/issues.bleve
psolyca commented 7 years ago

I reinstall the same recompiled version with git user and group (without removing old version). So everything has changed to git user and I do not have the issue anymore. I tried with reinstalling the same version with gitea user and group and I have also no issue.

Does the indexers files and folder follow a version of gitea ? I will try with an other version to see if the issue come back.

NuLL3rr0r commented 7 years ago

@cez81 Thank you so much!

That solved the issue for me.

fbettag commented 7 years ago

worked here too! thanks

bkcsoft commented 7 years ago

@NuLL3rr0r So, is this issue resolved? Do we need better documentation on this? Better defaults? :)

cez81 commented 7 years ago

Maybe move indexers into the data directory? Or is there a reason why it isn't in there?

NuLL3rr0r commented 7 years ago

@bkcsoft

Well, it solved the issue for me and it seems for others, too. But, I believe @cez81 is right; why it isn't there by default? In addition to the documentation, it would be a good idea to add that option to the sample config file.

Thanks!

lunny commented 7 years ago

Maybe @ethantkoenig could give us his consideration when he sent that PR.

ethantkoenig commented 7 years ago

I admittedly didn't put a lot of thought into the default ISSUE_INDEXER_PATH value. If anyone thinks it would make sense to change it, I'm open to suggestions.

lunny commented 7 years ago

Maybe ISSUE_INDEXER_PATH = /var/db/gitea/data/indexers/issues.bleve should be added to config cheetsheet and change the default value to gitea/data.

jerrykan commented 6 years ago

I just got hit by this issue trying to migrate from gogs v0.9.141 to gitea v1.2.0

If the default value is ISSUE_INDEXER_PATH = indexers/issues.bleve what is the indexers/issues.bleve path relative to? the data directory? the current working directory?

Does the app.ini config support variable interpolation like ISSUE_INDEXER_PATH = %{APP_DATA_PATH}/indexers/issues.bleve? or is it worth adding support so that these relative paths can be a bit more explicit?

cez81 commented 6 years ago

Relative to the binary.

It does.

https://github.com/go-gitea/gitea/pull/2192 should move indexers directory to APP_DATA_PATH.

lafriks commented 6 years ago

Path is no relative to data directory. Fixed by #2192