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

script_editor_cache.cfg stores old version of script filename resulting in "Case mismatch opening requested file" console spam. #96221

Open
jitspoe opened this issue Aug 28, 2024 · 2 comments

Comments

@jitspoe
Copy link
Contributor

jitspoe commented Aug 28, 2024

Tested versions

4.3

System information

Windows 10, Vulkan forward +, Nvidia 3070

Issue description

I renamed a script file outside of the editor that had an upper case letter to match the standard snake_case filenames and, after restarting the project, got a bunch of spam in the console, even though nothing referenced the original filename:

drivers/windows/file_access_windows.cpp:181 - Case mismatch opening requested file 'res:https://addons/console/Console.gd', stored as 'res:https://addons/console/console.gd' in the filesystem. This file will not open when exported to other case-sensitive platforms.
image

Steps to reproduce

Not sure if this is exclusive to addons, but I have a simple developer console, and it's had a non-standard filename, so I decided to fix this. In my active project, it wasn't a problem, as I renamed it within Godot, but when I replaced the addon with the updated version in a test project, I started getting errors, even though nothing referenced the original "Console.gd" filename. I tried enabling/disabling the addon and restarting the project several times and ensured nothing was referencing it in the autoload/plugin/scripts/etc.

Before:

func _enter_tree():
	print("Console plugin activated.")
	add_autoload_singleton("Console", "res:https://addons/console/Console.gd")

After:

func _enter_tree():
	print("Console plugin activated.")
	add_autoload_singleton("Console", "res:https://addons/console/console.gd")

Deleting the ".godot" directory fixes the issue, and upon further inspection, it seems the project_metadata.cfg was the culprit:

scripts=["res:https://addons/console/console.gd", "res:https://addons/console/plugin.cfg", "res:https://addons/console/console_plugin.gd", "res:https://addons/console/Console.gd", "res:https://main_scene.gd", "res:https://spinning_cube.gd"]

The script_editor_cache.cfg and editor_layout.cfg might also cause the problem as they also contain references to the file.

Edit: Seems the project_metadata.cfg does not cause it. The script_editor_cache definitely does, though. Editor_layout likely does as well. As a side note, it's kind of interesting how many times the error message pops up suggesting that Godot might be reading these files more often than it needs to and reducing these reads could speed up project reload times.

Minimal reproduction project (MRP)

test-console_case_error.zip

Note: .godot directory is necessary to reproduce the issue.

@jitspoe jitspoe changed the title project_metadata.cfg stores old version of script filename resulting in "Case mismatch opening requested file" console spam. script_editor_cache.cfg stores old version of script filename resulting in "Case mismatch opening requested file" console spam. Aug 28, 2024
@Kylemcarthur
Copy link

I deleted the .godot folder as suggested in the post, and that did not fix the issue in my own project when this happened. Haven't determined a user fix yet.

@jitspoe
Copy link
Contributor Author

jitspoe commented Nov 22, 2024

I'd do a full search through your whole project for anything referencing the original filename.

It might be worth noting that in addition to the multiple *cache.cfg files that hold references to the there's also filesystem_cache files that had references to it, but those are also in the .godot subdirectory.

If you're specifying specific export files, it's possible the file could be referenced in the export_presets.cfg outside of the .godot directory.

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

3 participants