Skip to content

[BUG] New-PnPTeamsTeam sporadically returns "Conflict (409): Team already exists" #3964

@zapftho

Description

@zapftho

Reporting an Issue or Missing Feature

We are using PnP Powershell 2.3.0 for provisioning of new Teams within one of our Azure Function Apps. For the New-PnPTeamsTeam cmdlet we have seen the strange behavior that this is sporadically (maybe in 1 out of 20 runs) failing with the error "Conflict (409): Team already exists" even though I can guarantee that this Team does not exist at this point of time. I have also checked what error occurs if I create another Team with the same mail nickname which will give me a more specific error than the one that we are seeing (using the same mailnickname twice will cause "New-PnPTeamsTeam: Bad Request (400): Another object with the same value for property mailNickname already exists.")

After checking the failed creation I can see that the Team got created nevertheless so the error also is misleading. It looks to me that during the creation of the Team there might be some retries or else happening within the Framework which are causing this error.

Is anyone else seeing the same behavior?

Steps to reproduce behavior

This is the line of code that fails with Conflict 409 sporadically

New-PnPTeamsTeam -DisplayName $TeamDisplayName -Description $TeamDescription -MailNickName $MailNickName -Visibility $Visibility -Owners $TeamOwners -Members $TeamMembers -AllowAddRemoveApps $false -AllowChannelMentions $true -AllowCreateUpdateChannels $false -AllowCreateUpdateRemoveConnectors $false -AllowCreateUpdateRemoveTabs $false -AllowCustomMemes $true -AllowDeleteChannels $false -AllowGiphy $true -AllowGuestCreateUpdateChannels $false -AllowGuestDeleteChannels $false -AllowOwnerDeleteMessages $false -AllowStickersAndMemes $true -AllowTeamMentions $true -AllowUserDeleteMessages $false -AllowUserEditMessages $false -GiphyContentRating "Moderate" -ShowInTeamsSearchAndSuggestions $true

What is the version of the Cmdlet module you are running?

2.3.0

Which operating system/environment are you running PnP PowerShell on?

  • Windows
  • Linux
  • MacOS
  • Azure Cloud Shell
  • Azure Functions
  • Other : please specify

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions