question

amazdeh avatar image
amazdeh asked

MatchMake fails with 500 server internal error and 400 bad request

I'm trying to match make after I uploaded a uNet based game server to playfab. The server is running for about a day but whenever I try to match make then I receive 500 internal server error and 400 bad request.


The request has the current "1.0" build version and USEast as region and the game has 2 player slots , What am I doing wrong?

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

What are the details of the Matchmake call you're making (what are the specific parameters), and what are the details of the error response you get back, including the errorDetails?

8 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.

amazdeh avatar image amazdeh commented ·
The request I send is this MatchmakeRequest req = new MatchmakeRequest
        {
            BuildVersion = "1.1",
            GameMode = "test",
            Region = Region.USEast,
            StartNewIfNoneFound = true
        };
        PlayFabClientAPI.Matchmake(req, resp =>
        {
            if (resp.Status == MatchmakeStatus.GameNotFound) {
                if (OnFailedToFindMatch != null)
                    OnFailedToFindMatch("Failed to find a match");
            }
            else {
                if (OnMatchFound != null)
                    OnMatchFound(resp.ServerHostname, resp.ServerPort, resp.Ticket, resp.LobbyID);
            }
        }, err =>
        {
            Debug.LogError(err);
            if (OnFailedToFindMatch != null)
                OnFailedToFindMatch(err.ErrorMessage);
        });


And this is the playfab error in the console

And this is the playfab error in console

PlayFabError(ServiceUnavailable, 500 Internal Server Error , 400 BadRequest) The title id is DCa2
0 Likes 0 ·
brendan avatar image brendan amazdeh commented ·

I just tried logging into your title using one of your test profiles, and called Matchmake using the parameters above. Everything worked fine - you can see the sessions in your Archived Games tab. Here's the call as I made it - can you review your code, to see what Region.USEast evaluates to in your code?

POST /Client/Matchmake HTTP/1.1
Host: DCA2.playfabapi.com
Content-Type: application/json
X-Authentication: [session ticket removed]
{
  "BuildVersion": "1.1",
  "GameMode": "test",
  "Region": "USEast",
  "StartNewIfNoneFound": true
}

Since StartNewIfNoneFound defaults to true, you actually don't need it in the call, by the way - it works fine without it.

0 Likes 0 ·
amazdeh avatar image amazdeh commented ·

@Brendan Thanks for the reply. The enum is not mine and is for playfab SDK. If you let me know how to enable logging of web requests in your Unity SDK , I can share the log that prints out. I assume a ToString or serialization rule which serializes enums as string of their names is used.

About default parameters, I think it is a good practice to use them since if a fellow of mine wants to maintain my code, he/she doesn't need to read playfab docs to see what default parameters are there and what they do, just by reading my code, he can for example turn the feature on or off easily.

0 Likes 0 ·
brendan avatar image brendan amazdeh commented ·

Thanks, I was assuming you were using our enum, but since you're getting a result I cannot reproduce, I was hoping to get info on what the parameters you're using actually evaluate to in the call, to make certain. We do not currently have built-in logging, but you should be able to add that if you'd like to get the info that way. All I really need are the specifics of your repro case - confirmation of the values passed in, and the state of your server at the time you perform the test. The only ways I'm aware of that you could hit that specific error would be if one of the required parameters is missing or invalid, or if the server isn't in a ready state.

0 Likes 0 ·
amazdeh avatar image amazdeh commented ·

so if I use WebRequest instead of WWW it says "test" game mode doesn't exist while it does?
My parameters are above, build id 1.1 , USEast and test game mode.

With the title id above. Server was running and still is.

0 Likes 0 ·
brendan avatar image brendan amazdeh commented ·

I had a look at the logs, and I see the issue - you're actually specifying the BuildVersion as "1.0", which doesn't exist in your title. It should be "1.1".

0 Likes 0 ·
amazdeh avatar image amazdeh commented ·
@Brendan

thanks now it works but the error was misleading so please correct that in your WebAPI. The error for the WWW version was completely without useful info but the webrequest one was saying the wrong thing.

0 Likes 0 ·
brendan avatar image brendan amazdeh commented ·

Yes, we do have a work item open to improve the error reporting for that API call. We'll get that updated as soon as we can.

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.