Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Azure DevOps Artifacts nuget v2 fails to install (404: not found) #1653

Closed
3 tasks done
FriedrichWeinmann opened this issue May 13, 2024 · 5 comments
Closed
3 tasks done
Assignees
Labels

Comments

@FriedrichWeinmann
Copy link
Contributor

Prerequisites

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

Steps to reproduce

When configuring an Azure DevOps Services nuget stream at protocol v2 level (so it installs dependencies correctly), FindPSResource is able to find modules, but it is not able to install it - the install (or download) will fail with http error code 404 (Not Found).

Using Save-Module or Install-Module against the same repository will work just fine.

Expected behavior

PS> Save-PSResource -Repository ContosoADO PSFramework -Credential $cred
PS>

Actual behavior

PS> Save-PSResource -Repository ContosoADO PSFramework -Credential $cred
Save-PSResource: 'Response status code does not indicate success: 404 (Not Found).' Request sent: 'https://<orgname>.pkgs.visualstudio.com/_packaging/<streamname>/nuget/v2/package/PSFramework/1.0.318'

Error details

Exception             :
    Type       : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException
    TargetSite :
        Name          : MoveNext
        DeclaringType : [Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls+<SendV2RequestForContentAsync>d__38]
        MemberType    : Method
        Module        : Microsoft.PowerShell.PSResourceGet.dll
    Message    : 'Response status code does not indicate success: 404 (Not Found).' Request sent:
'https://<orgname>.pkgs.visualstudio.com/_packaging/<streamname>/nuget/v2/package/PSFramework/1.0.318'
    Source     : Microsoft.PowerShell.PSResourceGet
    HResult    : -2146233088
    StackTrace :
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.SendV2RequestForContentAsync(HttpRequestMessage message, HttpClient s_client)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.HttpRequestCallForContent(String requestUrlV2, ErrorRecord& errRecord)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.InstallVersion(String packageName, String version, ErrorRecord& errRecord)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.V2ServerAPICalls.InstallPackage(String packageName, String packageVersion, Boolean includePrerelease, ErrorRecord&
errRecord)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper.BeginPackageInstall(VersionType searchVersionType, NuGetVersion specificVersion, VersionRange versionRange,
String pkgNameToInstall, PSRepositoryInfo repository, ServerApiCall currentServer, ResponseUtil currentResponseUtil, String tempInstallPath, Hashtable packagesHash,
ErrorRecord& errRecord)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper.InstallPackages(String[] pkgNamesToInstall, PSRepositoryInfo repository, ServerApiCall currentServer,
ResponseUtil currentResponseUtil, ScopeType scope, Boolean skipDependencyCheck, FindHelper findHelper)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper.ProcessRepositories(String[] repository, Boolean trustRepository, Boolean skipDependencyCheck, ScopeType
scope)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.InstallHelper.BeginInstallPackages(String[] names, VersionRange versionRange, NuGetVersion nugetVersion, VersionType
versionType, String versionString, Boolean prerelease, String[] repository, Boolean acceptLicense, Boolean quiet, Boolean reinstall, Boolean force, Boolean
trustRepository, Boolean noClobber, Boolean asNupkg, Boolean includeXml, Boolean skipDependencyCheck, Boolean authenticodeCheck, Boolean savePkg, List`1
pathsToInstallPkg, Nullable`1 scope, String tmpPath, HashSet`1 pkgsInstalled)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource.ProcessSaveHelper(String[] pkgNames, String pkgVersion, Boolean pkgPrerelease, String[] pkgRepository)
   at Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource.ProcessRecord()
   at System.Management.Automation.CommandProcessor.ProcessRecord()
CategoryInfo          : NotSpecified: (:) [Save-PSResource], ResourceNotFoundException
FullyQualifiedErrorId : Microsoft.PowerShell.PSResourceGet.UtilClasses.ResourceNotFoundException,Microsoft.PowerShell.PSResourceGet.Cmdlets.SavePSResource
InvocationInfo        :
    MyCommand        : Save-PSResource
    ScriptLineNumber : 1
    OffsetInLine     : 1
    HistoryId        : 29
    Line             : Save-PSResource -Repository ContosoADO PSFramework -Credential $cred
    Statement        : Save-PSResource -Repository ContosoADO PSFramework -Credential $cred
    PositionMessage  : At line:1 char:1
                       + Save-PSResource -Repository ContosoADO PSFramework -Credential $cred
                       + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    InvocationName   : Save-PSResource
    CommandOrigin    : Internal
ScriptStackTrace      : at <ScriptBlock>, <No file>: line 1

Environment data

ModuleType Version    PreRelease Name                                ExportedCommands
---------- -------    ---------- ----                                ----------------
Binary     1.0.4.1               Microsoft.PowerShell.PSResourceGet  {Find-PSResource, Get-InstalledPSResource, Get-PSResourceRepository, Get-PSScriptFileInfo…}


Name                           Value
----                           -----
PSVersion                      7.4.2
PSEdition                      Core
GitCommitId                    7.4.2
OS                             Microsoft Windows 10.0.22631
Platform                       Win32NT
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0…}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0

Visuals

No response

@FriedrichWeinmann
Copy link
Contributor Author

One thing to note:
The old Install-Module will access this url to download the same package:

https://<orgname>.pkgs.visualstudio.com/_packaging/<streamname>/nuget/v2?id=psframework&version=1.0.318

@SydneyhSmith
Copy link
Collaborator

Thanks @FriedrichWeinmann definitely looks like a bug-- we will need to take a look

@SydneyhSmith
Copy link
Collaborator

might be fixed by #1599

@FriedrichWeinmann
Copy link
Contributor Author

Sorry about the delayed response :(
No, it is unfortunately not fixed by #1599, which updates token handling, but does not affect URL resolution in v2.

I'd love to switch to v3, but until dependency installation is implemented, we can't use it :(
image

@FriedrichWeinmann
Copy link
Contributor Author

Ok, quick update:
It really helps to retest with the latest and greatest GA version you shipped in the meantime: 1.0.5
Problem definitely fixed in that one :)
While it wasn't PR 1599, another PR obviously fixed it and I'm unblocked. Thanks for the swift resolution :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants