question

Terry Kwon avatar image
Terry Kwon asked

500 Error with Matchmake API

Hi,

I am getting 500 error when calling Matchmake API on Unity.

I ran connection tests between client program and game server program on local machine many times and there wasn't any error.

1. Tested on Unity. Logged in with LoginWithCustomID API, then ran Matchmake API.

2. Double checked that I called Matchmake API in Unity with correct BuildVersion (1.01), Region (Japan) and GameMode (Basic) as well as TitleID (5A6B).

3. GetGameServerRegions API call from PlayFab document page says server is okay.

    "Region": "Japan",
    "Name": "Japan",
    "Available": true,
    "PingUrl": "http://13.112.63.54/ping"

4. MatchMake API call from PlayFab document page also doesn't shows any problem.

"LobbyID": "1356450640383524008",
  "ServerHostname": "13.112.63.54",
  "ServerPort": 9000,
  "Ticket": "9499FD7B771FA776-0-B321BC0C8376C6EE-5A6B-8D4D2D656CF3C13-4E902932E0FB90B9.1855CCBD50C1F34D",
  "Expires": "2017-07-24T20:57:38.7338771Z",
  "Status": "Complete"

5. I just added -titleId=5A6B at command-line args, but whether I put or not it doesn't change the result.

6. Zipped as photo shows below

Custom Game Servers
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Thanks, the Title ID was the most important element, as it allowed us to find the error log. In looking at the parameters you passed in, you're sending the Build ID as a floating point number - it should actually be a string (https://api.playfab.com/documentation/client/method/Matchmake). So instead of this:

{"BuildVersion":1.01,"Region":"Japan","GameMode":"Basic"}

If you update to this, you should find that it works as expected:

{"BuildVersion":"1.01","Region":"Japan","GameMode":"Basic"}

Meanwhile, I'll file a bug to have a more detailed error response for that specific case.

13 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Terry Kwon avatar image Terry Kwon commented ·

7. Just in case, I changed path on Game Manager to GameServer/gameserver.exe (from gameserver.exe), but now API call from document page throws 500 error.

{
 "code": 500,
 "status": "InternalServerError",
 "error": "InternalServerError",
 "errorCode": 1110,
 "errorMessage": "An unexpected error occured while processing the request.",
 "errorHash": "593e738edd2f129ca05110654bbf69df",
 "errorDetails": {
  "RequestID": [
   "7d52103a12ac4949b81da1cfb95ddbac"
  ]
 }
0 Likes 0 ·
brendan avatar image brendan Terry Kwon commented ·

Yes, if the path to the executable is wrong, you'll get a 500 no matter what, as the service will be unable to start the game. The fact that the call works fine from the TryIt functionality in the doc site tells us that the build is fine - it's the call being made from the client that's failing.

0 Likes 0 ·
Terry Kwon avatar image Terry Kwon commented ·

Hi Brendan.

I checked my code and it was actually a string value, as I just copied and pasted API calling part from PlayFabGameServerClientExample on Github.

Also checked payload JSON string sending to web server:

{"BuildVersion":"1.01","Region":"Japan","GameMode":"Basic","LobbyId":null,"StatisticName":null,"CharacterId":null,"StartNewIfNoneFound":null,"TagFilter":null}

I am not sure why it is a float value on your log. Can you check it again please?

Thanks.

0 Likes 0 ·
brendan avatar image brendan Terry Kwon commented ·

Yes, what I'm seeing in the logging is literally this for your call:

"Body": "{\"BuildVersion\":1.01,\"Region\":\"Japan\",\"GameMode\":\"Basic\"}"

So yes, the BuildVersion is not being sent from the client as a string. Can you provide the code snippet showing how you're setting up the parameters and making the call?

0 Likes 0 ·
Terry Kwon avatar image Terry Kwon brendan commented ·

Okay this is very interesting..

I found what caused the issue. I used to turn api compression option, and as soon as I unchecked 'Compress API data' to false, it started to work like a charm.

I guess when decompressing the payload at PlayFab's server side, it reads "1.02" as floating point value even it was compressed as string maybe.

So, I will avoid using API data compressing for now.

Thanks for your support Brendan!

1 Like 1 ·
Show more comments
Show more comments
Terry Kwon avatar image Terry Kwon commented ·

Or maybe https://api.playfab.com/documentation/client/method/Matchmake this is sending floating point value? but it does work :( and mine doesn't...

0 Likes 0 ·
brendan avatar image brendan Terry Kwon commented ·

No, the TryIt function sends it as a string - that's why it works when you call it from the doc page (with the correct executable path).

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.