question

raffolox avatar image
raffolox asked

LinkFacebookAccount causes 500 Internal Server Error

When my game starts, if the user never linked his Facebook account, I login the user to PlayFab using the AndroidDeviceID

string deviceID = getDeviceID();
PlayFabClientAPI.LoginWithAndroidDeviceID(
    new LoginWithAndroidDeviceIDRequest {
        AndroidDeviceId = getDeviceID(),
        CreateAccount = true,
        TitleId = "9261"
    }, resultCallback, LogError);

I can see the account is created successfully and linked to the Android Device ID

Then when the user presses the Connect to Facebook button for the first time I want to link his Facebook account to his PlayFab account

PlayFabClientAPI.LinkFacebookAccount(
    new LinkFacebookAccountRequest {
        ForceLink = true,
        AccessToken = AccessToken.CurrentAccessToken.TokenString
    }, OnPlayfabFacebookAuthComplete, LogError);

The AccessToken is obtained successfully and the Facebook app is linked to the user account, but the account doesn't get linked to the PlayFab account: I get this error

Error Message

500 Internal Server Error
UnityEngine.Debug:Log(Object)
PlayFabLeaderboardManager:LogError(PlayFabError) (at Assets/Scripts/UI/PlayFabLeaderboardManager.cs:222)
PlayFab.Internal.<MakeApiCall>c__AnonStorey1:<>m__1(String) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs:133)
PlayFab.Internal.<Post>c__Iterator0:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs:145)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)




Error Details

Null
UnityEngine.Debug:Log(Object)
PlayFabLeaderboardManager:LogError(PlayFabError) (at Assets/Scripts/UI/PlayFabLeaderboardManager.cs:223)
PlayFab.Internal.<MakeApiCall>c__AnonStorey1:<>m__1(String) (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs:133)
PlayFab.Internal.<Post>c__Iterator0:MoveNext() (at Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs:145)
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)

Any clue on what is causing this issue? I did some troubleshooting by linking a custom id to the PlayFab account and it works, and by logging in directly with the Facebook account, and it works

Thank you in advance

Authentication
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

The leaderboard manager doesn't have anything to do with logging in, so it's not clear why you'd be seeing that. Can you reproduce this in Postman? What is the complete response of the error message, including the errorDetails?

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

raffolox avatar image raffolox commented ·

PlayFabLeaderboardManager is the name of the class in my project in which I'm using PlayFab. In my first post there are both errorMessage and errorDetails.

0 Likes 0 ·
brendan avatar image brendan raffolox commented ·

That's actually a call stack. What I need is the response sent back from the service. In general, those will contain an error, errorCode, and errorMessage, and for a 500 error they will always contain an errorHash and an errorDetails. It's the errorDetails I need, in order to track this down. Here's an example of what it looks like:

{
    "code": 500,
    "status": "InternalServerError",
    "error": "InternalServerError",
    "errorCode": 1110,
    "errorMessage": "An unexpected error occured while processing the request.",
    "errorHash": "7115e505849159f217c46360d0cf049b",
    "errorDetails": {
        "RequestID": ["5decd7ee875b4d72a7d44b209576f8bc"]
    }
}
0 Likes 0 ·
infonetmatika avatar image infonetmatika brendan commented ·

Hi Brendan,

i've same error.

this is my response sent back from the service.

{
 "code": 500,
 "status": "InternalServerError",
 "error": "InternalServerError",
 "errorCode": 1110,
 "errorMessage": "An unexpected error occured while processing the request.",
 "errorHash": "60467a516444b1fad1a59bb2f1bee6a2",
 "errorDetails": {
  "RequestID": [
   "2887427e7fa843d9b696254a9a166191"
  ]
 },
 "CallBackTimeMS": 606
}
0 Likes 0 ·
Show more comments
infonetmatika avatar image infonetmatika commented ·

Hi @Brendan,

thank you very much!

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.