Error while creating release from TeamCity

Hi,

This integration was working earlier today, but recently we have started to see failures creating an Octopus release from TeamCity. We’re running Octopus version 3.3.14. Here’s a relevant portion of the TeamCity log:

[21:47:23][Octopus Deploy] Finding latest NuGet package for step: Download Active Index
[21:47:23][Octopus Deploy] Error from Octopus server (HTTP 500): Octopus Server returned an error: The operation completed successfully
[21:47:23][Octopus Deploy] Server exception:
[21:47:23][Octopus Deploy] System.ComponentModel.Win32Exception (0x80004005): The operation completed successfully
[21:47:23][Octopus Deploy] at MS.Win32.UnsafeNativeMethods.RegisterClassEx(WNDCLASSEX_D wc_d)
[21:47:23][Octopus Deploy] at MS.Win32.HwndWrapper…ctor(Int32 classStyle, Int32 style, Int32 exStyle, Int32 x, Int32 y, Int32 width, Int32 height, String name, IntPtr parent, HwndWrapperHook[] hooks)
[21:47:23][Octopus Deploy] at System.Windows.Threading.Dispatcher…ctor()
[21:47:23][Octopus Deploy] at System.Windows.Threading.Dispatcher.get_CurrentDispatcher()
[21:47:23][Octopus Deploy] at MS.Internal.WeakEventTable…ctor()
[21:47:23][Octopus Deploy] at MS.Internal.WeakEventTable.get_CurrentWeakEventTable()
[21:47:23][Octopus Deploy] at NuGet.SendingRequestEventManager.get_CurrentManager()
[21:47:23][Octopus Deploy] at NuGet.DataServicePackageRepository…ctor(IHttpClient client, PackageDownloader packageDownloader)
[21:47:23][Octopus Deploy] at Octopus.Core.Packages.OctopusPackageRepositoryFactory.CreateRepository(String packageSource) in Y:\work\refs\tags\3.3.14\source\Octopus.Core\Packages\OctopusPackageRepositoryFactory.cs:line 40
[21:47:23][Octopus Deploy] at Octopus.Core.Packages.OctopusPackageRepositoryFactory.CreateRepository(String packageSource, ICredentials credentials) in Y:\work\refs\tags\3.3.14\source\Octopus.Core\Packages\OctopusPackageRepositoryFactory.cs:line 25
[21:47:23][Octopus Deploy] at Octopus.Server.Web.Api.Actions.PackageSearchAction.Search(String feedId, String packageId, Boolean partialMatch, Boolean includeMultipleVersions, Boolean includeNotes, Boolean includePreRelease, Int32 take, IVersionSpec versionRange, Regex preReleaseTag) in Y:\work\refs\tags\3.3.14\source\Octopus.Server\Web\Api\Actions\PackageSearchAction.cs:line 68
[21:47:23][Octopus Deploy] at Octopus.Server.Web.Api.Actions.PackageSearchAction.Execute() in Y:\work\refs\tags\3.3.14\source\Octopus.Server\Web\Api\Actions\PackageSearchAction.cs:line 56
[21:47:23][Octopus Deploy] at Octopus.Server.Web.Infrastructure.Api.Responder`1.Respond(TDescriptor options, NancyContext context) in Y:\work\refs\tags\3.3.14\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162
[21:47:23][Octopus Deploy] at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
[21:47:23][Octopus Deploy] at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Y:\work\refs\tags\3.3.14\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46
[21:47:23][Octopus Deploy] at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)
[21:47:23][Octopus Deploy] -----------------------
[21:47:23][Octopus Deploy]
[21:47:23][Octopus Deploy] Exit code: -7
[21:47:23][Octopus Deploy] Octo.exe exit code: -7

Hi Robert,

Thanks for getting in touch! The problem you are encountering here is actually a NuGet handle leak. The known fix for this at the moment is to restart the Octopus server service.
This issue should be resolved in our 3.4 update. :slight_smile:

Here is the GitHub issue that talks about this issue: https://github.com/OctopusDeploy/Issues/issues/1071

Hope that helps.

Regards,
Daniel

Is there an ETA on when 3.4 might drop? This issue is really hurting us.

In the meantime, are there other workarounds? This happens frequently enough that restarts aren’t practical.

Thanks,
Erick

Hi Erick,

I am sorry to hear that this is causing you so much trouble.

Sadly the only real workaround at the moment is restarting the service. We have a few customers who are doing nightly restarts of the Octopus service to deal with the handle leak.
As for 3.4 we are aiming to see it land at the beginning of august.

Regards,
Daniel

Is there any chance that this could make it into a patch release of 3.3? With some projects we can only get one or two releases out before this problem starts cropping up.

Thanks,
Erick

Hi Erick,

Unfortunately the NuGet libraries touch everything in Octopus so replacing them will require a full Beta lifecycle and lots of testing to ensure nothing I broken by the implementation.
We are aware of the impact that this is having on Octopus customers and are trying hard to keep on schedule for our 3.4 launch.

Regards,
Daniel