Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by esenkleiter · Nov 30, 2020 at 05:27 AM · apisTitle Data

PlayFabServerAPI GetTitleInternalDataAsync Duplicate Key Error

Hello,

we. get the following Exception while testing nearly simultaneous access to title data.

Object reference not set to an instance of an object.

We assume this may be a thread bug here. We call the PlayFabServerAPI from a local azure function, to get some tile data. Thanks for your help.

The corresponding stack trace:

at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)\n   

at System.Collections.Generic.Dictionary`2.set_Item(TKey key, TValue value)\n   

at PlayFab.PluginManager.GetPluginInternal(PluginContract contract, String instanceName)\n   

at PlayFab.PluginManager.GetPlugin[T](PluginContract contract, String instanceName)\n   

at PlayFab.Internal.PlayFabHttp._DoPost(String fullPath, PlayFabRequestCommon request, String authType, String authKey, Dictionary`2 extraHeaders, PlayFabApiSettings instanceSettings)\n   

at PlayFab.Internal.PlayFabHttp.DoPost(String urlPath, PlayFabRequestCommon request, String authType, String authKey, Dictionary`2 extraHeaders, PlayFabApiSettings instanceSettings)\n   

at PlayFab.PlayFabServerAPI.GetTitleInternalDataAsync(GetTitleDataRequest request, Object customData, Dictionary`2 extraHeaders)\n   

at GoGBackend.Controller.MiniGameController.GetMiniGames()
Comment

People who like this

0 Show 7
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Citrus Yan · Nov 30, 2020 at 08:39 AM 0
Share

May I have the code snippet that reproduces this issue? Please also specify the version of the PlayFab SDK you're using.

avatar image esenkleiter · Dec 01, 2020 at 06:01 AM 0
Share

NuGet- PlayFabAllSDK 1.80.200901

var playerTitleData = await PlayFabServerAPI.GetTitleInternalDataAsync(new GetTitleDataRequest
            {
                Keys = new List<string>
                {
                    "miniGameCollection"
                }
            });

avatar image Citrus Yan esenkleiter · Dec 01, 2020 at 09:45 AM 0
Share

I was not able to reproduce this error using PlayFabAllSDK 1.80.200901 in my FunctionApp project, could you please provide a complete reproduce steps so that I can investigate further?

avatar image esenkleiter · Dec 02, 2020 at 06:28 AM 0
Share

Well we're using the ExecuteFunction script for executing the function locally. Furthermore we make two parallel calls to our "local" azure function. The exception is not always thrown. It seems to be a tricky thread-bug. The PlayFabServerAPI is generally thread safe, right?

avatar image esenkleiter · Dec 02, 2020 at 01:39 PM 0
Share

Maybe you have a great solution for not accessing the title data on every azure function call. We thought about a static var holding the data, but what about updating this static var.. Do you have a best practice here for accessing Title Data in Azure Functions?

avatar image Citrus Yan esenkleiter · Dec 04, 2020 at 09:02 AM 0
Share

Yes, they're generally thread safe, and, I also tried using the ExecuteFunction script for executing the function locally and make nearly simultaneous requests to the local Function app, however, I cannot reproduce the same issue:(

Looking at the stack track you provided, looks like the error happened at:

PlayFab.PluginManager.GetPluginInternal(PluginContract contract,String instanceName)

Have you find anything regarding this issue?

avatar image Citrus Yan esenkleiter · Dec 04, 2020 at 09:05 AM 0
Share

And, accessing Title Data per request won't be a problem as it was designed as Global Constant/Static Data.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Can automation script from one title query another title? 2 Answers

    unreal engine Get Title data 1 Answer

    Tile Creation API 1 Answer

    Create Matchmaking Ticket - Bad Request, Invalid input parameters. 1 Answer

    Is there an API to delete a DropTable? 1 Answer

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges