Skip to content
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

Reindexing error permission denied #4600

Closed
AugustHell opened this issue Jan 16, 2020 · 5 comments · Fixed by #4766
Closed

Reindexing error permission denied #4600

AugustHell opened this issue Jan 16, 2020 · 5 comments · Fixed by #4766
Assignees
Labels
area/indexes Related to indexes (indices) and their usage. kind/bug Something is broken. status/accepted We accept to investigate/work on it.

Comments

@AugustHell
Copy link

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:<group_id:1 start_ts:340040 schema:<predicate:"[...]" value_type:UID directive:REVERSE list:true >

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.

@AugustHell
Copy link
Author

Looks like that this problem was introduced by #4440

@mangalaman93
Copy link
Contributor

mangalaman93 commented Jan 16, 2020

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

@AugustHell
Copy link
Author

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!

@mangalaman93
Copy link
Contributor

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

@mangalaman93 mangalaman93 self-assigned this Jan 16, 2020
@mangalaman93 mangalaman93 reopened this Jan 28, 2020
@mangalaman93
Copy link
Contributor

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

@sleto-it sleto-it added status/accepted We accept to investigate/work on it. area/indexes Related to indexes (indices) and their usage. kind/bug Something is broken. labels Jan 31, 2020
mangalaman93 added a commit that referenced this issue Feb 13, 2020
Fixes #4600
While running dgraph as systemd service, we may not have permissions
to create a folder in the current directory. Now, we instead use /tmp
dir to store the temporary index solving the permission denied error.
mangalaman93 added a commit that referenced this issue Feb 17, 2020
Fixes #4600
While running dgraph as systemd service, we may not have permissions
to create a folder in the current directory. Now, we instead use /tmp
dir to store the temporary index solving the permission denied error.
mangalaman93 added a commit that referenced this issue Feb 17, 2020
Fixes #4600
While running dgraph as systemd service, we may not have permissions
to create a folder in the current directory. Now, we instead use /tmp
dir to store the temporary index solving the permission denied error.
ashish-goswami pushed a commit that referenced this issue Jun 25, 2020
Fixes #4600
While running dgraph as systemd service, we may not have permissions
to create a folder in the current directory. Now, we instead use /tmp
dir to store the temporary index solving the permission denied error.

(cherry picked from commit 8bf9046)
ashish-goswami added a commit that referenced this issue Jul 9, 2020
Fixes #4600
While running dgraph as systemd service, we may not have permissions
to create a folder in the current directory. Now, we instead use /tmp
dir to store the temporary index solving the permission denied error.

(cherry picked from commit 8bf9046)

Co-authored-by: Aman Mangal <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/indexes Related to indexes (indices) and their usage. kind/bug Something is broken. status/accepted We accept to investigate/work on it.
Development

Successfully merging a pull request may close this issue.

3 participants