-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Failed to initialize issue indexer: mkdir data: permission denied in several situations #6959
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
Comments
Merge pull request should be a known issue. |
But as described before, it's not only an issue with pull requests, also with editing in web and with version 1.8.0 during startup... |
@Frickeldave I think you should check your filesystem permission since the log said |
Hi, that was the first thing i have done. But i think the permissions are not the problem. The path /home/appuser/app and /home/appuser/data is fully writable for the user. drwxr-sr-x 1 appuser appuser 26 May 17 06:58 . Is it possile, that gitea tries to write to another path? Regards Dave |
Hi, any ideas regarding that issue? Any more feedback needed? Regards Dave |
The issue indexer path is determined here: gitea/modules/setting/indexer.go Line 45 in 6eb53ac
AppDataPath is determined here: gitea/modules/setting/setting.go Line 615 in 6eb53ac
And AppWorkPath is either:
In 1.9 you will be able to set this using the --work-dir option. Looking at the information you've provided it looks like you need to set GITEA_WORK_DIR=/home/appuser/data I suggest you shadow Gitea with a script that sets these for you. |
Hi, thank you very much. I already have a wrapper script. In my inital post this is already described: I have a startscript (start.sh) as entrypoint defined. In this startscript i set all needed variables: _ I start gitea with /home/appuser/app/gitea -c /home/appuser/data/gitea.ini within the start.sh script. Regards Dave |
I don't think your Gitea work dir export is working properly |
There's another place things get written to (!) $HOME/gitea-repositories but I can't remember off the top of my head which config that corresponds to. |
Possibly. Here is a print from my console output: _ / $ echo $GITEA_WORK_DIR 2019/05/22 12:23:36 [I] Log Mode: File(Info) As you can see, in the current console session, GITEA_WORK_DIR is set properly. Any other thing i can check? Attached you will find my gitea.ini file. Regards Dave |
It looks like you've just copied the whole of app.ini.sample as your app.ini... That's unnecessary and a very good way of ending up over-configuring things and perhaps even breaking things. You should only copy what you need. For example, the log section is not meant to copied over exactly the way you have done - did you read it? I'm also concerned that you say you're using 1.7.2 (or maybe 1.8.0) but that app.ini.sample is the 1.9 sample. (You're definitely not running 1.9 I can tell from the logging.) I would seriously recommend paring down your app.ini so that it represents what you need to configure and only what you need to configure. Further are you telling me that you're ending up with different configuration between starting gitea on the console and starting it through your start.sh script? If so the problem lies in your start.sh script. Is it possible that your options are being overridden somewhere else? On the admin pages of gitea you should be able to check where it thinks it is looking for things. In particular it will say if GITEA_WORK_DIR is set and/or GITEA_CUSTOM. You really should also upgrade your Gitea to at least 1.8.1. |
Thank you very much for the time you invest. |
Fixed the error regarding the failed start of gitea 1.8.0. The default value for ISSUE_INDEXER_PATH and ISSUE_INDEXER_QUEUE_DIR are set to "indexers/issue.bleve / indexers/issue.queue". This works in 1.7.2 but not in 1.8.0. I changed the pathes to an absolute path (/home/appuser/data/indexers/.... )and now the server starts. At next i will try to find out why its not possible to edit files within web editor or do merges within web editor. |
WIth the previous describes change also the web-based editor as well as pull requests are working now. Closing ticket. |
[x]
):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:
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
The text was updated successfully, but these errors were encountered: