Unable to save file: Permission denied


#1

Hello to everyone

Yesterday, I was using Atom to finish a webpage in HTML and CSS. Today, I opened it again to modify some parts of the code, which is linked to github (I don’t know if it may help) and then I was surprised finding this message:

Unable to save file: Permission denied

I have tried everything, reinstaling Atom, deleting the cache memory, downloading again the repository… Nothing, and since it happened, I am unable to save not only those documents, but all the files and projects I open with it. I did not change any file or setting of atom before this happened.

I use Windows 10 as operating system.

Any idea? Thanks in advance

Fernando


Permission denied when saving files. Help me please¡
#2

What do the permissions look like on those files? If they somehow got made read-only, you probably need to reset that through a batch script or the Properties dialog.


#3

Yes, they are all in format read-only, I will try to fix it by means of a batch script and I will comment the results.


#4

There was no success. After trying new things, installing the beta version… All remains the same, it is imposible to save or change any file due to this Permission Denied problem.

Any idea?


#5

Not from me.


#6

Do you have the same issue with any repositories or just the one you’re working with? If you create a temporary directory and clone to that directory, do you see the same error?


#7

It happens suddenly with any repository I am working on, and when it occurs on the first one, it happens in any other file I open, no matters the type, format, etc
It happens in all archives when it happens once


#8

Hello,

I had the same problem and finally I found the permission denied was applied by my antivirus software. I am using Bitdefender and it has a function to protect certain files in the system. When you use Atom or other not recognized software to modify any file inside those protected folders the app is blocked.


#9

Interesting, thanks @rioujin :+1: Might be something to check @fernando2393 if you have anti-virus running?


#10

I had the same issue and found the solution was with bit defender. Check protected folders to see if the folder you are trying to save to is listed. If so, go to blocked applications and you should see atom is blocked, disable the block via the slider and enjoy.


#11

Ok so I just had the same problem.

Mine was most likely because the file was in a folder that’s saved in my dropbox. I right clicked on the folder and it was set to ‘read only’ I unchecked that box and everything worked! Hope this helps someone!


#12

** Actually not sure if it’s because of DrobBox or Carbonite - I have to go into the folder the file is in every time and uncheck the read-only box. Very much a pain… have to figure it out :frowning:


#13

I’m using Windows 10 with BitLocker and this issue is cropping up several times a day. It seems to be triggered around git interactions – for example, if I ask Atom to revert an unstaged change. In this case git shows the files as modified but with no diffs. Any attempt to delete or checkout the file from the command line fails with permission errors. When it triggers it seems to clobber every file I had open, or maybe it’s only files I had made changes to.

The only work around I’ve found is to close Atom, fix my working copy if there are any remaining issues, and then restart Atom. Usually at this point the modified files become deleted instead and I have to restore them with git.


#14

I’m also having this issue running atom in safe mode on Windows 10:

  • Create file in Windows e.g. text.txt (created in project folder with git already initialised)
  • Commit new file to git branch (dev)
  • Open atom --safe
  • Edit test.txt and save in atom
  • Commit change
  • Attempt to switch git branch (to master)

At this point the file breaks, all permissions are removed from the file and there is no file owner in Windows permissions. You cannot delete, modify the file or do anything in git.

I tried removing all plugins, disabling antivirus (Avaast Free) - I actually completely removed avast and restarted.

Issue seems to be pretty easy to reproduce, some sort of interaction between the atom core and git I presume. Has anyone else found a fix for this other than disabling antivirus?


#15

Some further information:
Atom : 1.26.1

I have an exception in windows firewall for Atom. I am using Windows as an Admin user.

I have tried the exact same procedure using notepad instead of atom to edit the file and can confirm there is no issue. This seems to rule out git as a culprit as well as the antivirus.


#16

Hey @conorot :wave:

Do you have the %USERPROFILE%\.atom\recovery folder? Can you try creating this if it doesn’t already exist and restart Atom.

This was the cause for similar problems that were fixed on master yesterday.


#17

Hey @Ben3eeE - wouldya look at that - it worked! Thanks for that.

I created an issue in the Git repository a few minutes ago by the way, seems this can probably be closed off:


#18

The issue for this is:

Which was closed with this PR:


#19

This is the solution! I was having the same problem when SourceTree and Atom interacted with each other. Not having the recovery folder created was the problem.

Thank you very much, @Ben3eeE.


#20

This worked for me too. I was going nuts trying to figure this problem out because I like Atom IDE & this one issue was stopping me from doing normal work with Git.

Thanks!