I setup a Nuget repository for chocolatey in Artifactory. My goal is to use Artifactory as proxy to chocolatey. However. registering the package source throws a validation error. If I register the repository as a Nuget provider it is able to download the packages with no problem but does not install it the way chocolatey does.
I would greatly appreciate your assistance.
Below are the steps I have taken and the versions I am using:
PS C:\windows\system32> **register-packagesource -providername chocolatey -name LocalChoco -Location "http://vmw12r2artrep
.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget" -force -ForceBootstrap -Trusted -Credential $cred -verbose -debug**
DEBUG: 00:00:00.0000003 Calling 'Chocolatey::GetDynamicOptions' 'Provider'
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
DEBUG: 00:00:00.0046091 Calling 'Chocolatey::GetDynamicOptions' 'Source'
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
DEBUG: 00:00:02.3899311 Calling 'Chocolatey::ResolvePackageSources'
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
DEBUG: 00:00:02.3903063 Yielding packge source for chocolatey at location http://chocolatey.org/api/v2/
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
Confirm
Are you sure you want to perform this action?
Performing the operation "Register Package Source." on target "Package Source 'LocalChoco'
(http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget) in provider 'chocolatey'.".
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"): y
DEBUG: 00:00:04.6194281 Calling 'Chocolatey::AddPackageSource'
'LocalChoco','http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget','True'
Confirm
Continue with this operation?
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
Confirm
Source location 'http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget' is not valid for this
provider.
[Y] Yes [A] Yes to All [H] Halt Command [S] Suspend [?] Help (default is "Y"): y
register-packagesource : Source location
'http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget' is not valid for this provider.
At line:1 char:1
+ register-packagesource -providername chocolatey -name LocalChoco -Loc ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidData: (LocalChoco:String) [Register-PackageSource], Exception
+ FullyQualifiedErrorId : SourceLocationNotValid_Location,Microsoft.PowerShell.PackageManagement.Cmdlets.RegisterP
ackageSource
If I register it as a Nuget provider, then it is able to work. But, executing the install-package only downloads and unpacks the package but it does not actually install like what chocolatey does.
PS C:\windows\system32> register-packagesource -providername NuGet -name LocalNuget -Location "http://vmw12r2artrep.lab.
pilgrimquality.com:8081/artifactory/api/nuget/nuget" -force -ForceBootstrap -Trusted -Credential $cred -verbose
VERBOSE: Performing the operation "Register Package Source." on target "Package Source 'LocalNuget'
(http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget) in provider 'NuGet'.".
VERBOSE: Source 'LocalNuget' is validated.
VERBOSE: Saving a config with a file path 'C:\Users\Administrator\AppData\Roaming\NuGet\nuget.config'.
Name ProviderName IsTrusted Location
---- ------------ --------- --------
LocalNuget NuGet True http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifa...
PS C:\windows\system32> get-packagesource
Name ProviderName IsTrusted Location
---- ------------ --------- --------
LocalNuget NuGet True http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifa...
PSGallery PowerShellGet True https://www.powershellgallery.com/api/v2/
chocolatey Chocolatey False http://chocolatey.org/api/v2/
PS C:\windows\system32> find-package FireFox -Credential $cred -ProviderName Nuget
Name Version Source Summary
---- ------- ------ -------
Firefox 53.0.3 LocalNuget Bringing together all kinds of awesomeness to make ...
PS C:\windows\system32> find-package FireFox -Credential $cred -ProviderName Nuget | Install-package -verbose -credentia
l $cred
VERBOSE: Performing the operation "Install Package" on target "Package 'Firefox' version '53.0.3' from 'LocalNuget'.".
VERBOSE: Searching repository
'http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget/FindPackagesById()?id='Firefox'' for ''.
VERBOSE: Searching repository
'http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget/FindPackagesById()?id='chocolatey-core.ex
tension'' for ''.
VERBOSE: InstallPackage' - name='chocolatey-core.extension', version='1.3.0',destination='C:\Program
Files\PackageManagement\NuGet\Packages'
VERBOSE: DownloadPackage' - name='chocolatey-core.extension', version='1.3.0',destination='C:\Program
Files\PackageManagement\NuGet\Packages\chocolatey-core.extension.1.3.0\chocolatey-core.extension.1.3.0.nupkg',
uri='http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget/Download/chocolatey-core.extension/1.
3.0'
VERBOSE: Downloading
'http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget/Download/chocolatey-core.extension/1.3.0'
.
VERBOSE: Completed downloading
'http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget/Download/chocolatey-core.extension/1.3.0'
.
VERBOSE: Completed downloading 'chocolatey-core.extension'.
VERBOSE: Hash for package 'chocolatey-core.extension' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='chocolatey-core.extension', version='1.3.0',destination='C:\Program
Files\PackageManagement\NuGet\Packages'
VERBOSE: InstallPackage' - name='Firefox', version='53.0.3',destination='C:\Program
Files\PackageManagement\NuGet\Packages'
VERBOSE: DownloadPackage' - name='Firefox', version='53.0.3',destination='C:\Program
Files\PackageManagement\NuGet\Packages\Firefox.53.0.3\Firefox.53.0.3.nupkg',
uri='http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget/Download/Firefox/53.0.3'
VERBOSE: Downloading
'http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget/Download/Firefox/53.0.3'.
VERBOSE: Completed downloading
'http://vmw12r2artrep.lab.pilgrimquality.com:8081/artifactory/api/nuget/nuget/Download/Firefox/53.0.3'.
VERBOSE: Completed downloading 'Firefox'.
VERBOSE: Hash for package 'Firefox' does not match hash provided from the server.
VERBOSE: InstallPackageLocal' - name='Firefox', version='53.0.3',destination='C:\Program
Files\PackageManagement\NuGet\Packages'
Name Version Source Summary
---- ------- ------ -------
chocolatey-core.extension 1.3.0 LocalNuget This package provides helper functions installed as...
Firefox 53.0.3 LocalNuget Bringing together all kinds of awesomeness to make ...
Chocolatey provider is a prototype provider created by OneGet team and is on path for deprecation. Please work with Chocolatey owners to get official support.
Hi All,
I setup a Nuget repository for chocolatey in Artifactory. My goal is to use Artifactory as proxy to chocolatey. However. registering the package source throws a validation error. If I register the repository as a Nuget provider it is able to download the packages with no problem but does not install it the way chocolatey does.
I would greatly appreciate your assistance.
Below are the steps I have taken and the versions I am using:
Also, I ran debug mode and below is the trace:
If I register it as a Nuget provider, then it is able to work. But, executing the install-package only downloads and unpacks the package but it does not actually install like what chocolatey does.
Thank you.
Leo Barcenas