如何将Artifactory配置为巧克力的缓存?我在安装软件包时得到404

如何将Artifactory配置为巧克力的缓存?我在安装软件包时得到404,artifactory,chocolatey,Artifactory,Chocolatey,Artifactory版本:6.16.2修订版61602900,Artifactory Pro许可证 在Artifactory中,我添加了一个远程存储库,具有以下设置: 包类型:NuGet 存储库密钥:巧克力遥控器 URL: 测试:成功连接到服务器 存储库布局:nuget default 包括模式:*** NuGet下载上下文路径:api/v2/package NuGet提要上下文路径:api/v2 NuGet v3提要URL:(空) 截图: 在主机上,我配置了巧克力源: choco s

Artifactory版本:6.16.2修订版61602900,Artifactory Pro许可证

在Artifactory中,我添加了一个远程存储库,具有以下设置:

  • 包类型:NuGet
  • 存储库密钥:巧克力遥控器
  • URL:
  • 测试:成功连接到服务器
  • 存储库布局:nuget default
  • 包括模式:***
  • NuGet下载上下文路径:api/v2/package
  • NuGet提要上下文路径:api/v2
  • NuGet v3提要URL:(空)
截图:

在主机上,我配置了巧克力源:

choco source add --name=artifactory --source=https://<ARTIFACTORY>/api/nuget/chocolatey-remote --user=***REDACTED*** --password=***REDACTED***
choco source disable --name chocolatey
choco source list
当我安装软件包时,我会得到一个404:

PS C:\Users\vagrant> choco install vlc
Chocolatey v0.10.15
Installing the following packages:
vlc
By installing you accept licenses for the packages.
vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
vlc package files install completed. Performing other installation steps.
The install of vlc was NOT successful.
vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - vlc (exited 1) - vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
这是
C:\ProgramData\Chocolate\logs\Chocolate.log

2021-02-04 09:42:36,839 764 [DEBUG] - XmlConfiguration is now operational
2021-02-04 09:42:36,870 764 [INFO ] - ============================================================
2021-02-04 09:42:36,997 764 [INFO ] - Chocolatey v0.10.15
2021-02-04 09:42:36,997 764 [DEBUG] - Chocolatey is running on Windows v 10.0.17763.0
2021-02-04 09:42:36,997 764 [DEBUG] - Attempting to delete file "C:/ProgramData/chocolatey/choco.exe.old".
2021-02-04 09:42:36,997 764 [DEBUG] - Attempting to delete file "C:\ProgramData\chocolatey\choco.exe.old".
2021-02-04 09:42:37,010 764 [DEBUG] - Command line: "C:\ProgramData\chocolatey\choco.exe" install vlc
2021-02-04 09:42:37,010 764 [DEBUG] - Received arguments: install vlc
2021-02-04 09:42:37,041 764 [DEBUG] - RemovePendingPackagesTask is now ready and waiting for PreRunMessage.
2021-02-04 09:42:37,041 764 [DEBUG] - Sending message 'PreRunMessage' out if there are subscribers...
2021-02-04 09:42:37,041 764 [DEBUG] - [Pending] Removing all pending packages that should not be considered installed...
2021-02-04 09:42:37,088 764 [DEBUG] - Performing validation checks.
2021-02-04 09:42:37,088 764 [DEBUG] - Global Configuration Validation Checks:
2021-02-04 09:42:37,088 764 [DEBUG] -  - Package Exit Code / Exit On Reboot = Checked
2021-02-04 09:42:37,088 764 [DEBUG] - System State Validation Checks:
2021-02-04 09:42:37,088 764 [DEBUG] -  Reboot Requirement Checks:
2021-02-04 09:42:37,088 764 [DEBUG] -  - Pending Computer Rename = Checked
2021-02-04 09:42:37,088 764 [DEBUG] -  - Pending Component Based Servicing = Checked
2021-02-04 09:42:37,088 764 [DEBUG] -  - Pending Windows Auto Update = Checked
2021-02-04 09:42:37,088 764 [DEBUG] -  - Pending File Rename Operations = Checked
2021-02-04 09:42:37,088 764 [DEBUG] -  - Pending Windows Package Installer = Checked
2021-02-04 09:42:37,108 764 [DEBUG] -  - Pending Windows Package Installer SysWow64 = Checked
2021-02-04 09:42:37,108 764 [INFO ] - 2 validations performed. 2 success(es), 0 warning(s), and 0 error(s).
2021-02-04 09:42:37,108 764 [DEBUG] - The source 'https://<ARTIFACTORY>/api/nuget/chocolatey-remote' evaluated to a 'normal' source type
2021-02-04 09:42:37,108 764 [DEBUG] - 
NOTE: Hiding sensitive configuration data! Please double and triple
 check to be sure no sensitive data is shown, especially if copying
 output to a gist for review.
2021-02-04 09:42:37,119 764 [DEBUG] - Configuration: CommandName='install'|
CacheLocation='C:\Users\vagrant\AppData\Local\Temp\chocolatey'|
ContainsLegacyPackageInstalls='True'|
CommandExecutionTimeoutSeconds='2700'|WebRequestTimeoutSeconds='30'|
Sources='https://<ARTIFACTORY>/api/nuget/chocolatey-remote'|
SourceType='normal'|Debug='False'|Verbose='False'|Trace='False'|
Force='False'|Noop='False'|HelpRequested='False'|
UnsuccessfulParsing='False'|RegularOutput='True'|QuietOutput='False'|
PromptForConfirmation='True'|AcceptLicense='False'|
AllowUnofficialBuild='False'|Input='vlc'|AllVersions='False'|
SkipPackageInstallProvider='False'|PackageNames='vlc'|
Prerelease='False'|ForceX86='False'|OverrideArguments='False'|
NotSilent='False'|ApplyPackageParametersToDependencies='False'|
ApplyInstallArgumentsToDependencies='False'|IgnoreDependencies='False'|
AllowMultipleVersions='False'|AllowDowngrade='False'|
ForceDependencies='False'|Information.PlatformType='Windows'|
Information.PlatformVersion='10.0.17763.0'|
Information.PlatformName='Windows Server 2016'|
Information.ChocolateyVersion='0.10.15.0'|
Information.ChocolateyProductVersion='0.10.15'|
Information.FullName='choco, Version=0.10.15.0, Culture=neutral, PublicKeyToken=79d02ea9cad655eb'|

Information.Is64BitOperatingSystem='True'|
Information.Is64BitProcess='True'|Information.IsInteractive='False'|
Information.UserName='vagrant'|
Information.UserDomainName='VAGRANT-I7ND05O'|
Information.IsUserAdministrator='True'|
Information.IsUserSystemAccount='False'|
Information.IsUserRemoteDesktop='False'|
Information.IsUserRemote='True'|
Information.IsProcessElevated='True'|
Information.IsLicensedVersion='False'|Information.LicenseType='Foss'|
Information.CurrentDirectory='C:\Users\vagrant'|
Features.AutoUninstaller='True'|Features.ChecksumFiles='True'|
Features.AllowEmptyChecksums='False'|
Features.AllowEmptyChecksumsSecure='True'|
Features.FailOnAutoUninstaller='False'|
Features.FailOnStandardError='False'|Features.UsePowerShellHost='True'|
Features.LogEnvironmentValues='False'|Features.LogWithoutColor='False'|
Features.VirusCheck='False'|
Features.FailOnInvalidOrMissingLicense='False'|
Features.IgnoreInvalidOptionsSwitches='True'|
Features.UsePackageExitCodes='True'|
Features.UseEnhancedExitCodes='False'|
Features.UseFipsCompliantChecksums='False'|
Features.ShowNonElevatedWarnings='True'|
Features.ShowDownloadProgress='True'|
Features.StopOnFirstPackageFailure='False'|
Features.UseRememberedArgumentsForUpgrades='False'|
Features.IgnoreUnfoundPackagesOnUpgradeOutdated='False'|
Features.SkipPackageUpgradesWhenNotInstalled='False'|
Features.RemovePackageInformationOnUninstall='False'|
Features.ExitOnRebootDetected='False'|
Features.LogValidationResultsOnWarnings='True'|
Features.UsePackageRepositoryOptimizations='True'|
Features.ScriptsCheckLastExitCode='False'|
ListCommand.LocalOnly='False'|
ListCommand.IdOnly='False'|ListCommand.IncludeRegistryPrograms='False'|
ListCommand.PageSize='25'|ListCommand.Exact='False'|
ListCommand.ByIdOnly='False'|ListCommand.ByTagOnly='False'|
ListCommand.IdStartsWith='False'|ListCommand.OrderByPopularity='False'|
ListCommand.ApprovedOnly='False'|
ListCommand.DownloadCacheAvailable='False'|
ListCommand.NotBroken='False'|
ListCommand.IncludeVersionOverrides='False'|
UpgradeCommand.FailOnUnfound='False'|
UpgradeCommand.FailOnNotInstalled='False'|
UpgradeCommand.NotifyOnlyAvailableUpgrades='False'|
UpgradeCommand.ExcludePrerelease='False'|
NewCommand.AutomaticPackage='False'| 
NewCommand.UseOriginalTemplate='False'|SourceCommand.Command='unknown'|
SourceCommand.Priority='0'|SourceCommand.BypassProxy='False'|
SourceCommand.AllowSelfService='False'|
SourceCommand.VisibleToAdminsOnly='False'|
FeatureCommand.Command='unknown'|ConfigCommand.Command='unknown'|
ApiKeyCommand.Remove='False'|PinCommand.Command='unknown'|
OutdatedCommand.IgnorePinned='False'|Proxy.BypassOnLocal='True'|
2021-02-04 09:42:37,119 764 [DEBUG] - _ Chocolatey:ChocolateyInstallCommand - Normal Run Mode _
2021-02-04 09:42:37,119 764 [INFO ] - Installing the following packages:
2021-02-04 09:42:37,119 764 [INFO ] - vlc
2021-02-04 09:42:37,119 764 [INFO ] - By installing you accept licenses for the packages.
2021-02-04 09:42:37,166 764 [DEBUG] - Using 'https://<ARTIFACTORY>/api/nuget/chocolatey-remote'.
2021-02-04 09:42:37,338 764 [DEBUG] - - Supports prereleases? 'True'.
2021-02-04 09:42:37,338 764 [DEBUG] - - Is ServiceBased? 'True'.
2021-02-04 09:42:37,544 764 [DEBUG] - Package 'vlc' found on source 'https://<ARTIFACTORY>/api/nuget/chocolatey-remote'
2021-02-04 09:42:37,589 764 [INFO ] - [NuGet] Attempting to resolve dependency 'chocolatey-core.extension (= 1.3.3)'.
2021-02-04 09:42:37,666 764 [ERROR] - vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
2021-02-04 09:42:37,666 764 [INFO ] - vlc package files install completed. Performing other installation steps.
2021-02-04 09:42:37,666 764 [DEBUG] - No package information as package is null.
2021-02-04 09:42:37,682 764 [DEBUG] - No package information to save as package is null.
2021-02-04 09:42:37,682 764 [DEBUG] - Sending message 'HandlePackageResultCompletedMessage' out if there are subscribers...
2021-02-04 09:42:37,682 764 [ERROR] - The install of vlc was NOT successful.
2021-02-04 09:42:37,682 764 [ERROR] - vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
2021-02-04 09:42:37,682 764 [WARN ] -
Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log). 
2021-02-04 09:42:37,682 764 [INFO ] -  
2021-02-04 09:42:37,697 764 [ERROR] - Failures
2021-02-04 09:42:37,697 764 [ERROR] -  - vlc (exited 1) - vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
2021-02-04 09:42:37,697 764 [DEBUG] - Sending message 'PostRunMessage' out if there are subscribers...
2021-02-04 09:42:37,732 764 [DEBUG] - Exiting with 1
Chocolate remote cache:vlc.3.0.12.nupkg这一行似乎与问题有关,但我需要一位人工专家来帮助我理解它的含义

我运行的
choco
命令与下面回答中的@yahavi完全相同:

PS C:\Users\vagrant> choco install vlc --source=https://<ARTIFACTORY>/api/nuget/chocolatey-remote --user=***REDACTED*** --password=***REDACTED***
Chocolatey v0.10.15
Installing the following packages:
vlc
By installing you accept licenses for the packages.
vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
vlc package files install completed. Performing other installation steps.
The install of vlc was NOT successful.
vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - vlc (exited 1) - vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
psc:\Users\vagrant>choco安装vlc——源代码=https:///api/nuget/chocolatey-remote --用户=***已编辑***--密码=***已编辑***
巧克力v0.10.15
安装以下软件包:
vlc
通过安装,您接受软件包的许可证。
vlc未安装。安装过程中发生错误:
远程服务器返回错误:(404)未找到。找不到
vlc包文件安装已完成。执行其他安装步骤。
vlc的安装未成功。
vlc未安装。安装过程中发生错误:
远程服务器返回错误:(404)未找到。找不到
Chocolate安装了0/1软件包。1个包失败。
有关详细信息,请参阅日志(C:\ProgramData\Chocolate\logs\Chocolate.log)。
失败
-vlc(退出1)-未安装vlc。安装过程中发生错误:
远程服务器返回错误:(404)未找到。找不到

作为一个合理性检查,我还安装了
choco-install vlc--source=https://chocolatey.org/api/v2/
这就行了。这排除了巧克力方面的任何问题,这肯定是Artifactory的问题。

尝试将
NuGet v3提要URL
设置为默认值:
https://api.nuget.org/v3/index.json

我们在我们的应用程序中使用Artifactory作为巧克力的缓存机制。 该用法与您的用法不完全相同,因为我们在install命令中添加了连接详细信息:

choco install vlc -s <jfrog-url>/api/nuget/chocolatey-remote -u <username> -p <password>
choco安装vlc-s/api/nuget/chocolate-remote-u-p
要了解更多信息,欢迎您阅读我的博客:

我已将v3提要设置为默认值,结果相同:404。当我在命令行上显式地使用源代码时,就像在您的使用中一样,我还得到了404。您的博客文章实际上是我在开始配置之前阅读的文档之一,以及JFrog网站上的其他页面。我是否可以在Artifactory中查看一些非常低级的调试日志以了解发生了什么?我将用我在Artifactory日志中找到的内容更新这个问题。恐怕我不得不否决你的答案,因为它不能解决问题,并在命令行上明确给出源代码或使用Chocolate的源代码列表,从Artifactory的角度看没有任何区别:请求是相同的。这可能是我们的Artifactory Pro 6.16.2版本61602900中的一个bug,并且在最近的版本中修复了吗?如果是这样,一个到变更日志的链接将帮助我要求它升级Artifactory。其中任何一个或其他方面可能有关联吗?
$ grep choco *.log
access.log:2021-02-04 15:31:38,164 [DENIED DOWNLOAD] chocolatey-remote-cache:vlc.3.0.12.nupkg  for client : NA / 91.180.197.91.
artifactory.log:2021-02-04 10:57:28,154 [http-nio-8081-exec-992] [INFO ] (o.a.u.r.s.a.c.r.UpdateRepositoryConfigService:64) - Updating repository chocolatey-remote
artifactory.log:2021-02-04 14:36:56,347 [http-nio-8081-exec-1053] [INFO ] (o.a.u.r.s.a.c.r.UpdateRepositoryConfigService:64) - Updating repository chocolatey-remote
request.log:20210204153137|124|REQUEST|91.180.197.91|anonymous|GET|/api/nuget/chocolatey-remote|HTTP/1.0|200|0
request.log:20210204153137|4|REQUEST|91.180.197.91|anonymous|GET|/api/nuget/chocolatey-remote/$metadata|HTTP/1.0|200|0
request.log:20210204153138|128|REQUEST|91.180.197.91|anonymous|GET|/api/nuget/chocolatey-remote/Packages()|HTTP/1.0|200|0
request.log:20210204153138|16|REQUEST|91.180.197.91|anonymous|GET|/api/nuget/chocolatey-remote/Download/vlc/3.0.12|HTTP/1.0|404|0
PS C:\Users\vagrant> choco install vlc --source=https://<ARTIFACTORY>/api/nuget/chocolatey-remote --user=***REDACTED*** --password=***REDACTED***
Chocolatey v0.10.15
Installing the following packages:
vlc
By installing you accept licenses for the packages.
vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
vlc package files install completed. Performing other installation steps.
The install of vlc was NOT successful.
vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found

Chocolatey installed 0/1 packages. 1 packages failed.
 See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Failures
 - vlc (exited 1) - vlc not installed. An error occurred during installation:
 The remote server returned an error: (404) Not Found. Not Found
choco install vlc -s <jfrog-url>/api/nuget/chocolatey-remote -u <username> -p <password>