-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Scene corruption after forced reboot on Linux #85907
Comments
That Do you still get this issue after restarting the editor? What about if you rename the |
I just had the same problem and removing the .godot folder made the scene work again. I kept the old .godot folder and the differences on the .tscn file are: Old one:
new one:
Hope this helps. |
@MartinVacheron This specific difference is probably not the one that caused the issue. Is there no other difference? Files like If you're able to share those two folders for us to compare, that could be quite useful. |
Yes no problem for the folders, here they are. The first one is the one not working. |
Here is the live video though I think the video will only be valid on Twitch for 7-60 days. Here are the key points:
@akien-mga I hope all the core contributors watch the ~35 minutes at 2x speed to see the level of frustration as a new Godot user hitting this kind of bug. If I recall I have some harsh words said in the stream along the lines of, "This literally makes me want to quit using Godot." |
I've had the same issue on the latest official from Steam (Windows). |
I had the exact same problem with version 4.2.1rc1 under Linux. What is weird is that despite the fact that I'm unable to open the scene in the editor due to corrupted .tscn file, running the project works without error. To fix the corrupted scene(s), I simply removed the script references in the .tscn file(s) inside an external editor (2 lines), then reloaded Godot project, opened the scene(s) (which does not have an attached script anymore, so they open fine now) then reattached the corresponding script to the scene(s) via the editor. Saved the project. I then reloaded Godot current project to ensure all was correct and all was fine. I noticed the problem occurring with the same project once I upgraded my Godot version (from 4.2rc2 to 4.2 stable and from 4.2 stable to 4.2.1rc1. So it seems to occur each time the Godot engine is updated... Not sure about that though. PS: The produced error in the debugger is not helpful at all, as it only says that the scene is corrupted but not in which way. Had a hard time finding how to fix the scene file. EDIT: After more investigations, I found that from all the opened scenes in my project, the only ones that get corrupted are the ones containing preloaded PackedScenes as const / var in the attached script. For example, one had this line: |
Interesting, the scene that was corrupted on my side had a script with |
The script attached to my corrupted scene doesn't have PackedScene as a variable but contains the line with |
reproduced this issue as well in my project (4.2 macos). after removing |
also reproduced on v4.2.1.stable.official [b09f793] macos |
encountering the same issue on the steam windows v4.2.1.stable.official[b09f793] build for my own project :s
can second this; the only thing that is preloaded in my project is the only scene thats corrupting |
thanks to @isaaccp I just found this issue here, I created almost the same issue #86154 I debugged this as much as I can. First some workarounds that helped with loading:
So, like just said, the underlying reason is that a script failed to parse during load of the scene and then the scene stays corrupted until you reload the project. One specific condition I found to cause this is using the preload statement. preload is followed through while parsing during opening the project. This will fail to parse if the preload in a chain leads back to the scene that's not yet instantiated because currently being loaded. There may be other conditions. The bad thing about this is that a user will think all their work is ruined even though there are some easy fixes to load the scenes again. What I already suggested in #86154 is to change the loading in the editor such that scripts are parsed after the scene has been instantiated. The necessary code edits are too far reaching that I don't yet dare creating a pull request, yet. |
I just had the same problem. I solve it by:
|
I had this issue caused by the "preload" method. |
Never mind. It didn't work when I opened the project today. Redo the steps above will fix the corruption temporarily until the IDE is closed. But add
|
Tested with dev snapshot 1 of 4.3 it still prints an error at load, but does fixes the corruption. |
In my case ... godot 4.2 on Mac renamed the script file attached to my scene from Asteroid.gd to asteroid.gd, after I changed the filename in the tscn it loaded. After a while it changed it back to uppercase. very strange... 2h of frustration because first time I redid the whole scene. And godot physics is so broken I had to use Jolt (good there is an extension)... Godot is disqualifying itself... ;-) |
I've also encountered this issue. One thing that helps every time is to open all related |
Also encountered this issue, it was very annoying to workaround. In the end though, a simple Project -> Reload Project was the best remedy. It seems like the scene gets corrupted in-memory, and even poking the I do have a few |
Been experiencing this on Windows, Godot 4.2.1, For the last week. Have re-created the scene many times but the issue comes back. The quoted post solved it for me, i.e. using explicit typing instead of inferred:
becomes this:
So my scene file is fine, there's something happening during the load of the scene. Haven't dared close Godot yet so don't know if it will work long term. Edit: Reopened Godot, the issue is back :( This is written in the error log:
|
Ran into the same issue. For me I was preloading the scene the script itself was attached to. |
It seems any change to the script and a save/restart "fixes" it, but it comes back after the next restart. The bug has been confirmed so lets hope for a swift resolution. |
bug's already fixed, 4.3 just needs to get to a stable release |
Also had this problem (4.2.1 Linux). Following goatt1167's comment made the scene openable again. It is worth to point out that I had an issue with circular references - the script in the corrupted scene (scene A) was preloading another scene (scene B), but the script in scene B was also preloading scene A. |
This occurred to me with circular references of attached scripts like thischris mentioned... Once you have one and exit the editor it seems you are prone to the error. To fix it, deleting my .godot folder did not help (all though that seems to help some people). My solve: I opened the .tscn file in an editor and deleted two lines (found them by searching for (ExtResource): Line 21: script = ExtResource("1_fxdw2") Keep in mind this removes the attached scripts from the scene. In the future I will try to avoid circular references with scripts and see if that helps. |
@MrTeacher-tech, if we are talking about circular reference, in theory you should be able to reopen the scene if you comment out the reference in the script file (editing it in an external editor). I haven't tested it. |
Just had this issue (or at least a very similar one—the script was referencing a custom class, not an preloaded) in my project. (using MacOS). I could recreate the steps that broke it, which may be helpful to fixing this bug. This was fine:
This corrupted the scene file:
Things that could be relevant (I don't know that much about the inner workings of Godot):
What this whole thing smells like to me is that Godot is trying to parse a script that references a resource before it knows that other resource exists? I suppose that is what circular reference means? I feel like there should be some sort of failsafe, if this is the case. EDIT: It's definitely a circular reference. I'm realizing now that the CustomClass script has a preloaded instance of the scene that the above script was in. |
Tested versions
v4.2.stable.official [46dc277]
System information
Ubuntu 22.04 - v4.2.stable.official [46dc277]
Issue description
Believe I did a
sudo reboot now
and was able to trigger a non-proper flushing of the file causing a corruptionBullet.tscn
Steps to reproduce
Probably have the script opened in a potentially unsaved state and force a reboot...
Minimal reproduction project (MRP)
N/A
The text was updated successfully, but these errors were encountered: