Bug with Playfab? (FIXED)

Hi,

I’m trying to allow players to reconnect if they go offline but later reconnect. However, that doesn’t seem to be working. I’ve posted this issue on the Github repo as well. I couldn’t find anything obvious in the library, e.g. a check for internet connection or state saving when offline, so posting this here as well.

Steps to reproduce

  1. Start an app without an internet connection, e.g. with Wi-fi turned off.
  2. Attempt to send a request when offline, e.g. PlayFabClientApi.LoginWithCustomID. The request should fail as expected.
  3. Turn wifi on.
  4. Attemp to send a request without restarting the app.

Actual outcome

Request fails with the following error message:

Defold version

Version: 1.2.159
Editor SHA1: c3e32c38ee70eec1524e1d2d0ad596629285cfb3

Platforms

Tested on macOS Mojave and Android 11

Logs

ERROR:SCRIPT: Unable to create HTTP connection to 'https://TitleId.playfabapi.com/Client/LoginWithCustomID?sdk=DefoldSdk_0.59.190625'. No route to host?
DEBUG:SCRIPT: 
{ --[[0x10bcefed0]]
  error = "ServiceUnavailable",
  errorCode = 1123,
  code = 0,
  status = 0,
  errorMessage = "Could not deserialize reseponse from server: "
}

Expected outcome

Request should work


Let me know if it’s library issue and/or if there’s any additional info I could provide to help with debugging.

It was a while since I looked at the playfab code but it should be pretty straightforward. I would try with the debugger and follow the reconnect flow step by step.

Are your able to do a normal http.request() completely ignoring the playfab code?

2 Likes

I’ve tried it with a simple http.request() and I’m running into the same issue (which means that Playfab has nothing to do with this).

The following is the error that I get when trying to make a request after going through the mentioned steps (no wifi, start, re-enable wifi, click “Retry” from within the game):

ERROR:SCRIPT: Unable to create HTTP connection to 'http://www.google.com'. No route to host?

The same error happens whether the game is run from within defold or packaged up and run in macos or android.

And this happens even if you wait for a while as well?

I’ve waited for ~1 min and this was still an issue. Do you have a specific timeframe in mind that I should to wait for?

Nope, I will experiment some myself and get back to you.

We can confirm that it is a bug in Defold. We’re looking into it. It seems to have been introduced when we released the async dns lookup fix in May. I’m a bit surprised that we haven’t caught this sooner (I blame summer!).

4 Likes

@DeividasK this has been fixed in 1.2.161

2 Likes

I have tested http.request and i got this message too. nothing happens while playing, after i close game window i see this error in console. i use version 1.2.168
my request works on browser and postman.

maybe because i use ip and port on address instead of domain name?

http.request("http://myipaddress:myport/GetFriendsList?user=jack85", "GET", httpAnswer)

it seems https works but not http! this one works well:

http.request("https://reqres.in/api/users/2", "GET", httpAnswer)

@Navid which is the error message you are getting?

ERROR:SCRIPT: Unable to create HTTP connection to (myUrl) No route to host?
WARNING:DLIB: Profiler VSync.Wait took 60.091 seconds

i have tested it just with my ip and port too, doesn’t work again, something like this but with my own server ip and port:

local myUrl = "http://173.24.35.132:3000/"
http.request(myUrl, "GET", httpAnswer)

i have tested defold websocket using myServer just one minute ago, it works with websocket ( with the same ip and port i use for http )

How are you running the server? Where is it hosted? Which OS are you using?

i run defold on microsoft windows 10, and server is running on linux using node js and express, the server is answering my http request using unity and post man right now, I have active game which is connects to server. i can send you our ip and port in private message if you think this helps you to find the problem.

1 Like