Godot crashes when node not found, and attempting to connect to a non existant signal
Tested versions
v4.3.stable.official.77dcf97d8
System information
Windows 10 - Godot 4.3 stable - Vulkan 1.3.280 - Forward+
Issue description
My 2D project is experiencing a continuous crash on open, believed to be due to a corrupted scene. The crash occurs immediately upon opening the project.
Steps to reproduce
- Created custom resource to store
ProjectileData - Created a custom
Projectilewhich extendedCharacterBody2D, which had@export var stats: Resourcewhich was theProjectileDataabove - Created a
PlayerBeamwhich extendedProjectile - Attempted to add a
Timernode to the baseProjectile, but encountered issues starting theTimer - Removed the
Timernode fromProjectileand its connected signal functions - Added the
Timernode toPlayerBeaminstead - Attempted to create a new inherited scene from player_beam.tscn (
PlayerBeam), which resulted in a crash
Stack trace found in console:
Godot Engine v4.3.stable.official.77dcf97d8 - https://godotengine.org
Vulkan 1.3.280 - Forward+ - Using Device #0: NVIDIA - NVIDIA GeForce RTX 3080
<Resource#-9223370267546291730>
ERROR: Cannot get path of node as it is not in a scene tree.
at: (scene/main/node.cpp:2257)
ERROR: Condition "!is_inside_tree()" is true. Returning: false
at: can_process (scene/main/node.cpp:835)
ERROR: Nonexistent signal: editor_description_changed.
at: (core/object/object.cpp:1441)
ERROR: In Object of type 'Object': Attempt to connect nonexistent signal 'editor_description_changed' to callable 'Scen.
at: (core/object/object.cpp:1390)
ERROR: Node not found: "" (relative to "/root/@EditorNode@16886/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitL.
at: (scene/main/node.cpp:1792)
ERROR: Cannot get path of node as it is not in a scene tree.
at: (scene/main/node.cpp:2257)
ERROR: Condition "!is_inside_tree()" is true. Returning: false
at: can_process (scene/main/node.cpp:835)
ERROR: Nonexistent signal: editor_description_changed.
at: (core/object/object.cpp:1441)
ERROR: In Object of type 'Object': Attempt to connect nonexistent signal 'editor_description_changed' to callable 'Scen.
at: (core/object/object.cpp:1390)
ERROR: Cannot get path of node as it is not in a scene tree.
at: (scene/main/node.cpp:2257)
ERROR: Condition "!is_inside_tree()" is true. Returning: false
at: can_process (scene/main/node.cpp:835)
ERROR: Nonexistent signal: editor_description_changed.
at: (core/object/object.cpp:1441)
ERROR: In Object of type 'Object': Attempt to connect nonexistent signal 'editor_description_changed' to callable 'Scen.
at: (core/object/object.cpp:1390)
ERROR: Node not found: "" (relative to "/root/@EditorNode@16886/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitL.
at: (scene/main/node.cpp:1792)
================================================================
CrashHandlerException: Program crashed with signal 11
Engine version: Godot Engine v4.3.stable.official (77dcf97d82cbfe4e4615475fa52ca03da645dbd8)
Dumping the backtrace. Please include this when reporting the bug to the project developer.
[1] error(-1): no debug info in PE/COFF executable
[2] error(-1): no debug info in PE/COFF executable
[3] error(-1): no debug info in PE/COFF executable
[4] error(-1): no debug info in PE/COFF executable
[5] error(-1): no debug info in PE/COFF executable
[6] error(-1): no debug info in PE/COFF executable
[7] error(-1): no debug info in PE/COFF executable
[8] error(-1): no debug info in PE/COFF executable
[9] error(-1): no debug info in PE/COFF executable
[10] error(-1): no debug info in PE/COFF executable
[11] error(-1): no debug info in PE/COFF executable
[12] error(-1): no debug info in PE/COFF executable
[13] error(-1): no debug info in PE/COFF executable
[14] error(-1): no debug info in PE/COFF executable
[15] error(-1): no debug info in PE/COFF executable
[16] error(-1): no debug info in PE/COFF executable
-- END OF BACKTRACE --
================================================================
Minimal reproduction project (MRP)
- Open the project.
- Project should open normally
- If you double click
player_beam.tscnin the godot editor FileSystem, the project will promptly crash - Subsequent attempts to open the project will immediately crash
As a workaround, I can delete the contents of my .godot folder to reopen the project successfully. But trying to open the player_beam.tscn will bring back the crashes.
I can reproduce it. This is caused by deleting the scene root in the tool script. It is an edge case. Some update methods do not take this into account.
When setting the scene root, we may also need to consider connecting and disconnecting the node's tree_exited signal.
Ok! I figured I was probably doing something odd. Thank you for looking at it
I am also experiencing this and my editor keeps dying in a random moment, any solution for this?
@gth1030 When I was experiencing this I cleared the contents of the .godot folder and was able to reopen my project. I ended up deleting the problem object and rewriting it to avoid opening it in the godot editor again and promptly crashing.
cc @AThousandShips
Tested in v4.4.1.stable. While I cannot get it to automatically reopen player_beam.tscn after crashing, I can replicate the behavior when, for instance, manually reloading the project.
Like many other cases, @tool scripts come with the risk of causing endless crashes on the engine due to their nature. I've confirmed the recovery mode feature on v4.4.1 can detect this scenario and allow you to open the project and make changes to "recover" the project, so hopefully this is enough to mitigate future issues of this kind.