Suddenly Can't Open Scenes (Parse error and others)

Godot Version

v4.3.stable.official [77dcf97d8]

Question

I am working on a topdown 2D robot game and I have made a lot of progress thus far on it. Due to low-space on my hard drive, and also just a lack of knowing when I want to back my stuff up (and getting carried away), I do not have any, but I will start making them immediately after this on an external SSD. For now though, I really don’t want to lose my progress on this project, as this was already a project rebuild.

I was trying to make a player_shader in my Player scene. I didn’t finish the code, but it didn’t have any errors.

It asked for a texture to be fed to it so that it could work. Then I tried testing the game and it opened and closed immediately. No errors that I remember. I tried it again, and then I think Godot crashed.

I have since deleted that shader file to no avail.

And now, I can barely open any of my scenes. Most of my scripts are fine, funnily enough. I can open them fine. Most of my textures seem fine too.

Here’s the error log:

Godot Engine v4.3.stable.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started on port 6006 ---
--- GDScript language server started on port 6005 ---
  drivers/png/png_driver_common.cpp:56 - png_image_begin_read_from_memory: invalid argument
  drivers/png/png_driver_common.cpp:69 - Condition "!success" is true. Returning: ERR_FILE_CORRUPT
  core/io/image_loader.cpp:101 - Error loading image: C:/Users/migue/AppData/Local/Godot/resthumb-d471fdfbde7ae2b1d2d20baba67df147.png
  drivers/png/png_driver_common.cpp:56 - png_image_begin_read_from_memory: invalid argument
  drivers/png/png_driver_common.cpp:69 - Condition "!success" is true. Returning: ERR_FILE_CORRUPT
  core/io/image_loader.cpp:101 - Error loading image: C:/Users/migue/AppData/Local/Godot/resthumb-390ae1c42625983b80772ff35979f316.png
  drivers/png/png_driver_common.cpp:56 - png_image_begin_read_from_memory: invalid argument
  drivers/png/png_driver_common.cpp:69 - Condition "!success" is true. Returning: ERR_FILE_CORRUPT
  core/io/image_loader.cpp:101 - Error loading image: C:/Users/migue/AppData/Local/Godot/resthumb-a00c558961aea4feddb725b7f862092d.png
  drivers/png/png_driver_common.cpp:56 - png_image_begin_read_from_memory: invalid argument
  drivers/png/png_driver_common.cpp:69 - Condition "!success" is true. Returning: ERR_FILE_CORRUPT
  core/io/image_loader.cpp:101 - Error loading image: C:/Users/migue/AppData/Local/Godot/resthumb-770a896055b1cac96cfc870659d974b9.png
  drivers/png/png_driver_common.cpp:56 - png_image_begin_read_from_memory: invalid argument
  drivers/png/png_driver_common.cpp:69 - Condition "!success" is true. Returning: ERR_FILE_CORRUPT
  core/io/image_loader.cpp:101 - Error loading image: C:/Users/migue/AppData/Local/Godot/resthumb-ce0a128976d39d90db36ccc1761933f7.png
  drivers/png/png_driver_common.cpp:56 - png_image_begin_read_from_memory: invalid argument
  drivers/png/png_driver_common.cpp:69 - Condition "!success" is true. Returning: ERR_FILE_CORRUPT
  core/io/image_loader.cpp:101 - Error loading image: C:/Users/migue/AppData/Local/Godot/resthumb-aa86df1fd5b52297c4d7e059f78dd80d.png

I also get this when trying to open my Main.tscn.

I get the same error when trying to open any other scenes, but I also get these messages in my error log:

 scene/resources/resource_format_text.cpp:1061 - res://Scenes/Main.tscn:1 - Parse Error: 
  Failed loading resource: res://Scenes/Main.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:1061 - res://Scenes/Player.tscn:1 - Parse Error: 
  Failed loading resource: res://Scenes/Player.tscn. Make sure resources have been imported by opening the project in the editor at least once.
  scene/resources/resource_format_text.cpp:1061 - res://Scenes/Player_house_map.tscn:1 - Parse Error: 
  Failed loading resource: res://Scenes/Player_house_map.tscn. Make sure resources have been imported by opening the project in the editor at least once.

How do I fix this? Can I fix this? What did I do wrong? What can I do to prevent this in future? Thank you! Any help would be greatly appreciated.

What I’ve Done So Far

As mentioned previously, I tried deleting my .godot folder. I tried restarting Godot, and restarting my computer.

EDIT 1

I have looked into how to fix corrupted files, but they seem to target specific issues with the files that can be fixed by delving into the scene files themselves with a text editor, not plain old corruption. Not sure what to do.

EDIT 2

Ok cool so I checked some of my scene files in notepad and SublimeText and uh… The files seem to be completely empty. I checked Main.tscn and Player.tscn.

Now what…

Do you use any kind of VCS?
If so, I would recommend going back to previous commits and see where the file’s contents got deleted and roll back to that point.

If not, this might be a good wakeup call to start using a VCS to avoid issues like this in the future.

1 Like