question

trisibo avatar image
trisibo asked

"HTTP/1.1 409 Conflict" on UpdateUserData and AddOrUpdateContactEmail, plus contact email not stored

We are getting many "ServiceUnavailable" ("HTTP/1.1 409 Conflict") errors when calling PlayFabClientAPI.UpdateUserData and PlayFabClientAPI.AddOrUpdateContactEmail. The errors don't always happen, but they seem to happen quite a lot (maybe almost 50% of the time). They don't necessarily happen for both calls at the same time. We are testing in the Unity editor, and the errors appear on two machines on different countries.

The calls are being made right after a new player is registered (we are not registering many players fast or anything like that, it's all slow manual testing). These are the calls being made when a player registers, in order:

  1. PlayFabClientAPI.LinkCustomID
  2. PlayFabClientAPI.UpdateUserData
  3. PlayFabClientAPI.WritePlayerEvent
  4. PlayFabClientAPI.AddOrUpdateContactEmail


They are made one after the other with no wait between them. Both the PlayFabClientAPI.UpdateUserData and the PlayFabClientAPI.AddOrUpdateContactEmail are retried when failed; however, when the one to update the contact email is retried, it calls the success callback but the email is never actually stored on the account; retrying the user data one works.

The user data is around 100-150 chars, and the player event data is in the same ballpark. The title id is 7A5FC.

unity3d
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

Many different players at once actually can't cause an issue like this. "Conflict" generally means that two operations are trying to make a change to the same data for a single player at the same time. If you mean those calls are all being made without waiting on any responses, we'd recommend serializing them so that you wait on the responses, to make sure that can't happen.

1 comment
10 |1200

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

trisibo avatar image trisibo commented ·

So I assume for the database the custom id, user data and contact email (and I guess other data) is part of the same player data, and thus can't be updated concurrently?

In any case, PlayFabClientAPI.AddOrUpdateContactEmail returning a successful result the second time it's called (5 seconds later) but the email not really being stored would be a bug (either in the method result or PlayFab not storing it).

0 Likes 0 ·
Gruff avatar image
Gruff answered

@Brendan, @Trisibo

Two years on and I'm experiencing similar problems with these calls following a successful link to Google account.

Even with a 500ms delay after a successful call to PlayFabClientAPI.LinkGoogleAccount, the call to PlayFabClientAPI.AddOrUpdateContactEmail sporadically fails with 409 Conflict (ServiceUnavailable).

If it succeeds then the title player contact correctly sets.

If it fails, and a second call is made after another 500ms delay, the second call "succeeds" but in fact, the title contact email is not set, so in reality it fails silently.

The initial conflict appears to arise from a server-side call to set user title name triggered by the account linking:

{ "EventName": "player_displayname_changed",

...

"SourceType": "BackEnd",

...

}

This is a bug in PlayFab. Is this the approprate place to report this?

The only workaround I have currently is to set a longer delay before the first call attempt.

10 |1200

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

Gruff avatar image
Gruff answered
@Brendan, in fact, even adding 1500ms delay on the first doesn't seem to help, and the second call always "succeeds" but really fails. Given the importance of this function, I hope this is resolved quickly.
10 |1200

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

Gruff avatar image
Gruff answered

Also, if the call follows a successful account creation with PlayFabClientAPI.AddUsernamePassword, the exact same call to PlayFabClientAPI.AddOrUpdateContactEmail sets the Mast Player Data / Publisher Player Account contact email as opposed to the Player Title Email which is set when following a successful Google account link.

I'm beginning to lose faith in PlayFab...

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.