Gitea: CreateIssuesIndexer: mkdir indexers: permission denied

Created on 23 Mar 2017  路  19Comments  路  Source: go-gitea/gitea

  • Gitea version (or commit ref): 1.1.0
  • Git version: 2.11.1
  • Operating system: FreeBSD 11.0-RELEASE-p8 (or) FreeBSD 10.3-RELEASE-p17
  • Database (use [x]):

    • [X ] PostgreSQL

    • [ ] MySQL

    • [ ] MSSQL

    • [ ] SQLite

  • Can you reproduce the bug at https://try.gitea.io:

    • [ ] Yes (provide example URL)

    • [ ] No

    • [X ] Not relevant

  • Log gist:
2017/03/23 14:47:42 [I] Log Mode: File(Info)
2017/03/23 14:47:42 [I] XORM Log Mode: File(Info)
2017/03/23 14:47:42 [I] Cache Service Enabled
2017/03/23 14:47:42 [I] Session Service Enabled
2017/03/23 14:47:42 [I] Mail Service Enabled
2017/03/23 14:47:42 [I] Notify Mail Service Enabled
2017/03/23 14:47:43 [I] Git Version: 2.11.1
2017/03/23 14:47:43 [...els/issue_indexer.go:77 InitIssueIndexer()] [E] CreateIssuesIndexer: mkdir indexers: permission denied

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.

kinquestion

Most helpful comment

@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

All 19 comments

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

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).

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

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 ?

@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.

@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.

@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

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.

@cez81 Thank you so much!

That solved the issue for me.

worked here too! thanks

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

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

@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!

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

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.

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.

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?

Relative to the binary.

It does.

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

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

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Fastidious picture Fastidious  路  3Comments

ghost picture ghost  路  3Comments

haytona picture haytona  路  3Comments

tuxfanou picture tuxfanou  路  3Comments

kifirkin picture kifirkin  路  3Comments