question

justindooley avatar image
justindooley asked

server.AddSharedGroupMember returns Invalid Shared Group ID

I'm trying to have a cloudscript add a user to a shared group. I get a error saying the shared group is ot there even though the group is easily searchable. My request looks like this:

var AddMembersRequest = {
        "PlayFabIds": [args.PlayerId],
	"SharedGroupId": "837EA8718060782BTWMOVKWW0LR1QPER"
};
log.debug(JSON.stringify( server.AddSharedGroupMembers(AddMembersRequest) ) );

The result is:

{
  "code":200,
  "status":"OK",
  "data": {
    "FunctionName":"InvitePlayerToGame",
    "Revision":107,
    "Logs":[ {
      "Level":"Debug",
      "Message":"{\"DataVersion\":136}"
    }
    ,
    {
      "Level":"Error",
      "Message":"PlayFab API request error",
      "Data": {
        "api":"/Server/AddSharedGroupMembers",
        "request": {
          "PlayFabIds": ["B9090134CB40C4EB"], "SharedGroupId": "837EA8718060782BTWMOVKWW0LR1QPER"
        }
        ,
        "result":null,
        "apiError": {
          "code": 400, "status": "BadRequest", "error": "InvalidSharedGroupId", "errorCode": 1088, "errorMessage": "InvalidSharedGroupId", "errorHash": null, "errorDetails": null
        }
      }
    }
    ],
    "ExecutionTimeSeconds":0.10025529999999999,
    "ProcessorTimeSeconds":0.016,
    "MemoryConsumedBytes":57576,
    "APIRequestsIssued":4,
    "HttpRequestsIssued":0,
    "Error": {
      "Error": "Cloud ScriptAPIRequestError", "Message": "The script called a PlayFab API, which returned an error. See the Error logs for details.", "StackTrace": "Error\n at Object.server_request (Script: 180: 24)\n at Object.server.AddSharedGroupMembers (Script: 498: 78)\n at handlers.InvitePlayerToGame (2364-main.js: 264: 35)\n at Object.invokeFunction (Script: 116: 33)"
    }
  }
}

If required the title ID for my project is: 2364

CloudScriptShared Group Data
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

·
Citrus Yan avatar image
Citrus Yan answered

The server.AddSharedGroupMembers API worked fine via CloudScript in my title, and your title looks alright as well. Could you please try calling the request again in case that there was a partial glitch in PlayFab servers, if this issue still occurs, we may need to report this to engineering team to investigate, thanks.

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

justindooley avatar image justindooley commented ·

Still happening. Same thing is also happening with GetSharedGroupData actually. This all works from a client API but the cloud scrips seems to break.

Here is the GetSharedGroup Data code block that is failing.


//Players is a field that contains PlayfabIDs of people with the Role Player
var GroupPlayersRequest = {
	"GetMembers": false,
        "Keys":["Players"],
        "SharedGroupId":args.GroupId
}
    
var GroupPlayersResult =  server.GetSharedGroupData(GroupPlayersRequest);

Resulting Log:

{
    "Level":"Error",
    "Message":"PlayFab API request error",
    "Data": {
        "api":"/Server/AddSharedGroupMembers",
        "request": {
            "PlayFabIds": ["B9090134CB40C4EB"], "SharedGroupId": "837EA8718060782BTWMOVKWW0LR1QPER"
        }
        ,
        "result":null,
        "apiError": {
            "code": 400, "status": "BadRequest", "error": "InvalidSharedGroupId", "errorCode": 1088, "errorMessage": "InvalidSharedGroupId", "errorHash": null, "errorDetails": null
        }
    }
}
0 Likes 0 ·
Citrus Yan avatar image Citrus Yan justindooley commented ·

Yes, I can confirm the issue that both GetSharedGroupData and AddSharedGroupMembers returns InvalidSharedGroupId in your title. And I've reported this issue to the engineering team for investigation, any updates will keep you informed.

By the way, for what it's worth, the resulting log you posted is about /Server/AddSharedGroupMembers actually, but never mind, I can see the right log from your title:)

0 Likes 0 ·
justindooley avatar image justindooley Citrus Yan commented ·

So it is, sorry about that if it caused any confusion. Glad that I could bring it to your attention. It cost us some extra development time but we have worked around it by calling the functions from the client instead. It's just adding a small amount of latency having to wait for other requests to finish and return. Not a big deal in the long run. Just a bit different than planned.

0 Likes 0 ·
Show more comments

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.