"Failed to save file ... permission denied, open" error and potential fix

Hey everyone. Just thought I would share a potential fix to a problem I was having.

ERROR INFORMATION
Basically the problem was that occasionally when I was working on a note, the following error would come up:

Failed to save file “FILE_NAME.md”. EACCES: permission denied, open
‘PATH_TO_FILE/FILE_NAME.md’. Make a backup of the contents of this file now to avoid losing data.

Suffice to say, it was driving me round the bend because there wasn’t an obvious reason why, and it started happening out of the blue.

SOLUTION
Because it was saying permission was denied, I got the file permissions for the file in question, and saw that it was missing a few. I can’t remember exactly (and the issue hasn’t come up again since!), but I believe it was either:

-rw-r----- OR -rw-------

I compared this to the files that were working fine (saving when I told them to and not throwing an error) and they had the following permission:

-rw-r--r--

Which (for those not acquainted in this notation) means the owner (me) has read+write permissions, the group has read permissions, and everyone else has read permissions.

So, after changing the file in question to -rw-r--r-- the problem went away. By the way I changed it in terminal with:
chmod 644 "FILE_NAME.md"

This resulted in the following being added to the permissions:

Anyway, that’s how I got around the problem. Not entirely sure what caused it. People who are much more experienced at this, please feel free to let me know if I’ve made a mistake in my explanation.

By the way my setup is as follows:

  • Macbook running Sonoma 14.3.1
  • Obsidian Version 1.5.8 (Installer 1.5.3)
  • Community plugins: Copilot (2.4.17), Pandoc Plugin (0.4.1), Pandoc Reference List (2.0.25) and Zotero Integration (3.1.7)
  • Obsidian folder stored in cloud storage
1 Like

Hi everyone, I had this error come up again today so I had a chance to clarify some of the bits I was unsure about above.

So the permissions that were causing the issue were in fact:
-r--------@ Screenshot → Screenshot 2024-03-15 at 11.28.11 am

And after doing my chmod 644 I added the staff credential with read-only permissions. So the final permission for the file was -rw-r--r--@.

As before, not sure what caused the error, was just working away on a file and it started to happen.

1 Like