question

Dale Strickler avatar image
Dale Strickler asked

"No group profile found at ..." error when deleting groups or getting entity tokens, why?

I have a Unity project to help me understand how to design with Entities in general and Group Entities more specifically. My code does nothing other than exercise the API via the Unity SDK and a game scene UI.

This code works fine to create the group:

public void CreateGroupButton()

    {

        PlayFab.GroupsModels.CreateGroupRequest _request = new PlayFab.GroupsModels.CreateGroupRequest

        {

            GroupName = EntityIdInputField.text

        };

        PlayFabGroupsAPI.CreateGroup(_request, ProcessCreateGroup, ProcessError);

    }

When I try to delete the group with this code:

 public void DeleteGroupButton()

    {

        Debug.Log("Deleting: " + EntityIdInputField.text);

        PlayFab.GroupsModels.DeleteGroupRequest _request = new PlayFab.GroupsModels.DeleteGroupRequest

        {

            Group = new PlayFab.GroupsModels.EntityKey

            {

                Id = EntityIdInputField.text

            }

        };

        PlayFabGroupsAPI.DeleteGroup(_request, null, ProcessError);

    }

The ProcessError is called and the PlyFabeError.ErrorMessage is "No group profile found at [EntityIdInputField.text]"

I am getting the same error message when I try to get an entity token for the group with this code:

 public void GetEntityTokenButton()

    {

        GetEntityTokenRequest _request = new GetEntityTokenRequest();

        _request.Entity = new PlayFab.AuthenticationModels.EntityKey

        {

            Id = EntityIdInputField.text,

            Type = "group"

        };

        PlayFabAuthenticationAPI.GetEntityToken(_request, ProcessGetEntityTokenSuccess, ProcessError);

    }

I have been reading a lot and I am just not understanding what the error message is trying to tell me.

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

·
Seth Du avatar image
Seth Du answered

This issue can be caused by the incorrect entity ID.

The property GroupName in the CreateGroupRequest is not an Entity ID and it is a name that you defined. After CreateGroup is successfully called, you can retrieve the Entity (Group) ID from OnSuccessCallBack via OnSuccessCallBack.Group.Id. See more information in the response part of this documentation.

I am not sure if you have changed the text in EntityIdInputField, but the best way to debug this issue is print out EntityIdInputField every time and compare it with the group ID in the Game manager.

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

Dale Strickler avatar image Dale Strickler commented ·

I have checked names closely and I think they are fine. I will walk through it all one more time. I am a little confused why it is a profile missing error. When you GetGroupToken for a name that does not exist you get something like no name found. The messaging I am finding confusing. Off to double check the names.

Ok checked one more time. The names are good:

Debug Log:

Get Group Token Success for JupCohort.20181225.234614

Produces Success: => Token: A79A53969CB049F

Deleting: JupCohort.20181225.234614

Produces error: No group profile found at JupCohort.20181225.234614

Code same as in the original post. The EntityIdInputField.text is the value "JupCohort.20181225.234614" in this test case.

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ Dale Strickler commented ·

If entity ID of the group you created is "A79A53969CB049F", you should delete the group using "A79A53969CB049F" in the delete request instead of using "JupCohort.20181225.234614", which also means EntityIdInputField.text should be "A79A53969CB049F".

It's better to know the differences between Entity ID, Group Name and Entity Token. I noticed that you mentioned "Produces Success: => Token: A79A53969CB049F" and I am guessing this is the output when you try to debug Successful Callback for the group creation. The output is not a Entity Token, instead, it is just an Entity (Group) ID, which is the key that you should use in other Group related APIs.

We highly recommend you to use Postman to test PlayFab APIs. It is convenient for you to observe callbacks in Postman. Please see the tutorials on https://api.playfab.com/docs/tutorials/execute-playfab-api-via-postman. Here is an player login example, you can see the Entity Token is quite different.

0 Likes 0 ·
Dale Strickler avatar image Dale Strickler Seth Du ♦ commented ·

I am getting closer. I just find it rough when the examples seem out of data. The code on this page: https://api.playfab.com/docs/tutorials/entities/entity-groups does not compile when using the 2.58.181218 Unity SDK.

I would love to have a full Unity project I could download that exercised Groups. I find Postman and HTTP base tests ok --- But! They do nothing for learning the SDK structures or the recommend C# idioms.

Based on the errors the example throws it also makes sense to me why the terms are confusing, clearly the design of entities is still in significant flux. The way the page I link above reads does not seem to align well with the API as I read them. But maybe I am missing something. Maybe the description is out of date...

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.