PowerShell / PowerShellGallery

228 stars 65 forks source link

Powershell Gallery slowness: `Install-Module -Name Az` takes 60 minutes instead of 3 #171

Open aristosvo opened 3 years ago

aristosvo commented 3 years ago

Hi πŸ‘‹πŸ½

Seems the PowerShell Gallery is very slow today! Didn't know where to report it other than here :)

Operations which take in a normal situation 3 minutes take now 60 minutes, see log file below:

InstallModule.log

adityapatwardhan commented 3 years ago

Thank you for reporting. We are having a look.

emarzanoBNY commented 3 years ago

I'll second this. Also experiencing this issue.

adityapatwardhan commented 3 years ago

We had some issues with CDN and now believe the slowness has been fixed, please let us know if this is not the case anymore.

aristosvo commented 3 years ago

This looks like it used to be, thanks for the fix! πŸŽ‰

aristosvo commented 3 years ago

Reopened, as it seems to recur..! It's kinda on and off again, ranging from the normal 3 minutes to 20 minutes.

pucciniplagiarist commented 3 years ago

Yes the issue is still present this morning.

anamnavi commented 3 years ago

Hi @aristosvo, @pucciniplagiarist thanks for reaching out. We are aware of this and the Gallery CDN availability should have stabilized by now. We are investigating into the root cause of this. You can follow the status of the gallery at this link: https://github.com/PowerShell/PowerShellGallery/blob/master/psgallery_status.md

aristosvo commented 3 years ago

@anamnavi I don't know how it's possible, but our downloads are still taking 15-20 minutes instead of 3 previously..

vercellone commented 3 years ago

Just over an hour ago: Install-Module -Name Az -Scope CurrentUser -Repository PSGallery -Force

Elapsed time: 0:40:28.8844

gautamdsheth commented 3 years ago

@aristosvo - can you please reopen the issue ? It is happening with us as well !

@anamnavi - saw the status page, it shows that the CDN issue is resolved, but its not.

aristosvo commented 3 years ago

@gautamdsheth I can’t, sorry! You can open a new one if you want to!!

anamnavi commented 3 years ago

We're working on a more long term fix for this since it's a long term issue. I re-opened the issue.

dhekimian commented 3 years ago

I noticed on a fresh Windows 2019 build that it was extremely slow also but after upgrading key packages, installing ALL PowerShell Modules were significantly faster.

I was able to install the AZ Module in ~5 minutes after updating the relevant PowerShell packages.

Via Chocolatey, it took less than 30 seconds to download and install all the AZ Modules. YMMV

I found 3 different solutions:

1. Update PowerShell Packages/Modules (Works for All PowerShellGallery Module Installs)

To check versions of installed modules:

Get-Module -ListAvailable
or
Get-Module -Name PowerShellGet

To update the relevant packages:

Write-Output ==^> Install latest NuGet
Install-PackageProvider NuGet -Force

Write-Output ==^> Set PowerShell Gallery to Trusted
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

Write-Output ==^> Install latest PowerShellGet
# *PowerShellGet* also updates its dependency *PackageManagement*
Install-Module PowerShellGet -Force

Write-Output ==^> Install latest PSReadLine
Install-Module PSReadLine -Force

2. Install Azure PowerShell Module via MSI Package

You need to find the AZ release version you want to install and download it.

3. Install Azure PowerShell Module via Chocolatey

bcassell commented 3 years ago

Still having issues with this today. Do we have any timeline on this? Thanks.

psyrus commented 3 years ago

