OctopusDeploy: Create release not working for teamcity

Hi, octopus and teamcity is configured and i can deploy from octopus using teamcity nuget package. But when i am trying to create OctopusDeploy: Create release. I am getting this error. Can anyone give me suggestion what can be possible reason?

[11:51:25]Step 3/3: OctopusDeploy: Create release (1m:06s)
[11:51:25][Step 3/3] Octopus Deploy (1m:06s)
[11:51:25][Octopus Deploy] Running command: octo.exe create-release --server http://x.x.x.x:81 --apikey SECRET --project test --enableservicemessages --version 1.0.39 --deployto test --Packageversion=1.0.39
[11:51:25][Octopus Deploy] Creating Octopus Deploy release
[11:51:26][Octopus Deploy] Octopus Deploy Command Line Tool, version 3.3.11+Branch.master.Sha.9fe1e5688698d749fe85e52e3f7be7c98249f194
[11:51:26][Octopus Deploy]
[11:51:26][Octopus Deploy] Build environment is NoneOrUnknown
[11:51:26][Octopus Deploy] Handshaking with Octopus server: http://x.x.x.x:81
[11:52:32][Octopus Deploy] System.Exception: Unable to connect to the Octopus Deploy server. See the inner exception for details. —> System.Net.WebException: Unable to connect to the remote server —> System.Net.Sockets.SocketException: A connection attempt failed because the connected party did not properly respond after a period of time, or established connection failed because connected host has failed to respond x.x.x.x:81
[11:52:32][Octopus Deploy] at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
[11:52:32][Octopus Deploy] at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
[11:52:32][Octopus Deploy] — End of inner exception stack trace —
[11:52:32][Octopus Deploy] at System.Net.HttpWebRequest.GetResponse()
[11:52:32][Octopus Deploy] at Octopus.Client.OctopusClient.DispatchRequest[TResponseResource](OctopusRequest request, Boolean readResponse)
[11:52:32][Octopus Deploy] at Octopus.Client.OctopusClient.Get[TResource](String path, Object pathParameters)
[11:52:32][Octopus Deploy] at Octopus.Client.OctopusClient.EstablishSession()
[11:52:32][Octopus Deploy] — End of inner exception stack trace —
[11:52:32][Octopus Deploy] at Octopus.Client.OctopusClient.EstablishSession()
[11:52:32][Octopus Deploy] at System.Lazy1.CreateValue() [11:52:32][Octopus Deploy] at System.Lazy1.LazyInitValue()
[11:52:32][Octopus Deploy] at System.Lazy`1.get_Value()
[11:52:32][Octopus Deploy] at Octopus.Client.OctopusClient.get_RootDocument()
[11:52:32][Octopus Deploy] at Octopus.Cli.Commands.ApiCommand.Execute(String[] commandLineArguments)
[11:52:32][Octopus Deploy] at Octopus.Cli.Program.Main(String[] args)
[11:52:32][Octopus Deploy] Exit code: -3
[11:52:32][Octopus Deploy] Octo.exe exit code: -3


Hi Mirza,

Thanks for getting in touch. The error message indicates that octo.exe, our command line tool that powers the TeamCity plugin, cannot communicate with the Octopus Server. This should be as simple as double checking the IP address/machine name and ports to fix. It’s also a good idea to ensure the firewall rules are correct to support communication between the two servers.

I’d suggest testing the octo.exe statement from the command line on the TeamCity server. It’s a faster way to test the communication is working as you make any changes.

Hope this helps!


Hi Rob,
Thank you very much for your reply. The problem is solved. For our case Teamcity and Octopus Server in the same server. Teamcity runs on 80 port and Octopus run on 81 port. We used real IP address as Octopus server url like x.x.x.x:81. But as both Teamcity and Octopus Server are in the same server so no need to add IP address , instead of that added localhost as octopus server url like http://localhost:81/ . And it’s working now :slight_smile: . Thanks again for quick response.