OctoPack at BuildTime in Visual Studio, 503 Server Unavailable

Hi!

I have set up my visual studio to run octopack while building with:

<RunOctoPack>true</RunOctoPack>
<OctoPackPublishPackageToHttp>http://myOctoServer/octopus/nuget/packages</OctoPackPublishPackageToHttp>
<OctoPackPublishApiKey>API-XXXXXXXXXXXX</OctoPackPublishApiKey>

And of course:
<Import Project="%ProjectPath%\packages\OctoPack.3.0.71\tools\OctoPack.targets" />

It doesn’t seem to work at all otherwise.

Now when I try to build my project I get 503 Server Unavailable error.
I am working in a coorporate environment so a proxy is needed to connect to other servers, however I am able to connect to my server http://myOctoServer/octopus/api/projects and http://myOctoServer/octopus/app#/library/packages through internet explorer without issue.

I also run the Octopus.Client in my project in visual studio to get some information through the api and that works just fine too, fetching the information has no issues.

So, is there some separate proxy setting in octopack that I need to set or could something else be wrong?

Hi Simon,

Thanks for getting in touch! It does seem like you’ve got things configured correctly from the OctoPack point of view. If there was a problem with traversing an authenticated proxy I would have expected to see a 407 Proxy Authentication Required (or similar) - so I would suggest it isn’t a problem with proxy. At the end of the day, we just call nuget.exe push. You could try doing a nuget.exe push directly to the Octopus built-in repository and see if that works.

If proxy still seems to be a problem candidate with nuget.exe push consider looking into the proxy settings for nuget.exe and see if that helps. There are no proxy-related settings directly in OctoPack, but you could pass the parameters to nuget.exe if required using OctoPackNuGetPushProperties.

Is IIS installed on the server that is hosting Octopus Server? It looks like Octopus is hosted in a virtual directory /octopus/ which is fine. It makes me wonder if IIS or Application Request Routing (ARR) is routing your request to the wrong site on the server and giving you the 503 Service Unavailable? Octopus will only return a 503 Service Unavailable when it is starting up. In my experience, if Octopus is running normally and working in most instances, but some action is returning a 503 Service Unavailable, it’s because ARR (or something else) is routing the request to the wrong service. You may find the source of the problem by investigating a Fiddler trace or the IIS logs when you do a nuget.exe push.

If none of this helps, please feel free to reach out again, but make sure to attach the msbuild.log file produced when you run through the troubleshooting steps described here. If you decide to attach the log, either scrub it for sensitive information, or make this thread private by clicking the Make Private button in the forum.

Hope that helps!
Mike

Thank you for that very detailed answer! I have asked my colleagues to look into this since I am not familiar with the setup of our octopus server. I have however manually uploaded my package, since it gets created just fine by octopack. It is just not getting pushed to the server.

Hi Simon,

Thanks for getting back to me. It’s nice that you’ve been able to work around the problem for now. Hopefully your colleagues will figure out what has changed and fix it long term.

Don’t hesitate to reach out if you need help with anything else!

Happy Deployments!
Mike