[Godot, WebGL] Authentication fails with "result 2" despite "200 OK" response

Hello everyone!

I’m currently testing a simple game setup using the Godot client library and builsing to WebGL. The authentication request fails 3 times with “result: 2” despite the server sending a “200 OK” response with a valid JWT.

When running the same client from Godot 4 directly or as a Windows build, the login succeeds, the problem only occurs in the WebGL build of the client.

Here are the setup details:

  1. Versions: Nakama 3.17.1 docker container running on a linux server, Godot client library 3.3.1 for Godot 4, Godot 4.1.1
  2. Server Framework Runtime language is Lua.

Here is a screenshot from the browser consoles network tab showing the “200 OK” responses and logs about the failed requests:

And here the logs when running the same client from the Godot editor:

=== Nakama : DEBUG === Sending request [ID: 1, Method: POST, Uri: https://*****/v2/account/authenticate/email?create=true&username=test&, Headers: { "Authorization": "Basic *****" }, Body: {"email":"test@*****","password":"*****"}, Timeout: 3, Retries: 3, Backoff base: 10 ms]
=== Nakama : DEBUG === Freeing request 1
Login result: 0
Connecting to server
=== Nakama : DEBUG === Connecting to host: wss://*****/ws?lang=en&status=false&token=*****
=== Nakama : INFO === Connected!
Connected to server, joining world
=== Nakama : DEBUG === Sending request [ID: 2, Method: POST, Uri: https://*****/v2/rpc/get_world_id, Headers: { "Authorization": "Bearer *****" }, Body: "", Timeout: 3, Retries: 3, Backoff base: 10 ms]
=== Nakama : DEBUG === Freeing request 2
=== Nakama : DEBUG === Sending async request: MatchJoin<match_id=06bfdca3-6867-4077-bc1b-70d8e7bf7f34.nakama-node-1, token=<null>, metadata=<null>>
=== Nakama : DEBUG === Resuming request: 1: { "cid": "1", "match": { "match_id": "06bfdca3-6867-4077-bc1b-70d8e7bf7f34.nakama-node-1", "authoritative": true, "label": "Triangles", "self": { "user_id": "3e604c95-acda-4ae0-ac31-bd43e1dd372e", "session_id": "7018bdcb-62e8-11ee-8a1c-688e25b5a5ca", "username": "test" } } }

Any hints on what might be going wrong here would be greatly appreciated!

Thanks in advance for any input on this issue and best regards,
Patrick

Hello everyone!

The problem has been fixed in yesterdays Godot 4.1.2 update. Handling of the HTTP response was not correct in WebGL builds: [Web] Always return -1 as body length in HTTPClientWeb by Faless · Pull Request #79846 · godotengine/godot · GitHub.

Best regards,
Patrick