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

Opening project in editor fails with "Parse Error: Busy." #97684

Open
k21 opened this issue Oct 1, 2024 · 2 comments
Open

Opening project in editor fails with "Parse Error: Busy." #97684

k21 opened this issue Oct 1, 2024 · 2 comments

Comments

@k21
Copy link

k21 commented Oct 1, 2024

Tested versions

  • Reproducible in: v4.3.stable.official [77dcf97]

System information

Godot v4.3.stable - Windows 10.0.22631 - Vulkan (Forward+) - integrated Intel(R) UHD Graphics (Intel Corporation; 31.0.101.4887) - 13th Gen Intel(R) Core(TM) i5-1345U (12 Threads)

Issue description

The first time a project is opened in an editor (or after the .godot directory is removed), importing the scenes/scripts fails with:

ERROR: Parse Error: Busy. [Resource file res://thing.tscn:6]
   at: _parse_node_tag (scene/resources/resource_format_text.cpp:289)
ERROR: Failed loading resource: res://thing.tscn. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:283)

Closing and opening the same project a second time fixes the issue. The issue appears again if .godot directory is removed.

Steps to reproduce

  • Download and unzip the attached sample project.
  • Make sure the project is not open in the Godot editor.
  • rm -rf .godot
  • godot --editor --verbose --headless --import --quit
    • (Or open the project in the editor.)
  • Observe the mentioned error in the output.

Minimal reproduction project (MRP)

repro2.zip

@k21
Copy link
Author

k21 commented Oct 1, 2024

At first sight, the issue seems to be caused by thing.gd being loaded first, it has a static typing reference to world.gd so Godot tries to load that, world.gd has a preload of thing.tscn so Godot also goes and loads that, and thing.tscn has a reference to thing.gd, at which point Godot likely refuses to try to load that because it is already being loaded.

Interestingly, if I only rename thing.gd to zthing.gd which presumably changes the import order, the project loads successfully and I see no errors.

The issue is primarily cosmetic, but it was causing issues in our CI pipeline which automates the import process (among other steps) and the error was breaking it.

@k21
Copy link
Author

k21 commented Oct 1, 2024

This is the code that currently reports the error:

				if (error) {
					if (error == ERR_FILE_MISSING_DEPENDENCIES) {
						// Resource loading error, just skip it.
					} else if (error != ERR_FILE_EOF) {
						ERR_PRINT(vformat("Parse Error: %s. [Resource file %s:%d]", error_names[error], res_path, lines));
						return Ref<PackedScene>();
					} else {
						error = OK;
						return packed_scene;
					}
				}

Although I don't understand the full context, it is possible that this case should be handled by the ERR_FILE_MISSING_DEPENDENCIES branch and the error should just be suppressed. But the error code that is returned in this case (ERR_BUSY) does not match the expected value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant