Skip to content

Invoke-WebRequest not responding to «Ctrc+c» #16145

Closed

Description

@7-904-001-67-28

Prerequisites

Steps to reproduce

I am experiencing a problem with this comandlet.
I started it to downloading and turned off the router. Comandlet hanged and hangs for more than 10 hours.
I think it should be breaked after I push «Ctrl+c», but it continue hanging.
Sorry my English.

Expected behavior

«Ctrl+c» – and Oll Korrect.

Actual behavior

Nothing changes.

Error details

I can not start the next command.

Environment data

Name                           Value
----                           -----
PSVersion                      7.1.4
PSEdition                      Core
GitCommitId                    7.1.4
OS                             Microsoft Windows 10.0.19043
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

I prepared the window of PowerShell and reduced the speed of the router to minimal:
2021-09-23_12-46-50
I pushed the «Enter»:
2021-09-23_12-47-08
I turned off the router:
2021-09-23_12-47-24
Now I am trying unsuccessfully to stop it.

Activity

  1. added
    Needs-Triage
    on Sep 23, 2021
  2. added
    Issue-Question
    on Sep 24, 2021
  3. iSazonov commented on Sep 24, 2021

    @iSazonov
    Collaborator

    I can reproduce: start downloading an ISO and then disconnect Wi-Fi - PowerShell hang (no response after Ctrl-C and Wi-Fi reconnect).

  4. added
    Issue-Bug
    and removed
    Issue-Question
    on Sep 24, 2021
  5. added this to the 7.2-Consider milestone on Sep 24, 2021
  6. 7-904-001-67-28 commented on Sep 24, 2021

    @7-904-001-67-28
    Author

    If there is the VPN- or proxy-program between PowerShell and Internet, that program (probably) is returning the connection error and PowerShell by itself (without external intervention) is continue after 1-2 minutes with $_.Exception.HResult -EQ -2146232800, $_.Exception.InnerException.ErrorCode -EQ 10053 and $_.Exception.InnerException.Message -Like "Unable to read data from the transport connection: *".

  7. markekraus commented on Oct 2, 2021

    @markekraus
    Contributor

    Even though we have StopProcessing() implemented, because we have HttpClient.SendAsync() being run synchronously.. I think it is blocking the cancellation.

    response = client.SendAsync(req, HttpCompletionOption.ResponseHeadersRead, _cancelToken.Token).GetAwaiter().GetResult();

  8. CarloToso commented on Jan 25, 2023

    @CarloToso
    Contributor

    Related to #12249

  9. kasini3000 commented on Mar 6, 2023

    @kasini3000

    I can reproduce:
    i use Invoke-WebRequest / Invoke-RestMethod watch etcd,
    but can not terminate by ctrl+c,but curl normal !

    We look forward to fixing this problem as soon as possible.

  10. ghost added
    In-PR
    on Mar 12, 2023
  11. ghost removed
    In-PR
    on Mar 15, 2023
  12. ghost added
    In-PR
    on Mar 15, 2023
  13. ghost removed
    In-PR
    on Apr 3, 2023
  14. ghost added
    Resolution-Fixed
    on Apr 3, 2023
  15. ghost removed
    Needs-Triage
    on Apr 3, 2023
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

    Issue-BugResolution-FixedWG-Cmdlets

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions