Skip to content

Failed to initialize issue indexer: mkdir data: permission denied in several situations #6959

Closed
@Frickeldave

Description

@Frickeldave
  • Gitea version (or commit ref): 1.7.2 & 1.8.0
  • Git version: 2.2.0
  • Operating system: Alpine 3.9 within Docker
  • Database (use [x]):
    • 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 created my own docker image, based on alpine 3.9. I use gitea 1.7.2 currently. The docker-host is a current CentOS.
I have the issue, that it is not possible to update something in a repo and to do merges with the webinterface (i think they belong together). When i try to do that, i get the following messages:

Edit something in the webinterface and commit:
UpdateLocalCopyBranch [branch: master]: git clone master: mkdir data: permission denied (Message appera in web ui)

Try to merge something within the webinterface
[…routers/repo/pull.go:589 MergePullRequest()] [E] Merge: Failed to create dir data/tmp/local-repo/merge-302991419.git: mkdir data: permission denied (Message appear in logfile)

The environment
In the docker image i created a user “appuser” with UID and GID 140000. The gitea binaries are stored in /home/appuser/app, the configuration files are stored in /home/appuser/data. Of course, the appuser has access to both directories. I have a startscript (start.sh) as entrypoint defined. In this startscript i set all needed variables:

_export USER=$(whoami)
export USERNAME=$(whoami)
export GITEA_CUSTOM=/home/appuser/data/custom
export GITEA_WORK_DIR=/home/appuser/data_

I start gitea with /home/appuser/app/gitea -c /home/appuser/data/gitea.ini within the start.sh script.

No i tried to update to gitea 1.8.0 before opening this ticket. Now the server isn't starting anymore within exact the same docker image. The output of the console is

/ $ /home/appuser/app/gitea -c /home/appuser/data/gitea.ini
2019/05/15 14:03:35 [T] AppPath: /home/appuser/app/gitea
2019/05/15 14:03:35 [T] AppWorkPath: /home/appuser/app
2019/05/15 14:03:35 [T] Custom path: /home/appuser/data/custom
2019/05/15 14:03:35 [T] Log path: /home/appuser/data/log
/ $

In the logfile i have the following message:
2019/05/15 14:03:35 [I] Log Mode: File(Debug)
2019/05/15 14:03:35 [I] XORM Log Mode: File(Debug)
2019/05/15 14:03:35 [I] Cache Service Enabled
2019/05/15 14:03:35 [I] Session Service Enabled
2019/05/15 14:03:35 [I] Mail Service Enabled
2019/05/15 14:03:35 [I] Beginning ORM engine initialization.
2019/05/15 14:03:35 [I] ORM engine initialization attempt #1/10...
2019/05/15 14:03:35 [I] ORM engine initialization successful!
2019/05/15 14:03:35 [I] Git Version: 2.20.1
2019/05/15 14:03:35 [...itea/routers/init.go:95 GlobalInit()] [E] Failed to initialize issue indexer: mkdir data: permission denied

In gitea.ini the "APP" and "ROOT" pathes are specified as followed:

STATIC_ROOT_PATH = /home/appuser/app
APP_DATA_PATH = /home/appuser/data

From my point of view the cause of these issues is the same.
I also found issues #4672 and #6398 which are probably related, bot are closed and reference to #6367 which is a complete other topic (from my point of view, possibly i am wrong).

Would be cool to get help here...

Thanks in advance

Dave

Metadata

Metadata

Assignees

No one assigned

    Labels

    issue/needs-feedbackFor bugs, we need more details. For features, the feature must be described in more detail

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions