PSResourceGet icon indicating copy to clipboard operation
PSResourceGet copied to clipboard

NuGet v3 Repositories should not require tags element

Open JustinGrote opened this issue 2 years ago • 4 comments

Prerequisites

  • [X] Write a descriptive title.
  • [X] Make sure you are able to repro it on the latest released version
  • [X] Search the existing issues.

Steps to reproduce

Attempt to install a package from a NuGet v3 repository.

However, per the NuGet v3 spec, tags is an optional property, and PSResourceGet should handle the case where tags is present and ignore the tags-based search: https://learn.microsoft.com/en-us/nuget/api/registration-base-url-resource#catalog-entry

Expected behavior

Installs package

Actual behavior

Install-PSResource: Response does not contain 'tags' element for search with Name 'az.accounts' in 'pwshgallery'.

Error details

Exception             :
    Type    : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
    Message : Package(s) 'az.accounts' could not be installed from repository 'pwshgallery'.
    HResult : -2146233088
TargetObject          : Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource
CategoryInfo          : InvalidData: (Microsoft.PowerShel…s.InstallPSResource:InstallPSResource) [Install-PSResource],
ResourceNotFoundException
FullyQualifiedErrorId : InstallPackageFailure,Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallPSResource
InvocationInfo        :
    MyCommand        : Install-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 6
    Line             : install-psresource az.accounts -Repository pwshgallery -verbose -debug
    PositionMessage  : At line:1 char:1
                       + install-psresource az.accounts -Repository pwshgallery -verbose -debu …
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : install-psresource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo :

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.0.0                 Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PS…

Key   : PSVersion
Value : 7.3.8
Name  : PSVersion


Key   : PSEdition
Value : Core
Name  : PSEdition


Key   : GitCommitId
Value : 7.3.8
Name  : GitCommitId


Key   : OS
Value : Microsoft Windows 10.0.22631
Name  : OS


Key   : Platform
Value : Win32NT
Name  : Platform


Key   : PSCompatibleVersions
Value : {1.0, 2.0, 3.0, 4.0…}
Name  : PSCompatibleVersions


Key   : PSRemotingProtocolVersion
Value : 2.3
Name  : PSRemotingProtocolVersion


Key   : SerializationVersion
Value : 1.1.0.1
Name  : SerializationVersion


Key   : WSManStackVersion
Value : 3.0
Name  : WSManStackVersion

Visuals

No response

JustinGrote avatar Oct 13 '23 19:10 JustinGrote

Thanks for opening this @JustinGrote -- looks like it might be an issue with the error message

SydneyhSmith avatar Oct 16 '23 18:10 SydneyhSmith

Thanks @JustinGrote looking at this further, want to confirm, was this the command you ran? install-psresource az.accounts -Repository pwshgallery -verbose -debug

And what is the output of Get-PSResourceRepository | fl *

SydneyhSmith avatar Oct 18 '23 19:10 SydneyhSmith

Correct, this is my nuget v3 bridge for PowerShell gallery. The destination is https://pwsh.gallery/index.json I do also want to note I pushed an update that has tags as a property but it is an empty array rather than not being present, which works around the issue but per the nuget spec, it should still be an optional property and may be a problem for other third-party v3 nuget repository compatibility

JustinGrote avatar Oct 18 '23 19:10 JustinGrote

Quite the pickle, was hoping to use this newer module for its supposedly superior authentication mechanisms, but its not abiding by nuget specs. Attempting to use it with TeamCity, and its a no go. Not even the v2 endpoints work! PowershellGet v2.2.5 is so painful when used with authentication, but when used without appears to work "fine" v2/v3 (v3 pre-release semver issues not withstanding).

t-l-k avatar Jan 04 '24 10:01 t-l-k

This might be closable now due to issue #1621 being closed since they have merged in this fix: https://github.com/PowerShell/PSResourceGet/pull/1627

evelyn-bi avatar Apr 17 '24 20:04 evelyn-bi

This issue should be resolved via #1627 . If you still see an issue with this please feel free to comment and I can re-open, thanks @JustinGrote !

anamnavi avatar Apr 23 '24 18:04 anamnavi