godot: Godot is randomly unable to write to config files and file cache

Godot 3.0 beta 1 and master and 2.1.4 Windows 10 64 bits

Every so often, under pretty random occasions, I see error messages in which I see Godot is unable to write to some config file or file cache, things like Unable to write to file <path>, file in use, locked or lacking permissions.

Example here, I got this one 1 second after opening a scene: image

Another one with file cache, when I use Ctrl+S: image

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 2
  • Comments: 72 (47 by maintainers)

Commits related to this issue

Most upvoted comments

Just to update, when I temporary disabled avast anti virus, the error stopped. When I re-enabled it occurred again. My folder exclusion didn’t seem to be enough to stop the file error.

It seems the 100ms wait and retry fixed it. It happened to me a lot when having GitAhead running in the background(I think it’s locking new files for a moment) and sometimes when saving a script or scene while the project was running. I cloudn’t trigger the error after trying for about 20 minutes using build 702e28f2657b3b0f50c1e118caf207c0a438f8f1

Will definitely not do a crappy workaround because of an antivirus.

I’m pretty sure there is a bug to fix somewhere, not a workaround, because Godot didnt do that before and I never saw any other software have this problem on Windows (antivirus or not).

@mhilbrunner I’ve been using godot from master for 2 hours and the error hasn’t appeared. So it is fixed, I think.

@ArdaE No, I don’t have Avast or any other antivirus installed, other than the default Windows Defender. As @OvermindDL1 points out, probably Windows Defender is what causes the error. I saw the 100ms retrial, and maybe what’s happening is that it fails at first, shows the error, then it tries again, and finally saves successfully. However, in this case, the pop-up should not appear. It should only appear when, after retrying, it still does not save.

On windows there is a tiny nice feature that microsoft (❤️) cooked us, it blocks certain files coming from other computers without advertising you. You just need to unblock the file like this:

image (right click -> properties, on file)

@profan Yup seems like a typo, should be fixed. Want to submit a PR? 😃

Should we reopen this and move to 3.1 for discussing the changes suggested by @ArdaE above, or use one of the other issues (https://github.com/godotengine/godot/issues/16274, https://github.com/godotengine/godot/issues/6393)?

Recently ran into this as well, using a laptop I loaned from a colleague - I think it was the installed antivirus, but still, having Godot lock up for a few seconds if the files are not writable becomes annoying really quick.

String is Unicode already, and c_str() returns a wchar_t*, so I don’t see what’s the issue there.