Internal NuGet Server - push fails with 500 Internal Server Error

Hi,

We have had builds in TeamCity intermittently hit an issue when pushing NuGet packages to our Octopus internal NuGet server. No change was made in either system or process. The error in the Octopus log is:

2016-12-12 10:48:00.5737 259 ERROR Unhandled error on request: http://{redacted}/nuget/packages/ by {redacted} : The directory is not empty.

System.IO.IOException: The directory is not empty.

at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.Directory.DeleteHelper(String fullPath, String userPath, Boolean recursive, Boolean throwOnTopLevelDirectoryNotFound)
at System.IO.Directory.Delete(String fullPath, String userPath, Boolean recursive, Boolean checkHost)
at Octopus.Shared.Util.OctopusPhysicalFileSystem.DeleteDirectory(String path) in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Shared\Util\OctopusPhysicalFileSystem.cs:line 85
at Octopus.Server.Web.Api.NuGet.PackagePushActionBase1.Execute() in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Server\Web\Api\NuGet\PackagePushActionBase.cs:line 105 at Octopus.Server.Web.Infrastructure.Api.Responder1.Respond(TDescriptor options, NancyContext context) in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Server\Web\Infrastructure\Api\Responder.cs:line 162
at System.Dynamic.UpdateDelegates.UpdateAndExecute3[T0,T1,T2,TRet](CallSite site, T0 arg0, T1 arg1, T2 arg2)
at Octopus.Server.Web.Api.OctopusRestApiModule.<>c__DisplayClass0_0.<.ctor>b__0(Object o) in Z:\BuildAgent\work\cd33152532ae115f\source\Octopus.Server\Web\Api\OctopusRestApiModule.cs:line 46
at Nancy.Routing.Route.<>c__DisplayClass4.b__3(Object parameters, CancellationToken context)

Has anyone else faced a similar issue?

Thanks!

Boyd