Skip to content

Bug UnhandledPromiseRejectionWarning - 404 when creating a team using teams team add #1891

@plamber

Description

@plamber

Description

When executing the m365 teams team add --name 'Architecutre' --description 'Architecture' command you might receive 404 error message like this one:

UnhandledPromiseRejectionWarning: StatusCodeError: 404 - {"error":{"code":"NotFound","message":"No team found with Group Id 58c19f12-6bb5-4846-8ccd-36d9eb04ef2a","i nnerError":{"date":"2020-10-25T08:59:38","request-id":"083e431a-deb6-4f85-987e-a59487c18cea","client-request-id":"083e431a-deb6-4f85-987e-a59487c18cea"}}}

The Team is being created but the operation to retrieve group information fails because graph still does not have the group available when querying it.

The suggestion is to put a try catch with retries (for example up to 5 with a sleep time of 5 seconds) until the result is correctly returned.

Steps to reproduce

  • execute the command m365 teams team add --name 'Architecutre' --description 'Architecture'
  • It will throw an exception
  • The team is created but the command fails due to the lines trying to return the group object

Expected result

  • Command does not return an exception

Environment

  • Windows 10
  • PowerShell
  • Latest Microsoft 365 CLI

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions