The Godot Q&A is currently undergoing maintenance!

Your ability to ask and answer questions is temporarily disabled. You can browse existing threads in read-only mode.

We are working on bringing this community platform back to its full functionality, stay tuned for updates.

godotengine.org | Twitter

+1 vote

I've built a simple godot server running on MultiplayerENet using RPC for client-server communication. My client-and server are separate projects. I've exported my server to a Linux .pck file and I use the Linux server runtime from the Godot site to run the server but I get the following errors when connecting with my client:

ERROR: _process_get_node: Condition "!F" is true. Returned: __null At: core/io/multiplayer_api.cpp:265. ERROR: _process_packet: Condition "node == __null" is true. At: core/io/multiplayer_api.cpp:204. ERROR: _process_get_node: Condition "!F" is true. Returned: __null At: core/io/multiplayer_api.cpp:265. ERROR: _process_packet: Condition "node == __null" is true. At: core/io/multiplayer_api.cpp:204. ERROR: _process_get_node: Condition "!F" is true. Returned: __null At: core/io/multiplayer_api.cpp:265. ERROR: _process_packet: Condition "node == __null" is true. At: core/io/multiplayer_api.cpp:204.

This does not happen when I run the client-and server in-editor. does anyone have any clue what could the be underlying issue here? I looked up the source code for line 265 which is:
ERR_FAIL_COND_V_MSG(!F, NULL, "Invalid packet received. Unabled to find requested cached node.");

And line 204:
ERR_FAIL_COND_MSG(node == NULL, "Invalid packet received. Requested node was not found.");

My networking code runs inside of a plugin that I built myself. This includes the RPC calls.

This problem only occurs when I use the Linux Server runtime downloaded from https://godotengine.org/download/server. it works fine if i use the normal runtime. However, I intend to containerize my server applications so I can't rely on the normal runtime. I need the server runtime that doesn't include all the graphics and audio.

I've built my application with Godot 3.2.

Update: Hereby I am including sample code to reproduce the problem:

Server:

extends Node

func _ready():
    var peer = NetworkedMultiplayerENet.new()
    peer.create_server(43594, 16)
    get_tree().set_network_peer(peer)

remote func hello_world():
    print("Hello World!")
    rpc_id(get_tree().get_rpc_sender_id(), "reply")

Client:

extends Node

func _ready():
    get_tree().connect("connected_to_server", self, "_connected_to_host_ok")
    get_tree().connect("connection_failed", self, "_failed_to_connect_to_host")

    var peer = NetworkedMultiplayerENet.new()
    peer.create_client("localhost", 43594)
    get_tree().set_network_peer(peer)

func _connected_to_host_ok():
    print("Telling server to print Hello World!")
    rpc_id(1, "hello_world")

remote func reply():
    print("Received a reply from the server to also print Hello World!")

Export the server project to a .pck file, rename it to be the same as the Linux server runtime file and run it in CLI as for example: ./sample-server.64

in Engine by (13 points)

1 Answer

0 votes
ERR_FAIL_COND_MSG(node == NULL, "Invalid packet received. Requested node was not found.");

The most common cause of this error is a Node path or name mismatch between the client and server. I suggest you manually set the Node name (I generally do this in _init()). For example, place in both the server and client.

func _init():
    self.name = "mysvr";

Also keep in mind that the Node path to the rpc objects must be EXACTLY the same in both the server and client. The easiest solution is to make the objects children of the root node.

get_tree().root.add_child(mysvr);

This also assures they will be cleaned up when the app exits so you won't have to chase memory leaks.

by (94 points)
Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.