Dgraph: Reindexing error permission denied

Created on 16 Jan 2020  路  5Comments  路  Source: dgraph-io/dgraph

What version of Dgraph are you using?

v.1.1.1-217-g1a0f2c99

Have you tried reproducing the issue with the latest release?

The version was build from source 3 days ago

What is the hardware spec (RAM, OS)?

OS: debian buster
GO: 1.13

Steps to reproduce the issue (command/config used to run Dgraph).

Installed dgraph, build a db, tried to alter an index of a schema via dgo or ratel.

Expected behaviour and actual result.

Expected: schema gets reindexed
Reported Error:
draft.go:470] Applying proposal. Error: error creating in temp dir for reindexing: mkdir dgraph_index: permission denied. Proposal: "mutations:

dgraph runs as a linux user with all rights for the data directories and execution of dgraph.
Tried to use to run with "cwd" for all zero and alpha for the directory where p, w, zw are located and which also has the user rights to, but that didn't help.
Creating a directory in the roots /tmp is no problem for the user.
So I can't figure out, where dgraph wants to create this dir "dgraph_index", in prior versions I never had this problem.

areindexes kinbug statuaccepted

All 5 comments

Looks like that this problem was introduced by #4440

@AugustHell we try to create a directory in the same folder where dgraph is running. This directory is used to store the data temporarily while the index is getting built. Could you tell me what is the cwd for the dgraph alpha process?

That was a good hint, pwdx showed / for the working directory.
Added
WorkingDirectory=... // dir where the dgraphs p, w, zw exists
to the dgraph.service file for systemctl and it works now.

Might be an idea to check if the -cwd flag was used (I tried that with a config file).

Thanks for the quick help!

That makes sense. Let me see whether we want to do something about it. Thanks for reporting the issue.

We have received multiple reports from users where they have observed this issue. We should consider using a directory such as /tmp instead.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jeffkhull picture jeffkhull  路  3Comments

xhochipe picture xhochipe  路  3Comments

andrewsmedina picture andrewsmedina  路  4Comments

marvin-hansen picture marvin-hansen  路  4Comments

yupengfei picture yupengfei  路  4Comments