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

EACCES: permission denied: ~/.local/share/nvim/org-roam.nvim/db at installation #36

Closed
SamuelLorrain opened this issue Apr 30, 2024 · 6 comments

Comments

@SamuelLorrain
Copy link

Hi !
First of all I wanted to thank you for this great piece of software.
For my usage it already does everything I need and its really cool to find
hidden gems like that !

Describe the bug

After the installation, I had this error message in vim :

EACCES: permission denied: ~/.local/share/nvim/org-roam.nvim/db

While doing some investigation, I saw that the folder created for the local db doesn't have execution permission for my user:

➜  ls -al ~/.local/share/nvim | grep org
drw-r--r--  2 me me 4096 Apr 30 19:26 org-roam.nvim

chmod u+x ~/.local/share/nvim/org-roam.nvim solved the problem in my case.

To Reproduce

  1. Delete ~/.local/share/nvim/org-roam.nvim folder and his content
  2. Open nvim with the plugin installed

Expected behavior

The error message should not be present, and nvim should be able to access db file in org-roam.nvim folder.

Environment

  • OS: Linux (6.8.7-arch1-2)
  • commit : 8f3c541

Additional context

I must also note that when trying to install the plugin on a Mac M1 on Sonoma (Mac OS 14.4) I had this problem plus another one.

The org-roam.nvim folder also had an extended attribute com.provenance.apple in addition to not have the execution flag.
I solved the problem using this conversation : apple.stackexchange

Thanks again !

@chipsenkbeil
Copy link
Owner

chipsenkbeil commented Apr 30, 2024

Hey, thanks for the bug report! Seems similar to the challenges tied to #30 for @KortanZ on Windows.

While doing some investigation, I saw that the folder created for the local db doesn't have execution permission for my user:

I'm surprised, why does the file or folder need execution permissions? The folder is only leveraged for reading and writing to the db file, which is a cache used by the plugin. The permissions you see are intentional as we set them that way since that's the default permissions I've seen. Although now looking at creating a new folder on Mac, it seems like it uses rwxr-xr-x, so maybe this needs to be changed.

I must also note that when trying to install the plugin on a Mac M1 on Sonoma (Mac OS 14.4) I had this problem plus another one.

The org-roam.nvim folder also had an extended attribute com.provenance.apple in addition to not have the execution flag.
I solved the problem using this conversation : apple.stackexchange

This is also puzzling to me. I've used an M1 Mac Mini, M1 Macbook Air, and M1 Macbook Pro (Mac OS 14.4.1) and not hit this issue.

What version of neovim are you using? The provenance attribute isn't on any of your existing folders when the org-roam.nvim folder gets created, right?

@SamuelLorrain
Copy link
Author

SamuelLorrain commented Apr 30, 2024

I'm surprised, why does the file or folder need execution permissions?

It's kinda weird indeed. From my understanding x permission for directories means that one can list/search the directory.

The chmod man page state that:

The letters rwxXst select file mode bits for the affected users: read (r), write (w), execute (or search for directories) (x) ...

But it's not clear if its mandatory to access files within the directory though, after a quick test, I guess it is. Or at least, it's easier.

What version of neovim are you using? The provenance attribute isn't on any of your existing folders when the org-roam.nvim folder gets created, right?

So I just tested on the mac, and it seem that the com.provenance.apple is here again, but it doesn't cause any problem.
I tried to reproduce the problem (by deleting the folder and opening nvim again),
and I can actually add the u+x without touching to the extended attribute.

In the same folder, the telescope_history file has this flag without causing any issue.
Sorry for my misunderstanding for this

I'm on NeoVim 0.9.5 on both computers

@chipsenkbeil
Copy link
Owner

Cool, thanks for testing further! I'll update the default permissions we use for folder creation to include the execute permissions, and let you know here when it's rolled out. Sometime today.

@chipsenkbeil
Copy link
Owner

@SamuelLorrain I just pushed 7129a9d to see if the issue was on the directory permissions (set to 0o644 instead of 0o755) and not the file itself. I'm still not hitting these issues, and removed the org-roam.nvim directory and let the plugin recreate it.

Would you mind testing to see if it was the folder permissions that were the issue and not the file itself?

@SamuelLorrain
Copy link
Author

Ok I just tested to reproduce with the last commit and it's working now.

I no longer have the EACCES error even after deleting the org-roam.nvim folder, so it seem that it was the folder permission indeed.

Thanks !

@chipsenkbeil
Copy link
Owner

Great! Closing out the issue 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants