Clients not connecting to ESB Server

May 8, 2012 at 12:56 AM

hithere here i am again ... few hours ago you indicated tome that i had to install the server to run the samples and i did and it worked.

 

but as soon as i restarted the PC, i have the same problem again . All services are installed and running.

i believe all samples freeze on  the following line

            if(Topic.Select<TopicName>().State == ObjectState.InValid)

    .....

Any idea why ??

I also would like to setup logging . it may help identify the issue . is there a sample for logging ?

thank you.

Coordinator
May 8, 2012 at 1:07 AM
Edited May 8, 2012 at 1:08 AM

The log should tell you why the application is freezing. And by the way, what is your machine specification?

Logging is enabled by default and are written by default to the C:\ Drive if it exists. But can be configure to a different Location.

By editing {Installation Folder}\ESB Gateway\PServiceBus.Endpoints.Gateway.exe.config. and changing the following line:

 

   <loggerConfig type="PServiceBus.Core.Logger.TextLogger" errorLogPath="C:/servicebus.wcf.error.log" logPath="C:/servicebus.wcf.log.log" tracePath="C:/servicebus.wcf.trace.log" enabled="true"/>

May 8, 2012 at 6:14 PM
Edited May 8, 2012 at 6:18 PM

i have posted a reply yesterday in the issue tracker with log attachments (which can't be done here) . anyway here is a log created by Redis Server when starting . it tries to connect to port 1414 and even looking at all open local and remote ports  , there is no port 1414...  anyway, you have all the log files produced in the zip file attached in the ticket i created yesterday. http://pservicebus.codeplex.com/workitem/9

 

Error occurred at 5/8/2012 6:53:34 PMSystem.Exception: Unable to Connect: sPort: 1414 ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at ServiceStack.Redis.RedisNativeClient.SendCommand(Byte[][] cmdWithBinaryArgs)   --- End of inner exception stack trace ---   at ServiceStack.Redis.RedisNativeClient.CreateConnectionError()   at ServiceStack.Redis.RedisNativeClient.SendExpectMultiData(Byte[][] cmdWithBinaryArgs)   at ServiceStack.Redis.RedisNativeClient.HGetAll(String hashId)   at PServiceBus.Redis.Provider`1.<GetEnumerator>d__33.MoveNext() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Redis\Provider.cs:line 252   at PServiceBus.Core.Manager.ObjectManagerBase`1.<GetEnumerator>d__0.MoveNext() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Manager\ObjectManagerBase.cs:line 56   at System.Linq.Enumerable.<TakeIterator>d__3a`1.MoveNext()   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)   at PServiceBus.Core.Components.MessageDispatcher.Execute() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Components\MessageDispatcher.cs:line 91   at PServiceBus.Core.Runtime.ComponentServices.ComponentServiceProcessor.<>c__DisplayClass6.<ProcessEvent>b__4() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Runtime\ComponentServices\ComponentServiceProcessor.cs:line 75   at PServiceBus.Core.Runtime.MethodHelper.Try(Action action) in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Runtime\MethodHelper.cs:line 22-----------------------
Error occurred at 5/8/2012 6:58:32 PMSystem.Exception: Unable to Connect: sPort: 1437 ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at ServiceStack.Redis.RedisNativeClient.SendCommand(Byte[][] cmdWithBinaryArgs)   --- End of inner exception stack trace ---   at ServiceStack.Redis.RedisNativeClient.CreateConnectionError()   at ServiceStack.Redis.RedisNativeClient.SendExpectMultiData(Byte[][] cmdWithBinaryArgs)   at ServiceStack.Redis.RedisNativeClient.HGetAll(String hashId)   at PServiceBus.Redis.Provider`1.<GetEnumerator>d__33.MoveNext() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Redis\Provider.cs:line 252   at PServiceBus.Core.Manager.ObjectManagerBase`1.<GetEnumerator>d__0.MoveNext() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Manager\ObjectManagerBase.cs:line 56   at System.Linq.Enumerable.<TakeIterator>d__3a`1.MoveNext()   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)   at PServiceBus.Core.Components.MessageDispatcher.Execute() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Components\MessageDispatcher.cs:line 91   at PServiceBus.Core.Runtime.ComponentServices.ComponentServiceProcessor.<>c__DisplayClass6.<ProcessEvent>b__4() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Runtime\ComponentServices\ComponentServiceProcessor.cs:line 75   at PServiceBus.Core.Runtime.MethodHelper.Try(Action action) in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Runtime\MethodHelper.cs:line 22-----------------------
Error occurred at 5/8/2012 6:58:50 PMSystem.Exception: Unable to Connect: sPort: 1448 ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at ServiceStack.Redis.RedisNativeClient.SendCommand(Byte[][] cmdWithBinaryArgs)   --- End of inner exception stack trace ---   at ServiceStack.Redis.RedisNativeClient.CreateConnectionError()   at ServiceStack.Redis.RedisNativeClient.SendExpectMultiData(Byte[][] cmdWithBinaryArgs)   at ServiceStack.Redis.RedisNativeClient.HGetAll(String hashId)   at PServiceBus.Redis.Provider`1.<GetEnumerator>d__33.MoveNext() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Redis\Provider.cs:line 252   at PServiceBus.Core.Manager.ObjectManagerBase`1.<GetEnumerator>d__0.MoveNext() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Manager\ObjectManagerBase.cs:line 56   at System.Linq.Enumerable.<TakeIterator>d__3a`1.MoveNext()   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)   at PServiceBus.Core.Components.MessageDispatcher.Execute() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Components\MessageDispatcher.cs:line 91   at PServiceBus.Core.Runtime.ComponentServices.ComponentServiceProcessor.<>c__DisplayClass6.<ProcessEvent>b__4() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Runtime\ComponentServices\ComponentServiceProcessor.cs:line 75   at PServiceBus.Core.Runtime.MethodHelper.Try(Action action) in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Runtime\MethodHelper.cs:line 22

Coordinator
May 8, 2012 at 6:23 PM

Port 1414 is a client port not server port. It is the port that is generated for the client to connect to the host. It seem something is refusing connection on your system. Can you give me the spec of your pc? Information such as memory and OS would be ok.

Coordinator
May 8, 2012 at 6:25 PM

Can you also let me know if you have some kinda of firewall or software such as norton anti-virus that controls connections.

Thanks,

May 8, 2012 at 6:55 PM

64-bit windows 7 Pro SP1 . 4Gb Ram. using Windows Firewall . i use Clamwin as antivirus.  no other firewall or AV is installed . 

May 8, 2012 at 7:03 PM

here is another log file that has just been created ... 

C:\servicebus.router.error.log_05_08_2012.log : 

Error occurred at 5/8/2012 7:45:32 PMSystem.Exception: Unable to Connect: sPort: 1614 ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at ServiceStack.Redis.RedisNativeClient.SendCommand(Byte[][] cmdWithBinaryArgs)   --- End of inner exception stack trace ---   at ServiceStack.Redis.RedisNativeClient.CreateConnectionError()   at ServiceStack.Redis.RedisNativeClient.SendExpectMultiData(Byte[][] cmdWithBinaryArgs)   at ServiceStack.Redis.RedisNativeClient.HGetAll(String hashId)   at PServiceBus.Redis.Provider`1.<GetEnumerator>d__33.MoveNext() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Redis\Provider.cs:line 252   at PServiceBus.Core.Manager.ObjectManagerBase`1.<GetEnumerator>d__0.MoveNext() in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Core\Manager\ObjectManagerBase.cs:line 56   at System.Linq.Buffer`1..ctor(IEnumerable`1 source)   at System.Linq.Enumerable.ToArray[TSource](IEnumerable`1 source)   at PServiceBus.Services.Gateway.Services.RouterService.GetServices(RouterRequest request) in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Services.Gateway\Services\RouterService.cs:line 30-----------------------
Error occurred at 5/8/2012 7:45:43 PMSystem.Exception: Unable to Connect: sPort: 1623 ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at ServiceStack.Redis.RedisNativeClient.SendCommand(Byte[][] cmdWithBinaryArgs)   --- End of inner exception stack trace ---   at ServiceStack.Redis.RedisNativeClient.CreateConnectionError()   at ServiceStack.Redis.RedisNativeClient.SendExpectInt(Byte[][] cmdWithBinaryArgs)   at ServiceStack.Redis.RedisNativeClient.HDel(String hashId, Byte[] key)   at PServiceBus.Redis.Provider`1.<>c__DisplayClass2a.<Delete>b__29(RedisNativeClient client) in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Redis\Provider.cs:line 223   at PServiceBus.Redis.Provider`1.Query[TReturn](Func`2 func) in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Redis\Provider.cs:line 42-----------------------
Error occurred at 5/8/2012 7:45:43 PMSystem.Exception: Unable to Connect: sPort: 1624 ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host   at System.Net.Sockets.Socket.Send(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)   at ServiceStack.Redis.RedisNativeClient.SendCommand(Byte[][] cmdWithBinaryArgs)   --- End of inner exception stack trace ---   at ServiceStack.Redis.RedisNativeClient.CreateConnectionError()   at ServiceStack.Redis.RedisNativeClient.SendExpectInt(Byte[][] cmdWithBinaryArgs)   at ServiceStack.Redis.RedisNativeClient.HSet(String hashId, Byte[] key, Byte[] value)   at PServiceBus.Redis.Provider`1.<>c__DisplayClass1b.<Add>b__1a(RedisNativeClient client) in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Redis\Provider.cs:line 173   at PServiceBus.Redis.Provider`1.Query(Action`1 action) in C:\Users\rpgmaker\Desktop\pServiceBus\pServiceBus 2.0.0\Src\PServiceBus.Redis\Provider.cs:line 30-----------------------

May 8, 2012 at 7:04 PM

and another 

C:\servicebus.wcf.error.log_05_08_2012.log

Error occurred at 5/8/2012 7:49:39 PMSystem.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt.   at ZMQ.C.zmq_recv(IntPtr socket, IntPtr msg, Int32 flags)   at ZMQ.Socket.Recv(Byte[] message, Int32& size, SendRecvOpt[] flags)   at ZMQ.Socket.Recv()   at Phoenix.ZeroMQConnectors.ZeroMQReceiver.HandleCommand()-----------------------
Error occurred at 5/8/2012 7:49:40 PMSystem.NullReferenceException: Object reference not set to an instance of an object.   at Phoenix.ZeroMQConnectors.ZeroMQReceiver.Release()   at Phoenix.ZeroMQConnectors.ZeroMQBase.Reconnect()   at Phoenix.ZeroMQConnectors.ZeroMQReceiver.HandleCommand()   at System.Threading.Tasks.Task.InnerInvoke()   at System.Threading.Tasks.Task.Execute()-----------------------

Coordinator
May 8, 2012 at 7:06 PM

Can you make sure the Redis Server is running if it not running. 

Then stop the PServiceBus.ServiceMonitor service followed by the rest of all the other PServiceBus.* services. After you do that, start the PServiceBus.ServiceMonitor and it should start up all the other service again. Try  the samples again and see if they work

And Let me know if restarting them fixes your problem. I am sorry i am not able to reproduce the same problem :)

Coordinator
May 8, 2012 at 7:08 PM

If the suggestion above does not fix the problem. Try uninstalling psb and reinstalling it again. 

May 8, 2012 at 7:15 PM

will do right a way.

May 8, 2012 at 10:16 PM

very weered ... followed your suggestions.. it did not work. re-installed . nada ... same thing.

deleted the files and re-installed , it worked.... shutdown and tried again ... same problem ... 

it looks like either the files are being corrupted somehow or my firewall, even turned off is still active .... 

Coordinator
May 8, 2012 at 10:22 PM

To eliminate that it could be the ClamWin. Can you uninstall ClamWin and also uninstall psb? Then then reinstall psb again and make sure you are installing it as an admin. Let me know what happen after you do that. 

The only different between my system and yours is that I do not have an Anti virus installed.

 

Thanks. 

May 8, 2012 at 10:29 PM

in the windows event log , i found alot of these errors  ...

Application: PServiceBus.Endpoints.Gateway.exeFramework Version: v4.0.30319

Description: The process was terminated due to an unhandled exception.

Exception Info: System.AccessViolationExceptionStack:   

at ZMQ.C.zmq_msg_init_size(IntPtr, Int32)   

at ZMQ.Socket.Send(Byte[], Int32, Int32, ZMQ.SendRecvOpt[])   

at ZMQ.Socket.Send(Byte[], ZMQ.SendRecvOpt[])   

at ZMQ.Socket.Send(Byte[])   

at Phoenix.ZeroMQConnectors.ZeroMQReceiver.SendEmptyResponse()   

at Phoenix.ZeroMQConnectors.ZeroMQReceiver.HandleCommand()   

at System.Threading.Tasks.Task.InnerInvoke()   

at System.Threading.Tasks.Task.Execute()   

at System.Threading.Tasks.Task.ExecutionContextCallback(System.Object)   

at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)   

at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)   

at System.Threading.Tasks.Task.ExecuteWithThreadLocal(System.Threading.Tasks.Task ByRef)   

at System.Threading.Tasks.Task.ExecuteEntry(Boolean)   

at System.Threading.Tasks.ThreadPoolTaskScheduler.LongRunningThreadWork(System.Object)   

at System.Threading.ThreadHelper.ThreadStart_Context(System.Object)   

at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)   

at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)   

at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object)   

at System.Threading.ThreadHelper.ThreadStart(System.Object)

Coordinator
May 8, 2012 at 10:30 PM

Did this happen when you try to reinstall or uninstall? I am sure there will be error since you have been having problem for a while now :) which I cannot happen to reproduce :)

May 8, 2012 at 11:11 PM

i ran PServiceBusSetup.exe which deletes only the services and recreates them ...

but when i delete physically the files and run setup again ... it works.      beats me .... very strange situation ... 

anyway .. it is working now after confirming "delete files manually from install folder and re-installing again ...

i apreciate your help and patience. 

i'll let you know if i find out what's going on

 

in the meantime , i noticed a behavior i would like your thoughts about it :

let's take the invoicing sample ... i start the invoicing client, send multiple messages , then start the invoicing service ... it does not pickup the existing requests but only the new ones and it becomes really slow.  same scenario happened with the starbucks sample ....

is that normal ? shouldn't it grab all what's in the queue and process it and send a reply back for the client to pick up when connected ? i'm thinking this is why we are into messaging :)

 

 

Coordinator
May 8, 2012 at 11:19 PM

If you want to uninstall PServiceBus, you actually need to run the uninstall.exe in the program files folder which will stop all the services and then delete all the files instead of just simply running PServiceBusSetup.exe.

It is normal :) since All the samples are configure to run using TcpTransport to make running the sample easier without having to install a queue on the machine.

So if you run just part of the app and not all then you will not receive any message :) even though the ESB does retry the message based on configuration 5 times. The nature of Tcp means you have to be connected to get messages.

If you want to make it to use a queue, then you will have configure it to use something like MSMQ or RabbitMQ by using the "Using" method of the ESBMessageResponse and ESBMessageRequest and passing an ITransport for either MSMQ or RabbitMQ.

Only the JS API Web chat uses a queue(RabbitMQ, you will need to install one in order to run that)

Coordinator
May 8, 2012 at 11:25 PM

Just remember than messaging is just one part of using an ESB. ESB can also communicate with different transport protocols. PServiceBus currently supports the following as shown on the main page:

 

 WCF(NetTcp), MSSQL, WP7 Push Notification, MSMQ, RabbitMQ, Redis, RavenDB, TCP, WebService, HTTP, Email

May 9, 2012 at 1:53 AM

yes i saw that which is great. it would be nice to have samples or snippets to show how to configure and use each transport protocol.

Coordinator
May 9, 2012 at 2:20 AM

That would be nice :). So far I only have one showing how to use a Tcp transport here in the documentation: http://pservicebus.codeplex.com/wikipage?title=How%20to%20subscribe%20to%20a%20topic&referringTitle=Documentation .

For WCF(NetTcp) transport, there is NetTcpCommunication sample(http://pservicebus.codeplex.com/SourceControl/changeset/view/64929b2b97e4#pServiceBus%202.0.0%2fSamples%2fNetTcpCommunication%2fNetTcpCommunication%2fProgram.cs),

For WP7 Push Notification I have a WP7 Chat App(http://pservicebus.codeplex.com/SourceControl/changeset/view/64929b2b97e4#pServiceBus%202.0.0%2fSamples%2fWP7ChatApp%2fWP7ChatApp%2fMainPage.xaml.cs),

For Web Service/Http  Sample(http://pservicebus.codeplex.com/SourceControl/changeset/view/64929b2b97e4#pServiceBus%202.0.0%2fSamples%2fInvokeWebService%2fInvokeWebService%2fProgram.cs)

For RabbitMQ (JS Web Chat: http://pservicebus.codeplex.com/SourceControl/changeset/view/64929b2b97e4#pServiceBus%202.0.0%2fSamples%2fJS%20API%20WebChat%2fScripts%2fchat.js  )

May 9, 2012 at 10:39 AM

You rock :)