The Zone of the assembly that failed was: MyComputer

Scenario is Jenkins pipeline to Powershell to Octopus, using octo push in the powershell

Octopus version 2.6.5

Jenkins push stage fails with: Error from Octopus server (HTTP 500 InternalServerError)

The Octopus logs show:

ERROR Unhandled error on request: http://blah.example.com/api/packages/raw?replace=True by myuser@example.com : A deferred (wildcard) permission check was probably omitted
System.Security.SecurityException: A deferred (wildcard) permission check was probably omitted
at Octopus.Server.Permissions.PermissionSet.GetRestrictions(Permission permission, String userId, String[] externalSecurityGroupIds) in y:\work\refs\heads\master\source\Octopus.Server\Permissions\PermissionSet.cs:line 105
at Octopus.Server.Web.Api.NuGet.NuGetPackagePushActionBase1.VerifyPermissionFor(String nuGetPackageId, Permission permission) in y:\work\refs\heads\master\source\Octopus.Server\Web\Api\NuGet\NuGetPackagePushActionBase.cs:line 121 at Octopus.Server.Web.Api.NuGet.NuGetPackagePushActionBase1.Execute() in y:\work\refs\heads\master\source\Octopus.Server\Web\Api\NuGet\NuGetPackagePushActionBase.cs:line 82
at Octopus.Platform.Web.Api.Responder1.Respond(TDescriptor options, NancyContext context) in y:\work\refs\heads\master\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 y:\work\refs\heads\master\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)
The Zone of the assembly that failed was:
MyComputer

searching around shows that this is potentially a registry permissions error, but it’s not clear what should be changed.

Any help would be greatly appreciated!
Mark

EDIT:

Ok, we bounced the Octopus box, and lo and behold, it worked. The first time. Ran the same build a second time, failed with the same error.

Hi Mark,

Thanks for getting in touch. Could you share me the full command you are running to push this package? If you are using a specific tool for it, also let me know which one it is and which version.

You are running a very old version of Octopus which might not be compatible with more recent package pushing tools.

Regards,
Dalmiro

Hi Dalmiro,

The powershell line we are using looks like this:

Invoke-Expression “& ‘$OctoTool’ push "--package=$PackageFile" --apiKey=$ApiKey --server=$OctopusUrl --replace-existing”

Variables look something like this:

$OctoTool: C:\some\path\Octo.exe

$PackageFile: “…\…\Product\Applications\Service\bin\${buildConfiguration}\${cloudId}.${version}.nupkg”

$OctopusUrl: “http://blah.example.com

$ApiKey: API-XXXXXXXXXXXXXXXXXXXXXXXXXXX

I don’t think the command or variables can be too far of the mark, as they do work if we reboot the box. However, upon subsequent attempts, we get the stated error

Hi,

I see what the problem is. You are passing --replace-existing which adds ?replace=true to the API call URL. This switch to force a package push was added to the Octopus Server in 3.2.4. You are running 2.6.5 so its no surprise that the server is getting an odd behavior when you push a package this way.

If you are going to keep using this outdated version of Octopus, you might wanna stick to nuget.exe to push packages. And even using that, you’ll need to stick to a version prior to 3.4 to have better chances of compatibility.

Regards,
Dalmiro

Many thanks for your time Dalmiro - your help is much appreciated