pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
916 stars 323 forks source link

Bug report: I cannot create a new Viva engage community #6408

Open martinlingstuyl opened 1 week ago

martinlingstuyl commented 1 week ago

Priority

(Low) Something is a little off

Description

I've tried to create a new viva engage community, running:

m365 viva engage community add --displayName "Some name" --privacy private --adminEntraUserNames "martin@blimped.nl" --verbose --description "some description"

I'm getting the following error:

Error: Unable to find target address

Steps to reproduce

Run the script

Expected results

The community is created

Actual results

It's not created

Diagnostics

Executing command viva engage community add with options {"options":{"displayName":"Some community name","privacy":"private","adminEntraUserNames":"martin@blimped.nl","verbose":true,"description":"Some community description","debug":true,"output":"text"}}
Executing command as 'martin@blimped.nl', appId: <appId>, tenantId: <tenantId>
Creating a Viva Engage community with display name 'Some community name'...
Existing access token  Returning...
Request:
{
  "url": "https://graph.microsoft.com/v1.0/$batch",
  "method": "post",
  "headers": {
    "Accept": "application/json;odata.metadata=none",
    "user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/10.0.0",
    "accept-encoding": "gzip, deflate",
    "X-ClientService-ClientTag": "M365CLI:10.0.0",
    "authorization": "Bearer "
  },
  "responseType": "json",
  "decompress": true,
  "data": {
    "requests": [
      {
        "id": 1,
        "method": "GET",
        "url": "/users/martin%40blimped.nl?$select=id",
        "headers": {
          "accept": "application/json;odata.metadata=none"
        }
      }
    ]
  }
}
Response:
{
  "url": "https://graph.microsoft.com/v1.0/$batch",
  "status": 200,
  "statusText": "OK",
  "headers": {
    "transfer-encoding": "chunked",
    "content-type": "application/json",
    "vary": "Accept-Encoding",
    "strict-transport-security": "max-age=31536000",
    "request-id": "eea16dce-bcfa-4914-bbee-5143d7930705",
    "client-request-id": "eea16dce-bcfa-4914-bbee-5143d7930705",
    "x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"West Europe\",\"Slice\":\"E\",\"Ring\":\"5\",\"ScaleUnit\":\"003\",\"RoleInstance\":\"AM1PEPF000105C8\"}}",
    "date": "Fri, 04 Oct 2024 11:20:33 GMT"
  },
  "data": {
    "responses": [
      {
        "id": "1",
        "status": 200,
        "headers": {
          "Cache-Control": "no-cache",
          "x-ms-resource-unit": "1",
          "OData-Version": "4.0",
          "Content-Type": "application/json;odata.metadata=none;odata.streaming=true;IEEE754Compatible=false;charset=utf-8"
        },
        "body": {
          "id": "1d860e28-9f51-475c-8326-377bc897d7ed"
        }
      }
    ]
  }
}
Existing access token . Returning...
Request:
{
  "url": "https://graph.microsoft.com/beta/employeeExperience/communities",
  "method": "post",
  "headers": {
    "Accept": "application/json;odata.metadata=none",
    "Content-Type": "application/json",
    "user-agent": "NONISV|SharePointPnP|CLIMicrosoft365/10.0.0",
    "accept-encoding": "gzip, deflate",
    "X-ClientService-ClientTag": "M365CLI:10.0.0",
    "authorization": "Bearer "
  },
  "responseType": "json",
  "decompress": true,
  "data": {
    "displayName": "Some community name",
    "description": "Some community description",
    "privacy": "private",
    "owners@odata.bind": [
      "https://graph.microsoft.com/beta/users/1d860e28-9f51-475c-8326-377bc897d7ed"
    ]
  }
}
Request error:
{
  "url": "https://graph.microsoft.com/beta/employeeExperience/communities",
  "status": 500,
  "statusText": "Internal Server Error",
  "headers": {
    "transfer-encoding": "chunked",
    "content-type": "application/json",
    "vary": "Accept-Encoding",
    "strict-transport-security": "max-age=31536000",
    "request-id": "71bfdd59-b1a6-497d-b22d-cbc86a9c4085",
    "client-request-id": "71bfdd59-b1a6-497d-b22d-cbc86a9c4085",
    "x-ms-ags-diagnostic": "{\"ServerInfo\":{\"DataCenter\":\"West Europe\",\"Slice\":\"E\",\"Ring\":\"5\",\"ScaleUnit\":\"003\",\"RoleInstance\":\"AM1PEPF000105C8\"}}",
    "date": "Fri, 04 Oct 2024 11:20:33 GMT"
  },
  "error": {
    "error": {
      "code": "InternalServerError",
      "message": "Unable to find target address",
      "innerError": {
        "date": "2024-10-04T11:20:33",
        "request-id": "71bfdd59-b1a6-497d-b22d-cbc86a9c4085",
        "client-request-id": "71bfdd59-b1a6-497d-b22d-cbc86a9c4085"
      }
    }
  }
}

