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

Sporadic .tmp files are left in the project source (Windows) #82270

Open
voithos opened this issue Sep 24, 2023 · 15 comments
Open

Sporadic .tmp files are left in the project source (Windows) #82270

voithos opened this issue Sep 24, 2023 · 15 comments

Comments

@voithos
Copy link
Contributor

voithos commented Sep 24, 2023

Godot version

4.1.1.stable

System information

Godot v4.1.1.stable - Windows 10.0.22621 - Vulkan (Forward+) - dedicated NVIDIA GeForce RTX 4090 (NVIDIA; 31.0.15.2849) - 13th Gen Intel(R) Core(TM) i9-13900K (32 Threads)

Issue description

I noticed today a rogue .tmp file present in the source tree that I didn't recognize:

$ git status
?? scenes/sandbox/sanEC90.tmp

It appears to be a backup / temp file for one of the .tscn files. From some quick searches, it seems a similar issue happened in the past for Windows (#956), and indeed I'm developing on Windows. Also, I noticed a reddit post about this issue not too long ago (https://www.reddit.com/r/godot/comments/16akyka/what_are_all_these_tmp_files_alongside_my_main/), so it seems likely that an issue has resurfaced.

I've never packaged my project, just normal usage and edit / play. At times when the GDScript type checking seems to get confused, I will reload the project from the Project menu.

Steps to reproduce

It seems pretty random/sporadic, so I haven't been able to reproduce it consistently (and in fact have only seen a single instance of such files). Just wanted to open a tracking bug since it seems others are running into it as well.

Minimal reproduction project

N/A

@bitsawer
Copy link
Member

Those file names do look like Godot editor temp files on Windows. There have been a few tweaks to the Windows temp file handling in #81001, should be in Godot 4.2. Still, in case you have something like an aggressive anti-virus blocking file access while it's doing scanning, it might not be enough.

Meanwhile, if the files get too annoying, you can disable this in Editor -> Editor Settings -> FileSystem -> Safe Save on Backup then Rename.

@voithos
Copy link
Contributor Author

voithos commented Sep 25, 2023

Good to know, I'll keep an eye out for it after 4.2 stable.

For now it doesn't bother me too much, so I've just added a line in my .gitignore to ignore *.tmp files.

@AThousandShips
Copy link
Member

I cannot replicate this on 4.2, so does seem to be solved, if someone else can verify

@levidavidmurray
Copy link

@AThousandShips This has been happening pretty sporadically for me in 4.2.rc1—specifically with GDExtensions. I originally opened an issue in the godot-jolt repo: godot-jolt/godot-jolt#690

*.TMP files are being created for the extension DLL that aren't getting cleaned up. I'm unsure how to reproduce the *.TMP files persisting, but you can see them here:

Recording.2023-11-23.185006.mp4

@DmitriySalnikov
Copy link
Contributor

I'm unsure how to reproduce the *.TMP files persisting, but you can see them here:

You can just open two editors for one project that uses GDExtension.
Also, the opening of several editors breaks the registration of singletons.

@318h7
Copy link

318h7 commented Dec 27, 2023

I’m getting this on windows with version 4.2.1-stable
when adding nodes to tree from code, It looks like it stores the node information and fails to clean it up.

So is it safe to add the *.tmp to .gitignore?

@Azengar
Copy link

Azengar commented Feb 5, 2024

Hi, same here, I get this on 4.2.1-stable using C#. For me it seems to appear when I use FileAccess, even if I correctly close & dispose of the FileAccess object after using it.

The pain point being that they are actively used by the editor and thus cannot be deleted.

@goshdarnheck
Copy link

goshdarnheck commented Feb 14, 2024

I've been able to consistently recreate this by clicking "run project" with a syntax error in a script, waiting for it to halt, and then updating and saving the script before stopping the game.

Saving fails with the error "Unable to write to file [path], file in use, locked or lacking permissions."

I'm guessing that a tmp file is created at this point and never removed when the save fails?

@Zshandi
Copy link
Contributor

Zshandi commented Feb 23, 2024

I am seeing these files show up randomly as well, in v4.2.stable.official [46dc277]. There were a bunch that ended up in my friend's PR, which is where I first noticed it, and then I just recently saw them myself as well:

image

I think I may have seen the same error as @goshdarnheck with the "Unable to write to file [...]" message. It's a bit annoying we have to add these to the .gitignore now. Though, I suppose it doesn't hurt to have them in there, even if this issue is fixed, in case some other issue occurs which cause these files to appear.

Zshandi added a commit to Zshandi/gitignore that referenced this issue Feb 23, 2024
These are temporary files Godot engine creates, which are supposed to be automatically removed, but there can be issues which prevent them from being removed.

Although these not being removed is an issue with the engine which may be fixed in the future, I think it would still be a good idea to add them here, in case a different issue occurs that causes them to not be removed.

Here is a current issue for this, but in searching I found that there have been other related issues in the past which caused .tmp files to show up. Thus, I think it's a good idea to just add them in here:

godotengine/godot#82270
@FoxyFox909
Copy link

I've been able to consistently recreate this by clicking "run project" with a syntax error in a script, waiting for it to halt, and then updating and saving the script before stopping the game.

Saving fails with the error "Unable to write to file [path], file in use, locked or lacking permissions."

I'm guessing that a tmp file is created at this point and never removed when the save fails?

I reproduced it once when trying to save a script while the debugger was running. Windows 10, Godot 4.3.dev5.

@hjk321
Copy link

hjk321 commented Apr 13, 2024

Same here. I can reproduce this issue by editing and attempting to save a script while the game is running.

@AndreasHassing
Copy link

Used the following PowerShell script to remove existing .tmp-files and include the ignore in .gitignore:

Get-ChildItem -Recurse *.tmp | Remove-Item; "`n# Godot tmp files (https://github.com/godotengine/godot/issues/82270)`n*.tmp" >> .\.gitignore

@gmikhail
Copy link

gmikhail commented Sep 9, 2024

I also get .tmp scene files in a new project created in the latest Godot version.

How to reproduce:

  1. Make a scene with a script which contains an error.
  2. Run (F5) the scene and get an error with Stack Trace.
  3. Without closing the game in the Godot Editor fix the error in the script and press Ctrl+S.
  4. You will get a scene saving error and a temporary file next to the running scene.

2024-09-09 152530

2024-09-09 152655

Godot v4.3.stable - Windows 10.0.19045 - Vulkan (Forward+) - dedicated NVIDIA GeForce GTX 1060 with Max-Q Design (NVIDIA; 32.0.15.6094) - Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz (8 Threads)

@vasiliyaltunin
Copy link

I also have this problem with exact errors as gmikhail

niefia added a commit to niefia/Cogito that referenced this issue Sep 23, 2024
Noticed a temp file was added in a recent commit, and realised there was a few in the project.
So for Clean-up removed them and added .tmp file type to the .gitignore to prevent them being added in future

Seems to stem from a bug where the temp files are left: godotengine/godot#82270
@chrishessler
Copy link

Problem persists for me in v4.3.stable.official (Windows 11)

orangutanrider added a commit to orangutanrider/one_button_jam_2024 that referenced this issue Nov 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests