Godot Nakama SDK HTTP Requests times out unexpectedly

Hey there! I have a custom deployment of Nakama in Godot and I’m running into an issue that I can’t seem to completely understand.

I’m initializing my client and calling authenticate_email_async

client = Nakama.create_client("defaultkey", "nakama.nakama", 7350, "http")
var session = await client.authenticate_email_async("email@email.com", "password")

This request hangs and I can see the Nakama debug logs indicating it is:

=== Nakama : DEBUG === Sending request [ID: 1, Method: POST, Uri: http://nakama.nakama:7350/v2/account/authenticate/email?create=true&, Headers: { "Authorization": "Basic ZGVmYXVsdGtleTo=" }, Body: {"email":"email@email.com","password":"password"}, Timeout: 3, Retries: 3, Backoff base: 10 ms]
=== Nakama : DEBUG === Request 1 failed with result: 13, response code: 0
=== Nakama : DEBUG === Retrying request 1. Tries left: 2. Backoff: 5 ms
=== Nakama : DEBUG === Request 1 failed with result: 13, response code: 0
=== Nakama : DEBUG === Retrying request 1. Tries left: 1. Backoff: 96 ms
=== Nakama : DEBUG === Request 1 failed with result: 13, response code: 0
=== Nakama : DEBUG === Freeing request 1

Things I’ve tried that would indicate that it’s not related to networking configurations:

  • I can SSH into the pod for my game server and curl http://nakama.nakama:7350 successfully
  • I can manually issue the same exact HTTP request from outside of Nakama but within Godot
var json = JSON.stringify({
  "email": "email@email.com",
  "password": "password"
})
var headers = ["Accept: application/json", "Authorization: Basic ZGVmYXVsdGtleTo="]
var req = HTTPRequest.new()
req.timeout = 3
add_child(req)
req.request("http://nakama.nakama:7350/v2/account/authenticate.email?create=true&", headers, HTTPClient.METHOD_POST, json)

The manual HTTP request performed in Godot above works and doesn’t timeout. I’ve also added this same exact manual request into the NakamaHTTPAdapter using the arguments that the send_async method is receiving and that seems to work as well.

I’m not sure exactly what’s going on at this point so any nudge would be appreciated. Thank you!

Oh I meant to post this in the Client Libraries section. If this belongs there feel free to move it. Sorry!

Increasing the timeout to 10 seconds seems to eventually work

Debugged this a bit more and it looks like it’s because of use_threads set to true as default in my use case