Repository navigation
When using a PSRepository backed by Azure Devops Artifact feed that upstreams PSGallery, Install-Module fails on specific module versions #774
Description
Activity
I tried installing versions of dbatools >= 1.0 module in verbose mode
Find-Module -Name dbatools -AllVersions -Repository PSGallery | Where-Object { [System.Version] $_.Version -ge [System.Version] '1.0' } | Foreach-Object { $_.Version Install-Module -Name $_.Name -RequiredVersion $_.Version -Scope AllUsers -SkipPublisherCheck -Repository PrivatePSGallery -Credential $VSCred -Verbose }
log entry for nuget package v2 protocol uses FindPackagesById() seems correct. At the end of this logging statement, it is searching for something and it is empty. Is that the version and why is the total package yield 0? When I copy and paste https://pkgs.dev.azure.com/[redactedorg]/_packaging/privatepsgallery/nuget/v2/FindPackagesById()?id='dbatools' into my browser and authenticate to Azure Devops, this returns a proper result.
VERBOSE: Repository details, Name = 'PrivatePSGallery', Location = 'https://pkgs.dev.azure.com/[redactedorg]/_packaging/privatepsgallery/nuget/v2'; IsTrusted = 'True'; IsRegistered = 'True'. VERBOSE: Using the provider 'PowerShellGet' for searching packages. VERBOSE: Using the specified source names : 'PrivatePSGallery'. VERBOSE: Getting the provider object for the PackageManagement Provider 'NuGet'. VERBOSE: The specified Location is 'https://pkgs.dev.azure.com/[redactedorg]/_packaging/privatepsgallery/nuget/v2' and PackageManagementProvider is 'NuGet'. VERBOSE: Searching repository 'https://pkgs.dev.azure.com/[redactedorg]/_packaging/privatepsgallery/nuget/v2/FindPackagesById()?id='dbatools'' for ''. VERBOSE: Total package yield:'0' for the specified package 'dbatools'When getting a specific version of dbatools using Nuget V2 protocol the rest query should look like this: https://pkgs.dev.azure.com/[redactedorg]/_packaging/privatepsgallery/nuget/v2/Packages(Id='dbatools',Version='0.8.952').
tristanbarcelon thanks for reaching out with this! We're looking into this scenario and seeing what's happening and will get back soon.
Reacted by tristanbarcelonHi Anam Navied (@anamnavi), I'm curious whether you've been able to reproduce this issue I'm observing. It started affecting newer versions of AWS.Tools.* modules starting with 4.1.116.
tristanbarcelon I'll test and get back on this early next week, sorry for the delay, just coming back from vacation.
Reacted by tristanbarcelonAnam Navied (@anamnavi) , does your team collaborate with Azure Devops artifacts team? I noticed another pattern whenever these errors happen. Specifically, the errors happen within a few hours after a new version of a module is published in PSGallery. I don't know whether Azure Devops artifacts caches metadata from PSGallery rather than querying it directly for the presence of a module and version. Re-attempting the same script later works, though for some modules, the upstreaming behavior still remains broken (dbatools, sqlserverdsc, azurepipelinesps) and now it affects ImportExcel version 7.8.0.
Steps to reproduce
To reproduce the issue encountered with AWS.Tools.* modules, use this script below.
Expected behavior
When the module or requiredversion is not found in azure devops feed, it should fetch the module from powershellgallery and make it visible in Azure Devops.
Actual behavior
I get an error like this:
Looking at Azure Devops, I can tell where it's failed, starting with version 3.1.42 of AzurePipelinesPS. I experience the same issues with SqlServerDSC on any version newer than 15.0.1 (e.g., 15.1.0, 15.1.1, 15.2.0). AWS.Tools.Common, AWS.Tools.EKS, AWS.Tools.EC2, etc all fail as well between versions 4.1.99 and 4.1.86, inclusive and 4.1.9.0. Due to the consistency of versions affected in AWS.Tools.* modules, I'm leaning towards corruption of version metadata stored in PSGallery's index/database when AWS pushed these versions to PSGallery.
Environment data