Excessive warnings about invalid UUID in ext_resource
Closed this issue ยท 13 comments
Godot version
4.0.alpha14
System information
macOS Monterey - 12.5.1 - M1 - Vulkan
Issue description
While developing a plugin using custom resources I get many warnings saying:
scene/resources/resource_format_text.cpp:448 - res://
resource path here
.tscn:3 - ext_resource, invalid UUID: uid://d3g4i4dshtdpu - using text path instead: res://resource path here
I'm not using any UUID reference in my code, and things are working as expected, but this warning is still showing up.
Steps to reproduce
I'm unsure, but I assume you have to have custom resources in your plugin/tool scripts.
Minimal reproduction project
It is not a minimal reproduction project but it has the current build of my plugin with nothing but a single custom resource created by the "user".
In my experience this happens when your plugin is enabled in project settings and is therefore loaded with the editor startup. If you enable your plugin after the editor has been started, you shouldn't get any warnings. So this is probably another order of operation issue for the editor, similar to the chicken'n'egg problem of "should we load resources first, or should we load plugins first". But, hopefully, this is easier to solve.
Similar bug occurs when you have load("uid://something")
in your plugin's script. The plugin gets disabled at startup, because it can't find the uid.
EDIT:
btw the warnings started appearing recently. The uids are saved as part of the ext_resource
now, which wasn't happening before.
this is new since the last 2 weeks, at least for me. I seem to be getting invalid UUID even though both the external .tres file and the loading file have the same UID's listed. for example...
file debri0.tscn
[gd_scene load_steps=7 format=3 uid="uid://ddh7ojrjccb5b"]
[ext_resource type="PhysicsMaterial" uid="uid://df5q1ck8l1hf6" path="res://assets/BasicDebriPhysicsMat.tres" id="1_dewuc"]
...
file BasicDebriPhysicsMat.tres
[gd_resource type="PhysicsMaterial" format=3 uid="uid://df5q1ck8l1hf6"]
...
restarting the editor has no effect. choosing the material again in the editor doesn't change anything.
and... even after the first load it still can't find it
EditorSettings: Load OK!
Creating VMA small objects pool for memory type index 3
WARNING: res://scenes/debri/debri0.tscn:3 - ext_resource, invalid UUID: uid://df5q1ck8l1hf6 - using text path instead: res://assets/BasicDebriPhysicsMat.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/debri/debri0.tscn:5 - ext_resource, invalid UUID: uid://b2auxomfclcqh - using text path instead: res://scenes/debri/curve1.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/debri/debri0.tscn:6 - ext_resource, invalid UUID: uid://dxcie5el5pex8 - using text path instead: res://assets/materials/enemy_grey0.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/debri/debri1.tscn:3 - ext_resource, invalid UUID: uid://df5q1ck8l1hf6 - using text path instead: res://assets/BasicDebriPhysicsMat.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/debri/debri1.tscn:5 - ext_resource, invalid UUID: uid://b2auxomfclcqh - using text path instead: res://scenes/debri/curve1.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/debri/debri1.tscn:6 - ext_resource, invalid UUID: uid://c0jk4sqt3syvc - using text path instead: res://assets/materials/enemy_grey1.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/debri/debri2.tscn:3 - ext_resource, invalid UUID: uid://df5q1ck8l1hf6 - using text path instead: res://assets/BasicDebriPhysicsMat.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/debri/debri2.tscn:5 - ext_resource, invalid UUID: uid://b2auxomfclcqh - using text path instead: res://scenes/debri/curve1.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/debri/debri2.tscn:6 - ext_resource, invalid UUID: uid://c7sxemu8km0s2 - using text path instead: res://assets/materials/enemy_grey2.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
Loaded builtin certs
EditorSettings: Save OK!
WARNING: res://scenes/healthbar/HealthBar.tscn:3 - ext_resource, invalid UUID: uid://cx550qwwgkfu3 - using text path instead: res://scenes/healthbar/HealthBar.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
WARNING: res://scenes/healthbar/HealthBar.tscn:3 - ext_resource, invalid UUID: uid://cx550qwwgkfu3 - using text path instead: res://scenes/healthbar/HealthBar.tres
at: ResourceLoaderText::load (scene\resources\resource_format_text.cpp:448)
...
The errors only stop appearing here, when I remove all textures2d (icons from my plugin)
Been having this since Alpha 12, I have around 6 plugins enabled and re-ordering them does not seem to change how many warnings are output, nor the order they are output in (about 47 warnings for me in total).
I tried to remove the UID from the tscn files and re-save them (it seemed to re-generate them fine), but the warning still persists, I have also tried clearing the .godot folder and re-enabling the plugins but it's not having it.
I have included a small test project below (Beta 1) containing a stripped out version of one of the plugins - you should see 5 warnings when the project first opens.
I did try to have a go at debugging the source but not entirely sure where to start, it seems it hashes the UID then tries to lookup that hash in a cache list, however that cache list was empty (out of my depth at this point), so while it says the UID is invalid, it seems more of a case of it not existing in that hash map (for whatever reason)
Just looking through the source it looks like resources are loaded on a separate thread from scene loading(?) and this is just a race condition. I don't know what's different than before and if this really matters now even... maybe these warnings shouldn't be printed at all except in --verbose mode. now they are printed in release_debug or debug with verbose or not.
my output does seem to show resources may be loading multiple times from disk though depending on where it's asked for again in the scene tree. all these "warnings" show up at the start of the loading phase (even multiple times) and then later will load successfully via the uid from the cache
didn't --verbose use to print out when it was loading a resource? it doesn't anymore unless I'm doing something wrong.
i am getting this error on godot 4 dev1. I use git with 2 branches for projects 3. and 4. Everytime I switch between projects on godot 4, scenes are always ext_resource, invalid UID. I had to reopen the scenes to get rid of the error.
I'm getting warnings like these in 4.1.1. And when I reload the project, material references go missing, or even models (saved from glb). Not sure if related, but shader materials keep losing their reference to the shader, which means I lose all my parameters that were set up. I think it's all related to the "invalid UID, using text path instead" thing.
I can seemingly fix by deleting the model res and reimporting the glb. So i'm pretty sure this Is a bug. But no such fix for the shader materials.
I can confirm this. The last time this happened (I don't remember the exact version but it was 4.x), it bricked my entire project. I had to use my back up and reconstruct the project. Now I am getting it again, with material's texture references, just on a few of them.
All I did was upgrade from 4.1 to 4.1.1. I deleted all the .import files and let Godot reimport them. It didn't help.
This happens to me as well when I check out the project fresh on a new computer. Note that I am not committing the import files. Are we now expected to commit the import files under Godot 4? Or is there a procedure we need to follow to resolve these problems when checkout out a project fresh?
You do need to commit .import files.
I wonder if someone can outline here or elsewhere what the procedure is to resolve these warnings when there are thousands of them. ๐
Here I posted an editor script that opens and re-saves all scenes/resources:
#67128 (comment)
This makes sure that stored UIDs are correct.