Skip to content

Remove-MgApplication returns error, app is successfully removed #354

Closed

Description

With latest modules (0.9.1):

▶ Remove-MgApplication -ApplicationId "443a418b-b373-4219-a71b-1f7447ea6ff5" -Debug
DEBUG: CmdletBeginProcessing:
DEBUG: CmdletProcessRecordStart:

Confirm
Are you sure you want to perform this action?
Performing the operation "Remove-MgApplication_Delete1" on target "Call remote 'ApplicationsApplicationDeleteApplication1'
operation".
[Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is "Y"): y
DEBUG: CmdletProcessRecordAsyncStart:
DEBUG: CmdletGetPipeline:
DEBUG: CmdletBeforeAPICall:
DEBUG: URLCreated: https://graph.microsoft.com/beta/applications/443a418b-b373-4219-a71b-1f7447ea6ff5
DEBUG: RequestCreated: https://graph.microsoft.com/beta/applications/443a418b-b373-4219-a71b-1f7447ea6ff5
DEBUG: HeaderParametersAdded: https://graph.microsoft.com/beta/applications/443a418b-b373-4219-a71b-1f7447ea6ff5
DEBUG: BeforeCall:
DEBUG: ResponseCreated:
DEBUG: BeforeResponseDispatch:
DEBUG: CmdletProcessRecordAsyncEnd:
DEBUG: CmdletException: InvalidOperationException - The stream was already consumed. It cannot be read again. :    at System.Net.Http.HttpConnectionResponseContent.ConsumeStream()
   at System.Net.Http.HttpConnectionResponseContent.SerializeToStreamAsync(Stream stream, TransportContext context, CancellationToken cancellationToken)
   at System.Net.Http.HttpContent.CopyToAsyncCore(ValueTask copyTask)
   at Microsoft.Graph.PowerShell.HttpMessageFormatter.SerializeToStreamAsync(Stream stream, TransportContext context)
   at System.Net.Http.HttpContent.LoadIntoBufferAsyncCore(Task serializeToStreamTask, MemoryStream tempBuffer)
   at System.Net.Http.HttpContent.WaitAndReturnAsync[TState,TResult](Task waitTask, TState state, Func`2 returnFunc)
   at Microsoft.Graph.PowerShell.Module.Finally(String id, CancellationToken cancellationToken, Func`1 getEventData, Func`4 signal)
   at Microsoft.Graph.PowerShell.Module.EventHandler(String id, CancellationToken cancellationToken, Func`1 getEventData, Func`4 signal, InvocationInfo invocationInfo, String parameterSetName, Exception exception)
   at Microsoft.Graph.PowerShell.Module.Signal(String id, CancellationToken token, Func`1 getEventData, Func`4 signal, InvocationInfo invocationInfo, String parameterSetName, Exception exception)
   at Microsoft.Graph.PowerShell.Cmdlets.RemoveMgApplication_Delete1.Microsoft.Graph.PowerShell.Runtime.IEventListener.Signal(String id, CancellationToken token, Func`1 messageData)
   at Microsoft.Graph.PowerShell.IdentityApplication.ApplicationsApplicationDeleteApplication1_Call(HttpRequestMessage request, Func`2 onNoContent, Func`3 onDefault, IEventListener eventListener, ISendAsync sender)
   at Microsoft.Graph.PowerShell.IdentityApplication.ApplicationsApplicationDeleteApplication1(String applicationId, String ifMatch, Func`2 onNoContent, Func`3 onDefault, IEventListener eventListener, ISendAsync sender)
   at Microsoft.Graph.PowerShell.Cmdlets.RemoveMgApplication_Delete1.ProcessRecordAsync()
   at Microsoft.Graph.PowerShell.Cmdlets.RemoveMgApplication_Delete1.ProcessRecordAsync()
Remove-MgApplication_Delete1: The stream was already consumed. It cannot be read again.
DEBUG: CmdletProcessRecordEnd:
DEBUG: CmdletEndProcessing:

Activity

  1. jasonjoh commented on Aug 28, 2020

    @jasonjoh
    MemberAuthor

    After running the command, try to retrieve the application:

    ▶ Get-MgApplication -ApplicationId "443a418b-b373-4219-a71b-1f7447ea6ff5" -Debug
    DEBUG: CmdletBeginProcessing:
    DEBUG: CmdletProcessRecordStart:
    DEBUG: CmdletProcessRecordAsyncStart:
    DEBUG: CmdletGetPipeline:
    DEBUG: CmdletBeforeAPICall:
    DEBUG: URLCreated: https://graph.microsoft.com/beta/applications/443a418b-b373-4219-a71b-1f7447ea6ff5
    DEBUG: RequestCreated: https://graph.microsoft.com/beta/applications/443a418b-b373-4219-a71b-1f7447ea6ff5
    DEBUG: HeaderParametersAdded: https://graph.microsoft.com/beta/applications/443a418b-b373-4219-a71b-1f7447ea6ff5
    DEBUG: BeforeCall:
    DEBUG: ResponseCreated:
    DEBUG: BeforeResponseDispatch:
    Get-MgApplication_Get2: Resource '443a418b-b373-4219-a71b-1f7447ea6ff5' does not exist or one of its queried reference-property objects are not present.
    DEBUG: GET /beta/applications/443a418b-b373-4219-a71b-1f7447ea6ff5 HTTP/1.1
    HTTP: graph.microsoft.com
    Accept-Encoding: gzip
    
    
    DEBUG: HTTP/1.1 404 Not Found
    request-id: 3440016f-10d1-4ed7-be5d-9c5342faad88
    client-request-id: 3440016f-10d1-4ed7-be5d-9c5342faad88
    x-ms-ags-diagnostic: {"ServerInfo":{"DataCenter":"South Central US","Slice":"SliceC","Ring":"4","ScaleUnit":"003","RoleInstance":"AGSFE_IN_6"}}
    Content-Type: application/json
    Content-Length: 338
    
    {
      "error": {
        "code": "Request_ResourceNotFound",
        "message": "Resource '443a418b-b373-4219-a71b-1f7447ea6ff5' does not exist or one of its queried reference-property objects are not present.",
        "innerError": {
          "date": "2020-08-28T20:17:18",
          "request-id": "3440016f-10d1-4ed7-be5d-9c5342faad88"
        }
      }
    }
    DEBUG: Finally:
    DEBUG: CmdletAfterAPICall:
    DEBUG: CmdletProcessRecordAsyncEnd:
    DEBUG: CmdletProcessRecordEnd:
    DEBUG: CmdletEndProcessing:
    
  2. ghost removed on Sep 3, 2020
  3. georgend commented on Oct 14, 2020

    @georgend
    Contributor

    Jason Johnston (@jasonjoh) We released v1.0 around Ignite time, does the error still persist with the new version?

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

Metadata

Metadata

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