PowerShell/PowerShellGallery

Redirect from `powershellgallery.com` to `www.powershellgallery.com` is down

o-l-a-v opened this issue · 2 comments

Prerequisites

  • Write a descriptive title.
  • Make sure you are able to repro it on the latest version
  • Search the existing issues.

Steps to reproduce

Redirect from powershellgallery.com to www.powershellgallery.com is down, which causes this to timeout for me:

Test-Connection -TargetName 'powershellgallery.com' -TcpPort 443 -IPv4 -Detailed -TimeoutSeconds 10

While this succeeds fast:

Test-Connection -TargetName 'www.powershellgallery.com' -TcpPort 443 -IPv4 -Detailed -TimeoutSeconds 10

Expected behavior

Same as with www.powershellgallery.com in following example.

PS > Test-Connection -TargetName 'www.powershellgallery.com' -TcpPort 443 -IPv4 -Detailed -TimeoutSeconds 10

   Target: www.powershellgallery.com

  Id Source           Address                      Port Latency Connected  Status
                                                           (ms)
  -- ------           -------                      ---- ------- ---------  ------
   1 <redacted>       13.107.246.53                 443      10 True       Success

PS >

Actual behavior

PS > Test-Connection -TargetName 'powershellgallery.com' -TcpPort 443 -IPv4 -Detailed -TimeoutSeconds 10

   Target: powershellgallery.com

  Id Source           Address                      Port Latency Connected  Status
                                                           (ms)
  -- ------           -------                      ---- ------- ---------  ------
   1 <redacted>       20.112.250.133                443       0 False      TimedOut

PS >

Error details

No response

Environment data

Not relevant

Version

Not relevant

Visuals

No response

Now it works again. \(〇_o)/

It has been extra slow and timed out for hours now.

I use Site24x7 free tier to monitor it, it does HTTP HEAD from Seattle. I've set timeout to 15 seconds, poll every 10 minutes.

image

Should be equivalent to doing something like this?

0 .. 100 | ForEach-Object -Process {
    $Started = [datetime]::Now
    $Stopwatch = [System.Diagnostics.Stopwatch]::StartNew()
    $Success = [bool]$(
        Try {
            $null = Invoke-RestMethod -Method 'Head' -Uri 'https://powershellgallery.com' -ConnectionTimeoutSeconds 15
            $?
        }
        Catch {
            $false
        }
    )
    $Stopwatch.Stop()
    [PSCustomObject]@{
        'Id'              = [uint16] $_
        'Started'         = [datetime] $Started
        'Success'         = [bool] $Success
        'RountripSeconds' = [double]($Success ? $Stopwatch.'Elapsed'.'TotalSeconds' : $null)
    }
}