azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Install-Module Az fails on Ubuntu LTS 20.04

Open playground0076 opened this issue 5 years ago • 4 comments

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

playground0076 avatar Jan 30 '21 00:01 playground0076

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.

dingmeng-xue avatar Jan 31 '21 00:01 dingmeng-xue

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 avatar Feb 01 '21 15:02 playground0076

@playground0076 , thanks for sharing your investigation. Correct repo for reporting the issue of Install-Module is https://github.com/PowerShell/PowerShell/issues

dingmeng-xue avatar Feb 02 '21 01:02 dingmeng-xue

Close this issue now.

dingmeng-xue avatar Feb 02 '21 12:02 dingmeng-xue