Application Fails while trying to load


(Santosh Singh) #1

I am trying to use RabbitMq as transport which is installed on a remote server,
so when I run Nservice bus application on same machine which has RabbitMq server then it works fine but fails while trying to connect remotely.

  1. I have similar setup working in another application
  2. user/password which I am specifying in “Nservicebus/Transport” key has administrator permission

I get following exception:
Exception thrown: ‘RabbitMQ.Client.Exceptions.BrokerUnreachableException’ in mscorlib.dll
Exception thrown: ‘RabbitMQ.Client.Exceptions.BrokerUnreachableException’ in YCM.DWH.EOD.Manager.Calculation.exe
System.Transactions Critical: 0 : http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/UnhandledUnhandled exceptionYCM.DWH.EOD.Manager.Calculation.exeRabbitMQ.Client.Exceptions.BrokerUnreachableException, RabbitMQ.Client, Version=5.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ceNone of the specified endpoints were reachable at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(String clientProvidedName)
at NServiceBus.Transport.RabbitMQ.ConnectionFactory.CreateConnection(String connectionName) in C:\BuildAgent\work\a9e6741f41af7061\src\NServiceBus.RabbitMQ\Connection\ConnectionFactory.cs:line 74
at NServiceBus.Transport.RabbitMQ.QueueCreator.CreateQueueIfNecessary(QueueBindings queueBindings, String identity) in C:\BuildAgent\work\a9e6741f41af7061\src\NServiceBus.RabbitMQ\Administration\QueueCreator.cs:line 21
at NServiceBus.QueuesCreator.Install(String identity) in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Unicast\Queuing\QueuesCreator.cs:line 27
at NServiceBus.InitializableEndpoint.<RunInstallers>d__13.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\InitializableEndpoint.cs:line 184
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NServiceBus.InitializableEndpoint.<Initialize>d__1.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\InitializableEndpoint.cs:line 68
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NServiceBus.Endpoint.<Start>d__1.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Endpoint.cs:line 27
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at YCM.DWH.EOD.Manager.Calculation.Program.&amp;lt;Main&amp;gt;d__1.MoveNext() in D:\WorkSpace\YCM\YCM.Core\Main\Departments\Operations\YCM.DWH.EOD\YCM.DWH.EOD.Manager.Calculation\Program.cs:line 64 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at YCM.DWH.EOD.Manager.Calculation.Program.&amp;lt;Main&amp;gt;(String[] args)</StackTrace><ExceptionString>RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---&amp;gt; RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed ---&amp;gt; System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 192.168.109.19:5672 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress) at System.Net.Sockets.Socket.Connect(EndPoint remoteEP) at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port) at RabbitMQ.Client.TcpClientAdapter.&amp;lt;ConnectAsync&amp;gt;d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at RabbitMQ.Client.Impl.TaskExtensions.&amp;lt;TimeoutAfter&amp;gt;d__1.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout) --- End of inner exception stack trace --- at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func2 selector)
at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
— End of inner exception stack trace —
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(String clientProvidedName)
at NServiceBus.Transport.RabbitMQ.ConnectionFactory.CreateConnection(String connectionName) in C:\BuildAgent\work\a9e6741f41af7061\src\NServiceBus.RabbitMQ\Connection\ConnectionFactory.cs:line 74
at NServiceBus.Transport.RabbitMQ.QueueCreator.CreateQueueIfNecessary(QueueBindings queueBindings, String identity) in C:\BuildAgent\work\a9e6741f41af7061\src\NServiceBus.RabbitMQ\Administration\QueueCreator.cs:line 21
at NServiceBus.QueuesCreator.Install(String identity) in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Unicast\Queuing\QueuesCreator.cs:line 27
at NServiceBus.InitializableEndpoint.&lt;RunInstallers&gt;d__13.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\InitializableEndpoint.cs:line 184
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NServiceBus.InitializableEndpoint.&lt;Initialize&gt;d__1.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\InitializableEndpoint.cs:line 68
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at NServiceBus.Endpoint.&lt;Start&gt;d__1.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Endpoint.cs:line 27
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter1.GetResult() at YCM.DWH.EOD.Manager.Calculation.Program.&amp;lt;Main&amp;gt;d__1.MoveNext() in D:\WorkSpace\YCM\YCM.Core\Main\Departments\Operations\YCM.DWH.EOD\YCM.DWH.EOD.Manager.Calculation\Program.cs:line 64 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter.GetResult() at YCM.DWH.EOD.Manager.Calculation.Program.&amp;lt;Main&amp;gt;(String[] args)</ExceptionString><InnerException><ExceptionType>RabbitMQ.Client.Exceptions.ConnectFailureException, RabbitMQ.Client, Version=5.0.0.0, Culture=neutral, PublicKeyToken=89e7d7c5feba84ce</ExceptionType><Message>Connection failed</Message><StackTrace> at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func2 selector)
at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed —&gt; System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 192.168.109.19:5672
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
at RabbitMQ.Client.TcpClientAdapter.&lt;ConnectAsync&gt;d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.TaskExtensions.&lt;TimeoutAfter&gt;d__1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout)
— End of inner exception stack trace —
at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func`2 selector)
at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints)
at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName)System.Net.Sockets.SocketException, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089An attempt was made to access a socket in a way forbidden by its access permissions 192.168.109.19:5672 at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
at RabbitMQ.Client.TcpClientAdapter.&lt;ConnectAsync&gt;d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.TaskExtensions.&lt;TimeoutAfter&gt;d__1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout)System.Net.Sockets.SocketException (0x80004005): An attempt was made to access a socket in a way forbidden by its access permissions 192.168.109.19:5672
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
at RabbitMQ.Client.TcpClientAdapter.&lt;ConnectAsync&gt;d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.TaskExtensions.&lt;TimeoutAfter&gt;d__1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout)271D
An unhandled exception of type ‘RabbitMQ.Client.Exceptions.BrokerUnreachableException’ occurred in mscorlib.dll
None of the specified endpoints were reachable


(Andreas Öhlund) #2

My hunch is that you need to open up your firewall, can you confirm that port 5672 is open?

See https://www.rabbitmq.com/networking.html for more details


(Santosh Singh) #3

Yes, because when I try to do same thing from another application then it works fine, It fails for few specific applications.


(Andreas Öhlund) #4

Are all those apps on the same server? do the all run using the same user account?


(Santosh Singh) #5

Sorry for not reply, here is the error that I get now
2018-03-19 15:26:28.740 ERROR YCM.DWH.EOD.Manager.ExceptionReport.Program RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable —> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed —> System.Net.Sockets.SocketException: An attempt was made to access a socket in a way forbidden by its access permissions 192.168.109.19:5672
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
at System.Net.Sockets.Socket.Connect(IPAddress address, Int32 port)
at RabbitMQ.Client.TcpClientAdapter.d__2.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.TaskExtensions.d__1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at RabbitMQ.Client.Impl.SocketFrameHandler.ConnectOrFail(ITcpClient socket, AmqpTcpEndpoint endpoint, Int32 timeout)
— End of inner exception stack trace —
at RabbitMQ.Client.EndpointResolverExtensions.SelectOne[T](IEndpointResolver resolver, Func2 selector) at RabbitMQ.Client.Framing.Impl.AutorecoveringConnection.Init(IEndpointResolver endpoints) at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) --- End of inner exception stack trace --- at RabbitMQ.Client.ConnectionFactory.CreateConnection(IEndpointResolver endpointResolver, String clientProvidedName) at RabbitMQ.Client.ConnectionFactory.CreateConnection(String clientProvidedName) at NServiceBus.Transport.RabbitMQ.ConnectionFactory.CreateConnection(String connectionName) in C:\BuildAgent\work\a9e6741f41af7061\src\NServiceBus.RabbitMQ\Connection\ConnectionFactory.cs:line 74 at NServiceBus.Transport.RabbitMQ.QueueCreator.CreateQueueIfNecessary(QueueBindings queueBindings, String identity) in C:\BuildAgent\work\a9e6741f41af7061\src\NServiceBus.RabbitMQ\Administration\QueueCreator.cs:line 21 at NServiceBus.QueuesCreator.Install(String identity) in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Unicast\Queuing\QueuesCreator.cs:line 27 at NServiceBus.InitializableEndpoint.<RunInstallers>d__13.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\InitializableEndpoint.cs:line 184 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NServiceBus.InitializableEndpoint.<Initialize>d__1.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\InitializableEndpoint.cs:line 68 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at NServiceBus.Endpoint.<Start>d__1.MoveNext() in C:\BuildAgent\work\a93f853f0c1b9532\src\NServiceBus.Core\Endpoint.cs:line 27 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Runtime.CompilerServices.TaskAwaiter1.GetResult()
at YCM.DWH.EOD.Manager.ExceptionReport.Program.d__1.MoveNext() in D:\WorkSpace\YCM\YCM.Core\Main\Departments\Operations\YCM.DWH.EOD\YCM.DWH.EOD.Manager.ExceptionReport\Program.cs:line 57


(Andreas Öhlund) #6

That is a sure sign that there is some firewall interfering. Would you be able to verify that TCP communication over port 5672 is allowed btw the involved machines?


(Santosh Singh) #7

Yes, because it works from another application with same settings but different Queue name


(Santosh Singh) #8

You guys were right, it turned out tobe Firewall issue… Thanks