Timings:
api: 223.5406ms
core: 10.1182ms
command: 272.3896ms
options: 0.2297ms
total: 284.355ms
validation: 1.185ms
Error: Unable to find target address

CLI for Microsoft 365 version

10 (beta)

nodejs version

20.9.0

Operating system (environment)

Windows

Shell

PowerShell

cli doctor

authMode         : deviceCode
cliConfig        : {"autoOpenLinksInBrowser":true,"copyDeviceCodeToClipboard":true,"output":"text","printErrorsAsPlainText":true,"prompt":true,"showHelpOnFailure":true,"showSpinner":true,"helpMode":"options","clientId":"d74def67-6c86-4249-ac76-d8a26cc4b383","tenantId":"7b294b30-baf5-4e9e-a5b1-b4c149417bfa"}
cliEntraAppId    : 59c361e4-33c3-44e3-8477-de204348291c
cliEntraAppTenant: single
cliEnvironment   : 
cliVersion       : 10.0.0
nodeVersion      : v20.9.0
os               : {"platform":"win32","version":"Windows 11 Enterprise","release":"10.0.26120"}
roles            : []
scopes           : {"https://graph.microsoft.com":["AllSites.FullControl","AppCatalog.ReadWrite.All","AuditLog.Read.All","Bookings.Read.All","Calendars.Read","ChannelMember.ReadWrite.All","ChannelMessage.Read.All","ChannelMessage.ReadWrite","ChannelMessage.Send","ChannelSettings.ReadWrite.All","Chat.ReadWrite","Community.ReadWrite.All","Directory.AccessAsUser.All","Directory.ReadWrite.All","ExternalConnection.ReadWrite.All","ExternalItem.ReadWrite.All","Group.ReadWrite.All","IdentityProvider.ReadWrite.All","InformationProtectionPolicy.Read","Mail.Read.Shared","Mail.ReadWrite","Mail.Send","Notes.ReadWrite.All","OnlineMeetingArtifact.Read.All","OnlineMeetings.ReadWrite","OnlineMeetingTranscript.Read.All","PeopleSettings.ReadWrite.All","Place.Read.All","Policy.Read.All","RecordsManagement.ReadWrite.All","Reports.Read.All","RoleAssignmentSchedule.ReadWrite.Directory","RoleEligibilitySchedule.Read.Directory","SecurityEvents.Read.All","ServiceHealth.Read.All","ServiceMessage.Read.All","ServiceMessageViewpoint.Write","Sites.Read.All","Tasks.ReadWrite","Team.Create","TeamMember.ReadWrite.All","TeamsAppInstallation.ReadWriteForUser","TeamSettings.ReadWrite.All","TeamsTab.ReadWrite.All","TermStore.ReadWrite.All","User.Invite.All","User.ReadWrite.All","profile","openid","email"]}

Additional Info

No response

waldekmastykarz commented 1 week ago

Our code seems to be matching the documentation, so it could be an issue related to the underlying API that's beyond our control. Let's keep an eye out on it, but I wouldn't qualify it as bug.

milanholemans commented 1 week ago

Our code seems to be matching the documentation, so it could be an issue related to the underlying API that's beyond our control. Let's keep an eye out on it, but I wouldn't qualify it as bug.

It's using the beta endpoint indeed. Maybe something got messed up there.

milanholemans commented 1 week ago

It seems like this endpoint is now available in Microsoft Graph v1.0. We should consider moving it to v1.0