Facing this on our side too. 20 minutes to install Az.Accounts (5.x megabytes) :(

kaburkett commented 3 years ago

This slowness is an issue for me today.

fsckyes commented 3 years ago

Experiencing extreme slowness as well

jasonpnnl commented 3 years ago

We are experiencing the same thing, which is a problem when using managed dependencies with Azure Functions. The download of managed dependencies from psgallery doesn't complete before the function execution timeout is reached.

alerickson commented 3 years ago

We're working on a long term solution for this. We've had consistent issues with our database connection pools maxing out, we've restarted our instances to reset the connection pools and this should provide a temporary solution. We'll continue to restart our instances if/when this issue arises so that there's minimal interruption until we have our permanent fix.

daltonscole commented 3 years ago

Running into issues with this today using Azure Functions managed dependencies, it times out while downloading modules and causes the function to fail.

aristosvo commented 3 years ago

@alerickson It's really horrible at the moment 😒

Edit: It takes over an hour to get Az, if we get it at all! Can you give us a workaround, is there a mirror we can use or something?

Robulane commented 2 years ago

Same here today, extremely slow

dchasman commented 2 years ago

Same here

rdelcampog commented 2 years ago

Same here :(

axel-dd commented 2 years ago

Still extremely slow. Is there any solution in the pipeline? This problem has existed for months.

image

SQLCanuck commented 2 years ago

Having the horrible performance issues now as well. Given this is backed by Microsoft, is this not using Azure auto scale features to avoid such problems???

monken commented 2 years ago

It's been really bad as of late. Any plans for improvements? Since version 7.0.0, I now download and install through the released bundle from github:

PSAz=$(curl -sL https://api.github.com/repos/Azure/azure-powershell/releases/latest | jq -r '.assets[].browser_download_url | select(. | endswith(".tar.gz"))')

mkdir -p /tmp/azcmdlets
curl -Lso /tmp/azcmdlets/az.tar.gz $PSAz
tar -xzf /tmp/azcmdlets/az.tar.gz -C /tmp/azcmdlets
pwsh /tmp/azcmdlets/InstallModule.ps1
axel-dd commented 2 years ago

@monken Thanks for sharing your workaround. I also use it now.

gautamdsheth commented 2 years ago

Hello, is there any progress on this issue ? Has been quite bad nowadays. Took 50 mins today

image

ekdegerman commented 2 years ago

We have the same issue when trying to install the Az module in hosted jobs running on windows-latest (still Windows Server 2019 so far) in Azure pipelines. Seems downloading it from github instead as @monken suggested makes it a lot more reliable so we'll be using that workaround at least until there is a resolution here.

nzh10 commented 2 years ago

Have same issue here. The downloading speed is extremely slow, and does not have any output... I can't even provide debugging information for diagnosis :(

ghost commented 2 years ago

Having this issue today, let it run for 30+ minutes before giving up

neman commented 2 years ago

Extreme slow installation. I gave up and used choco install az.powershell

daojah commented 2 years ago

Same issue today

bjh1977 commented 2 years ago

Me too - 52 mins

pari205 commented 2 years ago

Same issue, the following command hangs, any solution? Install-Module -Name Az -AllowClobber -Force

daojah commented 2 years ago

Same issue, the following command hangs, any solution? Install-Module -Name Az -AllowClobber -Force

Just wait) It's helped me

aroramaxus commented 2 years ago

Same issue. taking circa 50 mins. I have tried the following as recommended:

Write-Output ==^> Install latest NuGet Install-PackageProvider NuGet -Force

Write-Output ==^> Set PowerShell Gallery to Trusted Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

Write-Output ==^> Install latest PowerShellGet

PowerShellGet also updates its dependency PackageManagement

Install-Module PowerShellGet -Force

Write-Output ==^> Install latest PSReadLine Install-Module PSReadLine -Force

then doing

Install-Module -Name Az

nexxuno commented 2 years ago

Having the same problem, any news @alerickson ? almost a year now

smflorentino commented 2 years ago

I had the same issue and updated NuGet from 5.9 to 6.1. That helped a lot: nuget update -self

Bv-Lucas commented 2 years ago

Hello guys

It's been almost a year and still seems to be a recurring issue. Sometimes run below 10m, sometimes takes more than 1 hour !!!! And it happens very often.

Just to install ps az module, honestly this is not acceptable, I'm reaching azure devops pipeline timeout randomly due to this slowness on a build that supposedly takes lower than 10minutes

I just can't rely on PS Gallery when a task can take anywhere from 5 minutes to 1hour (+) according to download throttle.

Is there anything planned to address this or should we move away from the official PSGallery ?

ghost commented 2 years ago

I found running the install with -Verbose logging on seemed to help, maybe give that a shot if you encounter this?

Bv-Lucas commented 2 years ago

I found running the install with -Verbose logging on seemed to help, maybe give that a shot if you encounter this?

I always run it with verbose, apart from seeing every package taking ages to download it doesn't make any difference to me :/

EDIT : It seems to be much better with this : https://github.com/PowerShell/PowerShellGallery/issues/171#issuecomment-885311310 πŸ‘ πŸ‘

It allowed my builds today to run very smoothly, I used solution 1- to keep it native : (this is on azdo private agents using ubuntu and powershell core)

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted Install-Module PowerShellGet -Scope AllUsers -Force Install-Module PSReadLine -Scope AllUsers -Force

Both runs today

image
ajacks88 commented 2 years ago

Running into this issue today. We install the az module as a part of some of our builds and for those its sometimes taking quite a long time/breaking the deployment if it takes too long.

SydneyhSmith commented 2 years ago

We made a recent update to the Gallery, are folks seeing any improvements in installation times for Az? Thanks!

nexxuno commented 2 years ago

Our pipeline (that uses Az-install in multiple places) went from 3hours to 13minutes, it was either a lucky run or your fix worked. Thanks.

After more runs I can confirm this is consistently faster.

eosho commented 2 years ago

This is still an issue for me. I am running an image build pipeline that installs some prerequisite modules. Without the Az module, my pipeline takes ~30 mins and with the AZ module almost ~2 hours.

I am running this via Microsoft hosted agent in ADO.

jp-hoehmann commented 2 years ago

I am experiencing the same issue.

draganya commented 1 year ago

Having the same issue atm, and not just with this module.

vishnumenikkara commented 1 year ago

Hello, I am facing extreme slowness while installing modules with PowerShell Gallery. Can someone please take a look.