Install-Module Az failing on Ubuntu 20.04 LTS
playground0076 opened this issue · 6 comments
Reference: Azure/azure-powershell#14062
Issue: Install-Module Az is failing on Ubuntu 20.04 LTS
Investigation: httpclient is timing out when downloading Az.Accounts package. (more details in the reference link).
PS Version: 7.0.0.1
Tried with Pwsh-preview as well.
/cc @anamnavi @alerickson
Thanks @playground0076 for opening this issue--we have tried reproducing this issue and are having difficulty....we did have low CDN availability earlier this week so it would be good to know if you are still seeing this issue...I also wonder if you are able to install any modules, or if you are just seeing the issue with the Az module? Thanks!
Thank you @SydneyhSmith for looking into the issue I reported. I tried just now with Az module and I still have the problem.
And looks like your guess is correct, I am facing issue when installing other modules as well. I ran the cmd "Install-Module -Name AWSPowerShell" and it is also facing issue. Below is the error log. Let me know if this is machine specific that I have to address on my side. I ran wget as well on the url and that resolved successfully (output at the end). thanks again.
VERBOSE: Downloading 'https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8'. DEBUG: 00:00:08.8143699 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AWSPowerShell'&$skip=80&$top=40'.
DEBUG: 00:00:09.2392461 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AWSPowerShell'&$skip=200&$top=40'.
DEBUG: 00:00:09.2879319 Completed downloading 'https://www.powershellgallery.com/api/v2/FindPackagesById()?id='AWSPowerShell'&$skip=120&$top=40'.
VERBOSE: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
DEBUG: 00:01:48.3532894 at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken) at Microsoft.PackageManagement.NuGetProvider.NuGetClient.DownloadDataToFileAsync(String fileName, String query, NuGetRequest request, NetworkCredential networkCredential, ProgressTracker progressTracker)
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8' for '2' more times
VERBOSE: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing. DEBUG: 00:03:28.4281830 at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken) at Microsoft.PackageManagement.NuGetProvider.NuGetClient.DownloadDataToFileAsync(String fileName, String query, NuGetRequest request, NetworkCredential networkCredential, ProgressTracker progressTracker)
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8' for '1' more times VERBOSE: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing. DEBUG: 00:05:08.4702105 at System.Net.Http.HttpClient.SendAsyncCore(HttpRequestMessage request, HttpCompletionOption completionOption, Boolean async, Boolean emitTelemetryStartStop, CancellationToken cancellationToken) at Microsoft.PackageManagement.NuGetProvider.NuGetClient.DownloadDataToFileAsync(String fileName, String query, NuGetRequest request, NetworkCredential networkCredential, ProgressTracker progressTracker)
VERBOSE: Retry downloading 'https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8' for '0' more times VERBOSE: Downloading package 'AWSPowerShell' failed, please make sure 'https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8' is accessable. WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8' is not valid.
Result of running wget https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8.
This operation took nearly 2 mins
wget https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8
--2021-02-05 12:33:31-- https://www.powershellgallery.com/api/v2/package/AWSPowerShell/4.1.8
Resolving www.powershellgallery.com (www.powershellgallery.com)... 168.61.186.235
Connecting to www.powershellgallery.com (www.powershellgallery.com)|168.61.186.235|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://psg-prod-eastus.azureedge.net/packages/awspowershell.4.1.8.nupkg [following]
--2021-02-05 12:33:36-- https://psg-prod-eastus.azureedge.net/packages/awspowershell.4.1.8.nupkg
Resolving psg-prod-eastus.azureedge.net (psg-prod-eastus.azureedge.net)... 2606:2800:11f:17a5:191a:18d5:537:22f9, 72.21.81.200
Connecting to psg-prod-eastus.azureedge.net (psg-prod-eastus.azureedge.net)|2606:2800:11f:17a5:191a:18d5:537:22f9|:443... failed: Connection timed out.
Connecting to psg-prod-eastus.azureedge.net (psg-prod-eastus.azureedge.net)|72.21.81.200|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 40199733 (38M) [binary/octet-stream]
Saving to: ‘4.1.8’
4.1.8 100%[===============================================================================================>] 38.34M 7.75MB/s in 5.5s
2021-02-05 12:35:52 (6.94 MB/s) - ‘4.1.8’ saved [40199733/40199733]
Hi @playground0076! Can you run the following (assuming you have Docker installed) and let us know if it works or gives you the same error as above.
docker run -it --rm mcr.microsoft.com/powershell:ubuntu-20.04
//this should create a ubuntu20.04 container with powershell already installed
Install-Module -Name 'Az' (if prompted selected Y)
Hopefully this will allow us to try to replicate the issue you're facing and determine if it's machine/environment specific.
Hi @anamnavi , thank you for the pointer. Yeah, I ran the command in the docker container and that worked just fine. In fact, it took less than 10 secs for everything.
But from my localhost, it failed with the same error.
Should I assume that this is machine specific then.? Let me know if I have to close this issue. And any instruction on how I can resolve this issue is really appreciated.
hmmm, I strongly believe that it is the httpclient that's used by the powershell core is getting timed out and it's not machine specific but location specific.
However, I manually copied the PS Module for Az from my windows box to Linux box and for the time being I can live with that. I kind of made up my mind to use Az Cloudshell or Powershell in my windows box for interacting with my Az resources.
Thank you and I am closing off this issue as it is not reproducible on your end.