Question

In my project, there is a requirement to create Site Collection with Office 365 group, so I have used following method CreateUnifiedGroup of OfficeDevPnP.Core.Framework.Graph namespace. Here is the sample code that I have used:

var title = "Dev POC Test ";
var description = "Some description of site goes here";
var group = UnifiedGroupsUtility.CreateUnifiedGroup(title, description,
                                                Regex.Replace(title, @"[^0-9a-zA-Z:,]+", ""), accessToken,
                                                groupLogo: null, isPrivate: true, createTeam: true, retryCount: 10, delay: 500);

Console.WriteLine(group.SiteUrl);

Well, previously above code was working fine but now it is giving rare error message at function calling CreateUnifiedGroup like below:

System.ApplicationException: Exception while invoking endpoint https://graph.microsoft.com/v1.0/groups/9d099dfd-1028-4f55-9dfb-fc4863aabeaf/team. ---> System.Web.HttpException: {
  "error": {
    "code": "NotFound",
    "message": "Failed to execute MS Graph backend request GetGroupInternalApiRequest. The server failed to respond correctly. Response Code: NotFound, Reason: Reason: Not Found, Correlation headers: request-id: 559dd0c2-2a91-40bd-8630-0cdb180772ad\r\nclient-request-id: 559dd0c2-2a91-40bd-8630-0cdb180772ad\r\nx-ms-ags-diagnostic: {\"ServerInfo\":{\"DataCenter\":\"South Central US\",\"Slice\":\"SliceC\",\"Ring\":\"3\",\"ScaleUnit\":\"000\",\"RoleInstance\":\"AGSFE_IN_14\"}}\r\nDate: Tue, 13 Oct 2020 01:48:53 GMT\r\n",
    "innerError": {
      "date": "2020-10-13T01:48:54",
      "request-id": "c4da2078-d915-47c2-930b-a48da78e4bdf",
      "client-request-id": "c4da2078-d915-47c2-930b-a48da78e4bdf"
    }
  }
}
   --- End of inner exception stack trace ---
   at OfficeDevPnP.Core.Framework.Graph.GraphHttpClient.MakeHttpRequest[TResult](String httpMethod, String requestUrl, String accept, Object content, String contentType, String accessToken, Func`2 resultPredicate)
   at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.<>c__DisplayClass18_0.<CreateTeam>b__0()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.<CreateTeam>d__18.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.<>c__DisplayClass4_0.<<CreateUnifiedGroup>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OfficeDevPnP.Core.Framework.Graph.UnifiedGroupsUtility.CreateUnifiedGroup(String displayName, String description, String mailNickname, String accessToken, String[] owners, String[] members, Stream groupLogo, Boolean isPrivate, Boolean createTeam, Int32 retryCount, Int32 delay)

I understand this has something to do with Microsoft's server, but has anyone encountered such error before? Can we do something to resolve this issue?

Any help would be much appreciated!

No correct solution

OTHER TIPS

I can reproduce this error, it was failed during the stage of Team provision. In fact the group has been created, you can check it through the admin centre.

This error also occurs on PowerShell cmdlets New-PnPUnifiedGroup, I believe it's the same cause and come from below limit:

enter image description here

A workaround is to create a group without CreateTeam parameter, after that invoke teams creation from the graph directly. Or you can directly increase the delay time.

You can directly send a request to create a team via HTTP client as the access token is already here.

BR

Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top