Skip to content

Get-MgInvitation fails with html error 404 - File or directory not found. #2290

Closed

Description

This looks like it was fixed in #466. . Except it wasn't, apparently.

Description:
Running Get-MgInvitation produces a long html error instead of listing the current invitations, as the docs promise. Update-MgInvitation exhibits the same behavior.

To Reproduce

  1. Execute Get-MgInvitation with no parameters.
  2. See error :
    PS C:\WINDOWS\system32> Get-MgInvitation
    Get-MgInvitation :
<title>404 - File or directory not found.</title> <style type="text/css"> </style>

Server Error

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Status: 404 (NotFound) ErrorCode: UnknownError Date: 2023-09-06T19:47:24 Headers: Transfer-Encoding : chunked Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000 request-id : 8f3545d5-448a-4357-af79-de5d5c1a7ba4 client-request-id : c8150fca-812b-4df2-bf0c-dc4a0904d462 x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West US 2","Slice":"E","Ring":"1","ScaleUnit":"004","RoleInstance":"MW2PEPF0000E542"}} Cache-Control : private Date : Wed, 06 Sep 2023 19:47:23 GMT At line:1 char:1 + Get-MgInvitation + ~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: ({ Top = , Skip ...ndProperty = }:<>f__AnonymousTy pe4`8) [Get-MgInvitation_List], Exception + FullyQualifiedErrorId : UnknownError,Microsoft.Graph.PowerShell.Cmdlets.GetMgInvitation_List

Expected behavior

A list of current invitations, if any

Debug Output
PS C:\WINDOWS\system32> Get-MgInvitation -debug
DEBUG: [CmdletBeginProcessing]: - Get-MgInvitation begin processing with paramet
erSet 'List'.
DEBUG: [Authentication]: - AuthType: 'Delegated', TokenCredentialType: 'Interact
iveBrowser', ContextScope: 'CurrentUser', AppName: 'Microsoft Graph Command Line
Tools'.
DEBUG: [Authentication]: - Scopes: [Group.Read.All, GroupMember.ReadWrite.All, o
penid, Organization.Read.All, Organization.ReadWrite.All, profile, User.Invite.A
ll, User.Read, User.ReadWrite.All, email, Directory.ReadWrite.All].
DEBUG: ============================ HTTP REQUEST ============================

HTTP Method:
GET

Absolute Uri:
https://graph.microsoft.com/v1.0/invitations

Headers:
FeatureFlag : 00000043
Cache-Control : no-store, no-cache
User-Agent : Mozilla/5.0,(Windows NT 10.0; Microsoft Windows
10.0.22621; en-US),PowerShell/5.1.22621.1778
Accept-Encoding : gzip
SdkVersion : graph-powershell/2.4.0
client-request-id : 62ac78ff-06e6-4c32-80c7-33ea48d54f57

Body:

DEBUG: ============================ HTTP RESPONSE ============================

Status Code:
NotFound

Headers:
Transfer-Encoding : chunked
Vary : Accept-Encoding
Strict-Transport-Security : max-age=31536000
request-id : 5b4764b2-5d6e-4a97-ac02-44df51fa2f16
client-request-id : 62ac78ff-06e6-4c32-80c7-33ea48d54f57
x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West US 2","Slice":
"E","Ring":"1","ScaleUnit":"001","RoleInstance":"MW2PEPF000031CC"}}
Cache-Control : private
Date : Wed, 06 Sep 2023 20:56:23 GMT

Body:
{
"error": {
"code": "UnknownError",
"message": "\r\n<html xmlns="http://www.w3
.org/1999/xhtml">\r\n\r\n<meta http-equiv="Content-Type" content="text
/html; charset=iso-8859-1"/>\r\n<title>404 - File or directory not found.</titl
e>\r\n<style type="text/css">\r\n\r\n</st
yle>\r\n\r\n\r\n<div id="header">

Server Error

\r\n<
div id="content">\r\n <div class="content-container">\r\n

404

  • File or directory not found.

\r\n

The resource you are looking for m
ight have been removed, had its name changed, or is temporarily unavailable.</h3

\r\n

\r\n\r\n\r\n\r\n",
"innerError": {
"date": "2023-09-06T20:56:24",
"request-id": "5b4764b2-5d6e-4a97-ac02-44df51fa2f16",
"client-request-id": "62ac78ff-06e6-4c32-80c7-33ea48d54f57"
}
}
}

Get-MgInvitation :

<title>404 - File or directory not found.</title> <style type="text/css"> </style>

Server Error

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.

Status: 404 (NotFound) ErrorCode: UnknownError Date: 2023-09-06T20:56:24 Headers: Transfer-Encoding : chunked Vary : Accept-Encoding Strict-Transport-Security : max-age=31536000 request-id : 5b4764b2-5d6e-4a97-ac02-44df51fa2f16 client-request-id : 62ac78ff-06e6-4c32-80c7-33ea48d54f57 x-ms-ags-diagnostic : {"ServerInfo":{"DataCenter":"West US 2","Slice":"E","Ring":"1","ScaleUnit":"001","RoleInstance":"MW2PEPF000031CC"}} Cache-Control : private Date : Wed, 06 Sep 2023 20:56:23 GMT At line:1 char:1 + Get-MgInvitation -debug + ~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: ({ Top = , Skip ...ndProperty = }:<>f__AnonymousType4`8) [Get-MgInvitation_List], Exception + FullyQualifiedErrorId : UnknownError,Microsoft.Graph.PowerShell.Cmdlets. GetMgInvitation_List DEBUG: [CmdletEndProcessing]: - Get-MgInvitation end processing.

Module Version
ModuleType Version Name ExportedCommands


Manifest 2.4.0 Microsoft.Graph

Environment Data
Name Value


PSVersion 5.1.22621.1778
PSEdition Desktop
PSCompatibleVersions {1.0, 2.0, 3.0, 4.0...}
BuildVersion 10.0.22621.1778
CLRVersion 4.0.30319.42000
WSManStackVersion 3.0
PSRemotingProtocolVersion 2.3
SerializationVersion 1.1.0.1

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context
Update-MgInvitation has the same behavior.

Activity

  1. peombwa commented on Sep 6, 2023

    @peombwa
    Member

    Thanks for following up on this.

    As explained at #262 (comment), per the API reference, only New-MgInvitation (POST /Invitations) is supported and you shouldn't be using Get-MgInvitation as the API does currently not support it.

    The issue has been transferred to the metadata repo at microsoftgraph/msgraph-metadata#427 as the unsupported API paths are currently described in the OpenAPI description used to generate the SDKs.

  2. peombwa commented on Sep 6, 2023

    @peombwa
    Member
  3. ToddShelton commented on Sep 7, 2023

    @ToddShelton
    Author

    Thanks for the quick resolution.
    FYI all the PS docs for the CRUD operations are live (they don't mention that those functions are unsupported).

    Todd

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions