Install-Module Az fails on Ubuntu LTS 20.04
Description
I am trying to install Az Powershell module on my Ubuntu VM but it fails when downloading the Az.Accounts package
Error Message:
VERBOSE: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing. DEBUG: 00:05:55.7044732 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/Az.Accounts/2.2.4' for '0' more times VERBOSE: Downloading package 'Az.Accounts' failed, please make sure 'https://www.powershellgallery.com/api/v2/package/Az.Accounts/2.2.4' is accessable. WARNING: Source Location 'https://www.powershellgallery.com/api/v2/package/Az.Accounts/2.2.4' is not valid.
Steps to reproduce
Run Install-Module Az command on Ubuntu LTS 20.04
Environment data
PSVersion - 7.1.1
Thanks for reporting. Please check status of connection to that URL. For instance, wget or curl that link. If issue is still there, please report the issue to https://github.com/PowerShell/PowerShell/issues.
Hello, Thank you for helping me. I hit the url using wget and it resolved successfully. But, 'wget' operation took a bit a of time to spit out the response.
I ran Install-Module Az.Accounts and wget operation in 2 different terminals at the same time and by the time wget command gave the response, Install-Module command threw a timeout exception.
VERBOSE: The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.
DEBUG: 00:01:45.1049604 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/Az.Accounts/2.2.4' for '2' more times
It looks like httpclient used by powershell is trying the req for a period of time and giving up. Can you let me know if this question belong to this forum or I should post it elsewhere.
Thank you again.
@playground0076 , thanks for sharing your investigation. Correct repo for reporting the issue of Install-Module is https://github.com/PowerShell/PowerShell/issues
Close this issue now.