Godot Multiplayer Error: Condition "!spawn_queue.has(p_oid)" is true

Godot v4.5.stable

I can’t really remember since when I’ve been having this error when starting a multiplayer session, but it’s there. It only happens on the host and has no impact that I can see, but it’s unsettling.

E 0:00:02:285   multiplayer.gd:38 @ add_player(): Condition "!spawn_queue.has(p_oid)" is true.
  <C++ Source>  modules/multiplayer/scene_replication_interface.cpp:172 @ _node_ready()
  <Stack Trace> multiplayer.gd:38 @ add_player()
                game.gd:42 @ _on_player_joined()
                multiplayer.gd:69 @ _host_local()
                multiplayer.gd:45 @ host()
                host.gd:11 @ _pressed()
                ui_3d.gd:31 @ _input_event()

If you check the C++ source you can see that the specific line causing this error is a “Bug”?

ERR_FAIL_COND(!spawn_queue.has(p_oid)); // Bug.

From what I’ve read, the only instances of someone else reporting this are, effectively, as a bug that happens under certain conditions. I have made sure to not reproduce any of those conditions and still the bug is present.

My understanding of C++ is limited but from what I know, this error is related to some object or parameter not being found when spawning it? I’m just looking forward for a heads up on what could cause this issue, if someone has stumbled upon it before.

So on_spawn is called in response to a a local scene being added to a spawner to spawn a scene. The scene is added to the spawn_queue as an oid (Object id) and connects the signal _ready to _node_ready callback as a one shot signal.

If the object becomes ready, but the spawn_queue loses track of the oid it would have to be that the spawn queue got cleared.

This code is happening just after enter tree but before ready and usually the ready will happen in a single frame, if for some reason it doesnt i think that would cause the issue, but i cant think of why that would be the case.. are you doing any funny tree manipulation (add_child, remove_child) in a spawnable scene during ready or enter tree?

1 Like
extends Player

func _enter_tree() -> void:
	spawn_character()

Haha! That makes a lot of sense, thanks for the insight! I’ll fix it and let you know if that was the issue. :stuck_out_tongue_winking_eye: