八达通下载软件包错误:根据《开放包装公约》规范

时间:2018-07-18 14:21:40

标签: nuget-package octopus-deploy

我已将软件包上载到我们的nuget提要中,并且在我们的流程中有一个软件包部署任务,但是“获取软件包”步骤失败并出现以下错误:

Downloading NuGet package <Package> from feed: 'http://feed/nuget/Default'
15:11:42Error
Unable to download package: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
15:11:42Error
Failed to download package <Package> from feed: 'http://feed/nuget/Default'
15:11:42Error
System.Exception: The package could not be downloaded from NuGet. If you are getting a package verification error, try switching to a Windows File Share package repository to see if that helps.
15:11:42Error
   at Calamari.Integration.PackageDownload.PackageDownloader.AttemptToDownload(String packageId, SemanticVersion version, Uri feedUri, String cacheDirectory, String& downloadedTo, IPackage& downloaded) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Integration\PackageDownload\PackageDownloader.cs:line 146
15:11:42Error
   at Calamari.Integration.PackageDownload.PackageDownloader.DownloadPackage(String packageId, SemanticVersion version, String feedId, Uri feedUri, Boolean forcePackageDownload, String& downloadedTo, String& hash, Int64& size) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Integration\PackageDownload\PackageDownloader.cs:line 45
15:11:42Error
   at Calamari.Commands.DownloadPackageCommand.Execute(String[] commandLineArguments) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Commands\DownloadPackageCommand.cs:line 59

看原始日志,我可以看到:

                |       Running: Download package Sitecore version 8.2.2 from 

http://feed/nuget/Default
14:09:33   Verbose  |         Octopus Deploy: Calamari version 3.3.32+Branch.master.Sha.d4b60a3db38fae9b6afdec2d088705a7689dfb08
14:09:33   Verbose  |         Name                           Value
14:09:33   Verbose  |         ----                           -----
14:09:33   Verbose  |         PSVersion                      5.0.10586.117
14:09:33   Verbose  |         PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
14:09:33   Verbose  |         BuildVersion                   10.0.10586.117
14:09:33   Verbose  |         CLRVersion                     4.0.30319.42000
14:09:33   Verbose  |         WSManStackVersion              3.0
14:09:33   Verbose  |         PSRemotingProtocolVersion      2.3
14:09:33   Verbose  |         SerializationVersion           1.1.0.1
14:09:33   Verbose  |         Octopus Deploy: Calamari version 3.3.32+Branch.master.Sha.d4b60a3db38fae9b6afdec2d088705a7689dfb08
14:09:33   Verbose  |         Checking package cache for package <Package>
14:09:33   Info     |         Downloading NuGet package <Package> from feed: 'http://feed/nuget/Default'
14:09:33   Verbose  |         Downloaded package will be stored in: 'C:\Octopus\Files\feeds-'
14:09:33   Verbose  |         Finding package (attempt 1 of 5)
14:09:33   Verbose  |         Found package Sitecore version 8.2.2
14:09:33   Verbose  |         Downloading to: C:\Octopus\Files\feeds-\<Package>_E5E7A496910166469362029C4D3EBA0F.nupkg
14:09:33   Verbose  |         A direct download is possible; bypassing the NuGet machine cache
14:09:33   Verbose  |         Attempt 1 of 5: Unable to download package: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
14:09:33   Verbose  |         Finding package (attempt 2 of 5)
14:09:33   Verbose  |         Found package Sitecore version 8.2.2
14:09:33   Verbose  |         Downloading to: C:\Octopus\Files\feeds-\<Package>_F85FDFD2EF823C41BDBB00C7F0EB1542.nupkg
14:09:33   Verbose  |         A direct download is possible; bypassing the NuGet machine cache
14:10:12   Verbose  |         Attempt 2 of 5: Unable to download package: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
14:10:17   Verbose  |         Finding package (attempt 3 of 5)
14:10:17   Verbose  |         Found package Sitecore version 8.2.2
14:10:17   Verbose  |         Downloading to: C:\Octopus\Files\feeds-\<Package>_15F1514B91F27942A9EF470B11369AA7.nupkg
14:10:17   Verbose  |         A direct download is possible; bypassing the NuGet machine cache
14:10:47   Verbose  |         Attempt 3 of 5: Unable to download package: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
14:10:52   Verbose  |         Finding package (attempt 4 of 5)
14:10:52   Verbose  |         Found package Sitecore version 8.2.2
14:10:52   Verbose  |         Downloading to: C:\Octopus\Files\feeds-\<Package>_3A117290B32E084485CBC25FA4D17611.nupkg
14:10:52   Verbose  |         A direct download is possible; bypassing the NuGet machine cache
14:11:32   Verbose  |         Attempt 4 of 5: Unable to download package: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
14:11:32   Verbose  |         Finding package (attempt 5 of 5)
14:11:32   Verbose  |         Found package Sitecore version 8.2.2
14:11:32   Verbose  |         Downloading to: C:\Octopus\Files\feeds-\<Package>_E78C9F7C3950E6449F88B98A13C966A2.nupkg
14:11:32   Verbose  |         A direct download is possible; bypassing the NuGet machine cache
14:11:37   Verbose  |         Attempt 5 of 5: Unable to download package: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
14:11:42   Error    |         Unable to download package: Part URI is not valid per rules defined in the Open Packaging Conventions specification.
14:11:42   Error    |         Failed to download package <Package> from feed: 'http://feed/nuget/Default'
14:11:42   Error    |         System.Exception: The package could not be downloaded from NuGet. If you are getting a package verification error, try switching to a Windows File Share package repository to see if that helps.
14:11:42   Error    |         at Calamari.Integration.PackageDownload.PackageDownloader.AttemptToDownload(String packageId, SemanticVersion version, Uri feedUri, String cacheDirectory, String& downloadedTo, IPackage& downloaded) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Integration\PackageDownload\PackageDownloader.cs:line 146
14:11:42   Error    |         at Calamari.Integration.PackageDownload.PackageDownloader.DownloadPackage(String packageId, SemanticVersion version, String feedId, Uri feedUri, Boolean forcePackageDownload, String& downloadedTo, String& hash, Int64& size) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Integration\PackageDownload\PackageDownloader.cs:line 45
14:11:42   Error    |         at Calamari.Commands.DownloadPackageCommand.Execute(String[] commandLineArguments) in Z:\BuildAgent\work\14ffc968155e4956\source\Calamari\Commands\DownloadPackageCommand.cs:line 59

如果我登录触手,我会看到该软件包已被多次下载。

是什么原因导致错误?

1 个答案:

答案 0 :(得分:0)

这最终是与我用来创建软件包的NuGet版本(最新)和Octopus版本(很旧)的兼容性问题。

为解决此问题,我下载了NuGet的旧2.8.6版本,并使用pack命令生成软件包。这解决了问题。