[BUG] New-PnPTeamsTeam sporadically returns "Not Found (404): No Team found with Group id" #4757
Open
1 of 6 tasks
Labels
bug
Something isn't working
Reporting an Issue or Missing Feature
Since yesterday we are facing issues with our Teams provisioning which relies on PnP Powershell. In our scripts we are using New-PnPTeamsTeam cmdlet and most of the times it is working fine. However, in some cases the command returns an error "Not Found (404): No Team found with Group id ". This has been working fine for quite a while now and suddenly started to behave like mentioned.
As we are currently using 2.5.0 version of PnP Powershell I cannot outline if a later version might have fixed this. I have updated to 2.12.0 today, lets see if the issues continue to appear during the next days. But maybe anyone else is facing the same issue and can confirm it?
Expected behavior
New-PnPTeamsTeam finishes without error and returns the created team.
Actual behavior
New-PnPTeamsTeam sporadically fails with error "Not Found (404): No Team found with Group id "
Full Error (Group ID has been anonymized):
Exception of type 'PnP.PowerShell.Commands.Model.Graph.GraphException' was thrown. Data : System.Collections.ListDictionaryInternal Source : PnP.PowerShell HResult : -2146233088 StackTrace : at PnP.PowerShell.Commands.Utilities.REST.GraphHelper.SendMessageAsync(PnPConnection connection, HttpRequestMessage message, String accessToken) in c:\build\src\Commands\Utilities\REST\GraphHelper.cs:line 344 at PnP.PowerShell.Commands.Utilities.REST.GraphHelper.PostInternalAsync[T](PnPConnection connection, String url, String accessToken, HttpContent content, IDictionary
2 additionalHeaders, Boolean propertyNameCaseInsensitive) in c:\build\src\Commands\Utilities\REST\GraphHelper.cs:line 298 at PnP.PowerShell.Commands.Utilities.REST.GraphHelper.PostAsync[T](PnPConnection connection, String url, T content, String accessToken) in c:\build\src\Commands\Utilities\REST\GraphHelper.cs:line 275 at PnP.PowerShell.Commands.Utilities.TeamsUtility.NewTeamAsync(String accessToken, PnPConnection connection, String groupId, String displayName, String description, String classification, String mailNickname, GroupVisibility visibility, TeamCreationInformation teamCI, String[] owners, String[] members, Guid[] sensitivityLabels, TeamsTemplateType templateType, Nullable
1[] resourceBehaviorOptions) in c:\build\src\Commands\Utilities\TeamsUtility.cs:line 257 at PnP.PowerShell.Commands.Teams.NewTeamsTeam.ExecuteCmdlet() in c:\build\src\Commands\Teams\NewTeamsTeam.cs:line 113 at PnP.PowerShell.Commands.Base.PnPConnectedCmdlet.ProcessRecord() in c:\build\src\Commands\Base\PnPConnectedCmdlet.cs:line 53 CategoryInfo : WriteError: (:) [New-PnPTeamsTeam], GraphException FullyQualifiedErrorId : EXCEPTION,PnP.PowerShell.Commands.Teams.NewTeamsTeam ErrorDetails : Not Found (404): No Team found with Group id: xxxx-xxxx-xxxx-xxxx InvocationInfo : MyCommand : New-PnPTeamsTeam ScriptLineNumber : 311 OffsetInLine : 37 HistoryId : 1 ScriptName : C:\home\site\wwwroot\CreateNewTeam\run.ps1 Line : "ProjectTeam" {$team = New-PnPTeamsTeam -DisplayName $TeamDisplayName -Description $TeamDescription -MailNickName $SharePointSiteUrlAndSiteId.SiteID -Visibility $Visibility -Owners $TeamOwners -Members $TeamMembers -AllowAddRemoveApps $false -AllowChannelMentions $true -AllowCreateUpdateChannels $true -AllowCreateUpdateRemoveConnectors $false -AllowCreateUpdateRemoveTabs $true -AllowCustomMemes $true -AllowDeleteChannels $true -AllowGiphy $true -AllowGuestCreateUpdateChannels $false -AllowGuestDeleteChannels $false -AllowOwnerDeleteMessages $false -AllowStickersAndMemes $true -AllowTeamMentions $true -AllowUserDeleteMessages $false -AllowUserEditMessages $false -GiphyContentRating "Moderate" -ShowInTeamsSearchAndSuggestions $true -Connection $pnpAdminConnection -ErrorAction Stop} PositionMessage : At C:\home\site\wwwroot\CreateNewTeam\run.ps1:311 char:37 + … m" {$team = New-PnPTeamsTeam -DisplayName $TeamDisplayName -Descripti … + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PSScriptRoot : C:\home\site\wwwroot\CreateNewTeam PSCommandPath : C:\home\site\wwwroot\CreateNewTeam\run.ps1 InvocationName : New-PnPTeamsTeam CommandOrigin : Internal ScriptStackTrace : at , C:\home\site\wwwroot\CreateNewTeam\run.ps1: line 311 PipelineIterationInfoSteps to reproduce behavior
$team = New-PnPTeamsTeam -DisplayName $TeamDisplayName -Description $TeamDescription -MailNickName $SharePointSiteUrlAndSiteId.SiteID -Visibility $Visibility -Owners $TeamOwners -Members $TeamMembers -AllowAddRemoveApps $false -AllowChannelMentions $true -AllowCreateUpdateChannels $true -AllowCreateUpdateRemoveConnectors $false -AllowCreateUpdateRemoveTabs $true -AllowCustomMemes $true -AllowDeleteChannels $true -AllowGiphy $true -AllowGuestCreateUpdateChannels $false -AllowGuestDeleteChannels $false -AllowOwnerDeleteMessages $false -AllowStickersAndMemes $true -AllowTeamMentions $true -AllowUserDeleteMessages $false -AllowUserEditMessages $false -GiphyContentRating "Moderate" -ShowInTeamsSearchAndSuggestions $true -Connection $pnpAdminConnection -ErrorAction Stop
What is the version of the Cmdlet module you are running?
2.5.0
Which operating system/environment are you running PnP PowerShell on?
The text was updated successfully, but these errors were encountered: