Error finding packages when creating a release

I’m running v2.0.1.763 and I have an issue when I’m trying to create a release. This is a brand new installation and I have not had it working all the way through yet. So, I’m not sure if it’s an issue with the way I’m pushing the NuGet packages from TFS build or if it’s an issue with the Octopus beta 2.0. Here is a summary of the issue:

I queue a new build in TFS and push the package (using octopack) to my own on prem instance of NuGet.Server. All seems right with the world. I can view the new release from the NuGet.Server web page and when I search the NuGet feed within Octopus, it returns all the right versions.

I then go to edit the release I’m working with and when I search for the version, it find it no problem. Then the issue arises - I save the release (click the green ‘save’ button on the Edit Release screen) and I get an error message on the release overview screen - "The resource ‘MTMH.WebService version 2013.12.02.1’ was not found. Here is the stack trace from the log:

2013-12-02 17:04:04.8137 TRACE PUT http://localhost/octopus/api/releases/releases-1
2013-12-02 17:04:04.8605 TRACE GET http://localhost/octopus/api/releases/releases-1
2013-12-02 17:04:04.8917 TRACE GET http://localhost/octopus/api/projects/rearchitecture
2013-12-02 17:04:04.9691 TRACE GET http://localhost/octopus/api/projects/projects-1/releases/2013.12.02.1
2013-12-02 17:04:04.9941 TRACE GET http://localhost/octopus/api/deploymentprocesses/deploymentprocess-projects-1-snapshot-1
2013-12-02 17:04:05.0303 TRACE GET http://localhost/octopus/api/deploymentprocesses/deploymentprocess-projects-1-snapshot-1/template
2013-12-02 17:04:05.0615 TRACE GET http://localhost/octopus/api/releases/releases-1/deployments
2013-12-02 17:04:05.0771 TRACE GET http://localhost/octopus/api/artifacts?regarding=releases-1
2013-12-02 17:04:05.1083 TRACE GET http://localhost/octopus/api/events?regarding=releases-1
2013-12-02 17:04:05.1395 TRACE GET http://localhost/octopus/api/feeds/feeds-1
2013-12-02 17:04:05.1551 TRACE GET http://localhost/octopus/api/variables/variableset-projects-1-snapshot-1
2013-12-02 17:04:05.1863 TRACE GET http://localhost/octopus/api/feeds/feeds-1/packages/notes?packageId=MTMH.WebService&version=2013.12.02.1
2013-12-02 17:04:05.1863 TRACE GET http://localhost/octopus/api/variables/scope-values/projects-1
2013-12-02 17:04:05.2119 ERROR Unhandled error on request: http://localhost/octopus/api/feeds/feeds-1/packages/notes?packageId=MTMH.WebService&version=2013.12.02.1 : One or more errors occurred.
Octopus.Platform.Documents.Persistence.ResourceNotFoundException: The resource ‘MTMH.WebService version 2013.12.02.1’ was not found.
at Octopus.Server.Web.Api.Actions.PackageNotesAction.GetNotes(String feedId, String packageId, String version) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Web\Api\Actions\PackageNotesAction.cs:line 63
at Octopus.Server.Web.Api.Actions.PackageNotesAction.Execute() in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Web\Api\Actions\PackageNotesAction.cs:line 38
at Octopus.Platform.Web.Api.Responder1.Respond(TDescriptor options, NancyContext context) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Platform.Web\Api\Responder.cs:line 163 at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2) at CallSite.Target(Closure , CallSite , Object , Object , NancyContext ) at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass5.<.ctor>b__2(Object o) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 47 at CallSite.Target(Closure , CallSite , Func2 , Object )
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)
2013-12-02 17:04:08.0666 TRACE GET http://localhost/octopus/api/dashboard
2013-12-02 17:04:09.9878 TRACE Stored Pipefish.Messages.Timing.TimeoutElapsedEvent from Clock@SQ-ENG-DEV-BUILD1-3B3F0F16 to Octopus.SquidFinder@SQ-ENG-DEV-BUILD1-3B3F0F16 (id: 7e39413fe36f47e2a217c6954fd720ff env: 08D0BDC18FE74D2D000319EF)
2013-12-02 17:04:10.0034 TRACE Stored Pipefish.Messages.Timing.SetTimeoutCommand from Octopus.SquidFinder@SQ-ENG-DEV-BUILD1-3B3F0F16 to Clock@SQ-ENG-DEV-BUILD1-3B3F0F16 (id: 69cb1d648bf947588c5c940d67159593 env: 08D0BDC18FE9AE85000319F0)
2013-12-02 17:04:10.0034 TRACE Stored Octopus.Server.Communications.Recurrence.RecurCommand from Octopus.SquidFinder@SQ-ENG-DEV-BUILD1-3B3F0F16 to Octopus.SquidFinder@SQ-ENG-DEV-BUILD1-3B3F0F16 (id: 10c2cb3d558c4752801cae3e21760504 env: 08D0BDC18FE9AE85000319F1)
2013-12-02 17:04:12.0937 TRACE GET http://localhost/octopus/api/dashboard

Any thoughts?

Hi David, I will look into this today and get back to you.

Paul

Hi David, sorry for the delay, I’ve recorded this as a bug on our issue tracker:

I assume the package is deploying OK, and the error is limited to the release details screen?

Paul

The deploy does not work. It errors on the Download package step with the following error (from the raw log):

Failed: Download package MTMH.WebService 2013.12.02.3 from NuGet feed: Internal Feed
| Checking package cache for package MTMH.WebService 2013.12.02.3
| Downloading NuGet package MTMH.WebService 2013.12.02.3 from feed: ‘http://eng-dev-build1/NuGetServer/nuget/
| Downloaded packages will be stored in: C:\Octopus\PackageCache\feeds-1
| Finding package (attempt 1 of 5)
| Unable to download package: Could not find package MTMH.WebService 2013.12.02.3 in feed: ‘http://eng-dev-build1/NuGetServer/nuget/
| Could not find package MTMH.WebService 2013.12.02.3 in feed: ‘http://eng-dev-build1/NuGetServer/nuget/
| Octopus.Platform.Deployment.ControlledFailureException: Could not find package MTMH.WebService 2013.12.02.3 in feed: ‘http://eng-dev-build1/NuGetServer/nuget/
| at Octopus.Shared.Packages.PackageDownloader.FindPackage(Int32 attempt, PackageMetadata packageMetadata, IFeed feed, IActivity log) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 143
| at Octopus.Shared.Packages.PackageDownloader.AttemptToFindAndDownloadPackage(Int32 attempt, PackageMetadata packageMetadata, IFeed feed, IActivity log, String cacheDirectory, IPackage& downloadedPackage, String& path) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 118
| at Octopus.Shared.Packages.PackageDownloader.AttemptToDownload(PackageMetadata metadata, IFeed feed, IActivity log) in c:\TeamCity\buildAgent\work\1116bd9da9e239fd\source\Octopus.Shared\Packages\PackageDownloader.cs:line 81

It repeats this 5 times and then fails.

Hi David - I had a shot at replicating this with NuGet.Server v2.7.41101.299 - no luck unfortunately. Are you able to please let us know the version of NuGet.Server that you’re using? Thanks in advance.

sure - the version I’m using is the same (v2.7.41101.299).

Thanks for the follow up - back to the drawing board for me then :slight_smile: … will give it some more thought.

David - Paul pointed me to this thread: http://stackoverflow.com/questions/10716156/unable-to-download-packages-from-a-self-hosted-nuget-server-404-error

It details a number of things that can go wrong when hosting NuGet.Server in IIS - the second answer is the first place to start - making sure that the .nupkg extension is mapped to the application/zip MIME type.

If you have a chance to check over the suggestions in both of those answers please let me know if you continue to have trouble. Positive we’ll get to the bottom of this one eventually! Thanks again.

The TFS step “Push Package(s) to Octopus” does not resolve a variable inside another variable unlike the “Package Application” step which does resolve correctly.

The TFS variable definition is: ArtifactLocation = \chitstapp02\ProdApps\Jay\Databases$(Build.DefinitionName)

The TFS build variable used here is $(ArtifactLocation)\Package$(Build.DefinitionName).$(Build.BuildNumber).nupkg

The log error is


Starting task: Package $(Build.DefinitionName)


“C:\Users********\Downloads\agent\tasks\OctopusPack\1.2.81\Octo.exe” pack --id=“GTS-Databases-Integration” --format=NuPkg --version=2016.10.17.002-Integration --outFolder="\chitstapp02\ProdApps\Jay\Databases\GTS-Databases-Integration\Package" --basePath="\chitstapp02\ProdApps\Jay\Databases\GTS-Databases-Integration\Latest" --author=“Guggenheim Partners” --title=“GTS-Databases-Integration” --description=“GTS-Databases-Integration DACPAC” --releaseNotes=“Built: $(Date:yyyy-MM-dd@HH:mm)” --releaseNotesFile=“C:\TFS Build Agent_work\2\s” --overwrite=True --include=“CommApps.publish.xml” --include=“CommApps.dacpac” --include=“LH.publish.xml” --include="LH.dacpac"
Octopus Deploy Command Line Tool, version 3.4.2+Branch.master.Sha.869d64eaf5d2657a5daadda886a2dd697e2a024c
The release notes file ‘“C:\TFS Build Agent_work\2\s”’ could not be found
Packing “GTS-Databases-Integration” version “2016.10.17.002-Integration”…
Saving “GTS-Databases-Integration.2016.10.17.002-Integration.nupkg” to “\chitstapp02\ProdApps\Jay\Databases\GTS-Databases-Integration\Package”…
Done.


Finishing task: OctopusPack



Starting task: Push Packages to Octopus


Cannot find path ‘\chitstapp02\ProdApps\Jay\Databases$(Build.DefinitionName)\GTS-Databases-Integration.2016.10.17.002-Integration.nupkg’ because it does not exist.


Finishing task: OctopusPush


Hi Jay,

Thanks for getting in touch! We don’t do anything special (to my knowledge) that would cause the $(Build.DefinitionName) to not resolve when other variables like $(Build.BuildNumber) do.

One thought I have is whether this task is running as part of a Build or as part of a Release in Release Management, and therefore perhaps the $(Build.DefinitionName) variable isn’t defined?

Hope that helps!
Mike