Octopus Server crashes with connection refused 127.0.0.1:10930

Hi,

After installing 1.0.13.1206 the Octopus Server windows service keeps crashing with the error below. Any idea how to fix this? Is it permission based? Nothing else on the system is using that port and the firewall is disabled.

2012-06-25 13:16:22,332 [6] ERROR Octopus [(null)] - Autofac.Core.DependencyResolutionException: An exception was thrown while executing a resolve operation. See the InnerException for details. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:10930
  at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
  at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
  --- End of inner exception stack trace ---
  at System.Net.HttpWebRequest.GetResponse()
  at Raven.Client.Connection.HttpJsonRequest.ReadStringInternal(Func`1 getResponse) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:line 292
  at Raven.Client.Connection.HttpJsonRequest.ReadResponseString() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:line 214
  at Raven.Client.Connection.HttpJsonRequest.ExecuteRequest() in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\HttpJsonRequest.cs:line 158
  at Raven.Client.Connection.ServerClient.DirectPutIndex(String name, String operationUrl, Boolean overwrite, IndexDefinition definition) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:line 680
  at Raven.Client.Connection.ServerClient.<>c__DisplayClass3b.<PutIndex>b__3a(String operationUrl) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:line 659
  at Raven.Client.Connection.ServerClient.TryOperation[T](Func`2 operation, String operationUrl, Boolean avoidThrowing, T& result) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:line 230
  at Raven.Client.Connection.ServerClient.ExecuteWithReplication[T](String method, Func`2 operation) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:line 194
  at Raven.Client.Connection.ServerClient.PutIndex(String name, IndexDefinition definition, Boolean overwrite) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Connection\ServerClient.cs:line 659
  at Raven.Client.Indexes.AbstractIndexCreationTask.Execute(IDatabaseCommands databaseCommands, DocumentConvention documentConvention) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Indexes\AbstractIndexCreationTask.cs:line 121
  at Raven.Client.Indexes.IndexCreation.CreateIndexes(ExportProvider catalogToGetnIndexingTasksFrom, IDatabaseCommands databaseCommands, DocumentConvention conventions) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Indexes\IndexCreation.cs:line 46
  at Raven.Client.Indexes.IndexCreation.CreateIndexes(ExportProvider catalogToGetnIndexingTasksFrom, IDocumentStore documentStore) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Indexes\IndexCreation.cs:line 57
  at Raven.Client.Indexes.IndexCreation.CreateIndexes(Assembly assemblyToScanForIndexingTasks, IDocumentStore documentStore) in c:\Builds\RavenDB-Stable\Raven.Client.Lightweight\Indexes\IndexCreation.cs:line 34
  at Octopus.Core.Persistance.PersistanceModule.<Load>b__1(IComponentContext c) in c:\BuildAgent\work\7bf5272a44079f5\source\Octopus.Core\Persistance\PersistanceModule.cs:line 36
  at Autofac.Builder.RegistrationBuilder.<>c__DisplayClass1`1.<ForDelegate>b__0(IComponentContext c, IEnumerable`1 p)
  at Autofac.Core.Activators.Delegate.DelegateActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
  at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
  at Autofac.Core.Lifetime.LifetimeScope.GetOrCreateAndShare(Guid id, Func`1 creator)
  at Autofac.Core.Resolving.InstanceLookup.Execute()
  at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
  at Autofac.Core.Activators.Reflection.ConstructorParameterBinding.Instantiate()
  at Autofac.Core.Activators.Reflection.ReflectionActivator.ActivateInstance(IComponentContext context, IEnumerable`1 parameters)
  at Autofac.Core.Resolving.InstanceLookup.Activate(IEnumerable`1 parameters)
  at Autofac.Core.Resolving.InstanceLookup.Execute()
  at Autofac.Core.Resolving.ResolveOperation.GetOrCreateInstance(ISharingLifetimeScope currentOperationScope, IComponentRegistration registration, IEnumerable`1 parameters)
  at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
  --- End of inner exception stack trace ---

Server stack trace: 
  at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
  at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
  at Autofac.Features.LazyDependencies.LazyRegistrationSource.<>c__DisplayClass5`1.<>c__DisplayClass7.<CreateLazyRegistration>b__4()
  at System.Lazy`1.CreateValue()

Exception rethrown at [0]: 
  at Autofac.Core.Resolving.ResolveOperation.Execute(IComponentRegistration registration, IEnumerable`1 parameters)
  at Autofac.Core.Lifetime.LifetimeScope.ResolveComponent(IComponentRegistration registration, IEnumerable`1 parameters)
  at Autofac.Features.LazyDependencies.LazyRegistrationSource.<>c__DisplayClass5`1.<>c__DisplayClass7.<CreateLazyRegistration>b__4()
  at System.Lazy`1.CreateValue()
  at System.Lazy`1.LazyInitValue()
  at Octopus.Server.Commands.RunCommand.Start() in c:\BuildAgent\work\7bf5272a44079f5\source\Octopus.Server\Commands\RunCommand.cs:line 52
  at Octopus.Shared.Startup.WindowsServiceHost.RunService() in c:\BuildAgent\work\7bf5272a44079f5\source\Octopus.Shared\Startup\WindowsServiceHost.cs:line 48

Hi,

Are any other errors logged by the Octopus server on starting up?

Could you try stopping the service, and running it interactively (double click the Octopus.Server EXE)?

Paul

I’ve run into this when there is a security issue. Either the Octopus Service account, the one set to run as under the service, doesn’t have permissions to the C:\Program Files (x86)\Octopus folder or the Data folder. The configuration app needs to support running the service as a user. Then you could set the permissions correctly.

Seems the service refuses to run under a user account. I’ve add file logging to nlog, not no errors are showing up. It seems like a hard crash of the service. Anyway to capture what could be happening?

Hi,

The service should be able to run under a user account, but that user account is going to need the right set of permissions. Can you try making the service account a local Administrator and tell me if that gets you any further? Then we can dial back the permissions.

Paul

Paul:

I too am getting a similar error running under a service / user account. The application does run correctly when the user is granted administrator access – however, it would be preferred if it did not need that level of elevation. I also tried setting the service account to the User group but still return the same error as the original poster. Same goes with the Power User group.

Paul:

Perhaps ignore my comment – the service account works if I browse locally on the box. However, we are fronting the Octopus server through an F5 VIP, which seems to be causing an issue with the ravenDB, as explained in this thread:

http://help.octopusdeploy.com/discussions/problems/444-octopus-server-failed-to-start-after-install

I am attempting to debug.