question

Wang Yichun avatar image
Wang Yichun asked

Service Unavailable: PreconditionFailed

After I update my Unity SDK to Version: 0.31.160705.
When called any login command. I'll got a errorcallback saying:
"HttpCode":412,"HttpStatus":"Service Unavailable: PreconditionFailed","Error":1 ......

Here is my test code:

LoginWithPlayFabRequestrequest=newLoginWithPlayFabRequest();

request.TitleId=titleId;
request.Username="ethan012";
request.Password="ethan012";

PlayFabClientAPI.LoginWithPlayFab(request,OnLoginCallback,OnErrorCallback);

error result json:

{
                
    "HttpCode": 412, 
    "HttpStatus": "Service Unavailable: PreconditionFailed", 
    "Error": 1, 
    "ErrorMessage": "{\"code\":200,\"status\":\"OK\",\"data\":{\"SessionTicket\":\"67529B907D4E74A-0-0-D84D-8D3A652B5625930-FAC2D54BECE2AA6A.B95E6372887239D3\",\"PlayFabId\":\"67529B907D4E74A\",\"NewlyCreated\":false,\"SettingsForUser\":{\"NeedsAttribution\":false},\"LastLoginTime\":\"2016-07-07T10:15:58.291Z\"}}", 
    "ErrorDetails": null, 
    "CustomData": null
}
2 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.

Wang Yichun avatar image Wang Yichun commented ·

or is there any upgrading guide doc?

0 Likes 0 ·
1807605288 avatar image 1807605288 ♦ Wang Yichun commented ·

Please consult the Release Notes to help you upgrade. The "Upgrade Warning" notes in red should address any issues you have. If you have other issues, please put them into a new thread, so we don't overload this one.

0 Likes 0 ·
1807605288 avatar image
1807605288 answered

Please update your sdk, and set PlayFabSettings.CompressApiData = false; when you set your titleId.

We tried to launch compression with the last update, but apparently we didn't handle all possible code paths.

10 |1200

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

brendan avatar image
brendan answered

The 412 error is an odd one - it implies that there was a precondition specified which wasn't valid. Also, the information in the ErrorMessage is actually the good response to logging in, so the call looks like it succeeded and returned a 200. Can you try this call in Postman to see what results you get? Can you get a wireshark or netmon capture of this call from your game?

10 |1200

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

Wang Yichun avatar image
Wang Yichun answered

Postman works well.

----------------------------

POST /Client/LoginWithPlayFab HTTP/1.1 Host: D84D.playfabapi.com Content-Type: application/json Cache-Control: no-cache Postman-Token: 811b092d-3dc0-e462-ff82-9143df0376e3 { "TitleId": "D84D", "Username": "ethan012", "Password": "ethan012" }

----------------------------

{ "code": 200, "status": "OK", "data": { "SessionTicket": "67529B907D4E74A-0-0-D84D-8D3A6D0C500F29F-A6C67700185E8965.DDD828C11D2D80DB", "PlayFabId": "67529B907D4E74A", "NewlyCreated": false, "SettingsForUser": { "NeedsAttribution": false }, "LastLoginTime": "2016-07-08T01:38:12.155Z" } }

10 |1200

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

Wang Yichun avatar image
Wang Yichun answered

Maybe we have the save question.

Question by glen yesterday

Login on Mac for new SDK error

https://community.playfab.com/questions/3662/login-on-mac-for-new-sdk-error.html

10 |1200

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

Wang Yichun avatar image
Wang Yichun answered

After I rollback the version next to the last (Release: 160627), everything turn out all right.

10 |1200

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

brendan avatar image
brendan answered

Interesting - thanks for the additional info. I'll have the tools team check into this.

10 |1200

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

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.