-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Safe save fails way too often #40366
Comments
@CenTdemeern1 Any chance you could give us a minimal project to reproduce this problem? It will help us fix the problem faster. |
Nope! This isn't project dependant or anything. |
That's why I put N/A (Not applicable) in the reproduction project section. |
@CenTdemeern1 If you can only reproduce this on a single machine, then it is most likely related to the particular software configuration of the machine in question. Try disabling any and all antivirus programs and check again (Windows Defender can be disabled temporarily or permanently). |
I can definitely reproduce this on another machine! |
It's just that it doesn't depend on anything related to any specific project. |
Now that I think about it I've been experiencing some quite random crashes on Linux lately that seem to be related to this. I thought they were related to the LSP server, but this seems more reasonable. If I were to guess it's a buffer overflow or stack smash we are not catching. On Linux we don't build the engine with |
Oh! I just remembered. |
Hmm... looks like this issue is far more specific to Windows. I've been running Godot with the GCC canaries and I have not been able to reproduce a crash after all. |
I'm getting this without any antivirus other than windows security. I've tried turning off windows security too and still have this issue. If I restart godot I'm able to save the file but after a bit it will protest. I've not had this issue on my linux machine.
|
This stuff seems to be happening because the file is in use |
Here is a bit more on the issue:
Not sure, is it much of a help, but that's another way to trigger it, and I think its out of place for it to be raised in this case. |
This is a bug for sure. I'm going through the same problem. Every time this happens, I have to create a new project and port everything there, which slows down production a lot. It gets in the way too much! And also if you try to "save as" it doesn't allow overwriting. I'm using the latest stable version of Godot 3.4.2. Please check this as it is a bug that was present in previous versions. Look at this post is from 2020 and it hasn't been fixed yet. In my case my problem is not with the GDScript itself, but with saving an existing scene that I had to change, when creating a node or when I am going to change the scene I reported this error as well |
@mhilbrunner did some work to try to address this in #51430, but it's a neverending battle to find and fix all the Windows file access issues. |
So I use Linux (Arch) and this problem occurs when saving or overwriting the file or a simple scene, the strange thing is that even when I go to save as a new file or a new scene, the changes are not made. If I don't make a backup of the project directory ( cp dir_project dir_project.bak) I lose everything. Sometimes this bug occurs when I am simply going to create a new node. Or just change the scenario a bit. When the bug occurs I lose everything and have to resort to manual directory backup. From what I've seen it's a bug that was reported in Godot 2.0.2 and that still persists in 3.4.2. |
I believe it must be because some unwanted.lock file is created preventing simple saving or to another file... |
Godot doesn't create lock files of any kind, but it performs "safe" file saving which you can disable in the Editor Settings. If you disable it, you will no longer have the guarantee that files will be fully written by Godot (in the event of a crash or power failure). |
Yes, I am aware of this procedure and have already tested it. Even with safe save enabled or disabled, I have problems with some node changes, minimal changes to the scenario. As I said when the bug happens I have to resort to the backup folder that I have to create manually every time. It is a bug that I see occurring since the previous versions. I'm waiting for the bug fixes with each update but the bug remains, it's the first time I report this, because I'm tired of having to keep restoring the old directory and losing all my progress. As I said, I find it strange not to allow or save as a new scene, when the bug persists, it simply doesn't save anything, it doesn't overwrite, in short, it becomes unusable. This is very complicated! |
restart windows solve |
This happens to me occiasionally on Windows 11 with v4.1.2.stable.mono.official [399c9dc]. Disabling "safe save" (Editor Settings -> FileSystem -> On Save -> Safe Save on Backup then Rename) doesn't prevent it happening. I'm also not using any antivirus (beyond what's present in Windows 11 by default). Rarely I get the following errors opening in a "Load Errors" prompt window which doesn't let me copy them, but it lists 4 times the same error (at least they all begin with a red dot, usually signifying errors):
After closing this window I can continue editing and running my project. |
I've had the same issue on Windows 11. What worked for me was
Not sure why though Edit: It came back... Edit2: I saw that there was quite a big size difference (1GB) of the old and new %appdata%/Godot Edit3: Does this image maybe help someone tracking down the issue? its WinMerge compare of the old and new %appdata%/Godot |
Godot v4.1.2.stable - Windows 10.0.19045 - Vulkan (Compatibility) - GeForce 9400 GT () - Intel(R) Pentium(R) CPU G4400 @ 3.30GHz (2 Threads) I have the same problem in 4.1.2 |
I think I have same issue. I started with Godot 4.1.1, I think, and when I updated to 4.1.2
And in output console it says: Safe save failed. Bla-bla-bla. |
If my theory is correct it has nothing to do with antivirus, but ownership of the files/directories inside %appdata%/Godot. This is how I think it happend:
In a lot of other software there is the update-button that solves this issue, but in game engines we want to be able to have several versions. Thus Epic and Unity has their Launcher and Hub that is suppose to solve these kind of problems. Because Godot don't have a official engine version manager maybe it would be smart to maybe separate the different appdata directories between versions? Ex: |
You can easily check ownership of the folder. And it's regular permissions. I'm also pretty sure it have nothing to do with antivirus. It can't write some text file, with same name (except extension) as png picture thumbnail that contain screenshot of viewport. At least in my case. |
Which process creates the folder doesn't matter, as long as there is only one process at a time accessing a file for writing. |
And nothing but Godot itself can lock same file every time this happen. No way it's something else. And it can't be Windows Defender. I put Godot Temp Folder in to exclusions. |
I noticed that when my editor setting export/android/android_sdk_path="" is assigned a path, launching the project results in the error 'Safe Save Failed.' However, when the path is empty, the error disappears. |
No wonder this error started happening at the same time i started trying to export for android, clearing the SDK path fixed it! |
For those who have an Android SDK path set in the Editor Settings, does this only occur in projects that have an Android export preset configured? Does it still occur if you disable Runnable on all Android export presets and reload the editor? Edit: It seems adb always starts even if it's not needed: #85246 |
Godot v 4.2 |
Couldn't find any potential dupes.
Godot version:
3.2.1.stable
3.2.2.stable
These two versions of Godot are the only ones I've ever used, and it happens on both of them.
OS/device including version:
Microsoft Windows NT Version 10.0.18363.900 running on an Intel Core i3 and integrated graphics,
This is not a visual problem.
Issue description:
I keep experiencing a certain issue, and I'm getting sick of it.
It happens sometimes when I do one or more of these things:
The issue I'm experiencing is this:
ERROR: Safe save failed. This may be a permissions problem, but also may happen because you are running a paranoid antivirus. If this is the case, please switch to Windows Defender or disable the 'safe save' option in editor settings. This makes it work, but increases the risk of file corruption in a crash.
Firstly, no, Switching to Windows Defender doesn't solve the issue.
Secondly, my antivirus isn't picking up Godot.
And lastly, disabling safe save doesn't help.
What I think the issue is is that it's trying to write to a file that's in use.
Steps to reproduce:
I think you have the best chance at getting this when saving a change to scene X while it's using scene X.
Minimal reproduction project:
N/A
The text was updated successfully, but these errors were encountered: