Cannot connect to rabbitmq - rabbitmq

Can not connect to internal Rabbit MQ instance. Receive following error:
The AMQP operation was interrupted: AMQP close-reason, initiated by Library, code=541, text="Unexpected Exception", classId=0, methodId=0, cause=System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at RabbitMQ.Client.Impl.Frame.ReadFrom(NetworkBinaryReader reader)
at RabbitMQ.Client.Impl.SocketFrameHandler_0_9.ReadFrame()
at RabbitMQ.Client.Impl.ConnectionBase.MainLoopIteration()
at RabbitMQ.Client.Impl.ConnectionBase.MainLoop()
Could it be that my firewall is blocking required port?

Ok, problem solved. Not sure if would be helpful for someone, but: there was old MassTransit (RabbitMQ client) version, which required to set in URI not just vhost, but also queue address.

Related

Why would S3 bucket connection require EC2 access when connecting from a remote app

I have an .NET app that upload files to S3 bucket. The app hosted in a server in a closed network, so we created firewall rule to whitelist outbound traffic to S3(AP-Southeast-2) IP ranges. We noticed that there are intermittent connection issues and throwing following exception;
Amazon.Runtime.AmazonServiceException: A WebException with status SendFailure was thrown. ---> System.Net.WebException: The underlying connection was closed: An unexpected error occurred on a send. ---> System.IO.IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host
at System.Net.Sockets.Socket.Receive(Byte[] buffer, Int32 offset, Int32 size, SocketFlags socketFlags)
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
--- End of inner exception stack trace ---
at System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size)
at System.Net.FixedSizeReader.ReadPacket(Byte[] buffer, Int32 offset, Int32 count)
at System.Net.Security.SslState.StartReceiveBlob(Byte[] buffer, AsyncProtocolRequest asyncRequest)
We no longer get intermittent connection issue when we allow all outbound traffic. But we noticed that there are outbound traffic to EC2 IP range as well.
Question: Why would S3 bucket connection require EC2 access when connecting from a remote app?

System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host

issue:WCF application, when the NetTCP client calls the server-side remote method (there are many remote methods, the server-side cpu/memory is normal). The following errors occur very occasionally every day.
error info:
System.ServiceModel.CommunicationException: The socket connection was aborted. This could be caused by an error processing your message or a receive timeout being exceeded by the remote host, or an underlying network resource issue. Local socket timeout was '00:01:00'. ---> System.Net.Sockets.SocketException: An existing connection was forcibly closed by the remote host at System.ServiceModel.Channels.SocketConnection.Write(Byte[] buffer, Int32 offset, Int32 size, Boolean immediate, TimeSpan timeout)
Environment: Windows 2008 R2, .NET Framework 4.5
Service setting:
NetTcpBinding: listenBacklog="1000",maxConnections="1000" ReceiveTimeout="12:00:00",percall ServiceThrottling : maxConcurrentCalls="1000",percall DataContractSerializer :maxItemsInObjectGraph="2147483647"
Client setting: TcpBinding CloseTimeout="00:01:00" OpenTimeout="00:00:10" ReceiveTimeout="00:01:00" SendTimeout="00:01:00" TransferMode="Buffered" ListenBacklog="1000" MaxBufferPoolSize="1073741824" MaxBufferSize="1073741824" MaxConnections="100" MaxReceivedMessageSize="1073741824" UseDefaultWebProxy="false" HostNameComparisonMode="StrongWildcard"> ReaderQuotas MaxArrayLength="163840000" MaxBytesPerRead="1048576" MaxDepth="256" MaxNameTableCharCount="163840000" MaxStringContentLength="163840000"
Additional info:
I've seen this question: An existing connection was forcibly closed by the remote host

An existing connection was forcibly closed by the remote host on WCF

We are getting following issue in our Production environment only. rest of environments its working fine.
we checked various links on stackoverflow but nothing worked.
tried increasing `
<httpRuntime maxRequestLength="2147483647" />
increased timeout
put tracing, but even that not showing any specific issue
[SocketException (0x2746): An existing connection was forcibly closed by the remote host]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +245
[IOException: Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host.]
System.Net.Sockets.NetworkStream.Read(Byte[] buffer, Int32 offset, Int32 size) +7867549
System.Net.PooledStream.Read(Byte[] buffer, Int32 offset, Int32 size) +22
System.Net.Connection.SyncRead(HttpWebRequest request, Boolean userRetrievedStream, Boolean probeRead) +408
[WebException: The underlying connection was closed: An unexpected error occurred on a receive.]
System.Net.HttpWebRequest.GetResponse() +7870788
System.ServiceModel.Channels.HttpChannelRequest.WaitForReply(TimeSpan timeout) +99
[CommunicationException: An error occurred while receiving the HTTP response to http://myservice/Service.svc. This could be due to
the service endpoint binding not using the HTTP protocol. This could
also be due to an HTTP request context being aborted by the server
(possibly due to the service shutting down). See server logs for more
details.]
System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4728419
System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725
MyService.ISSO.ProcessRequest(SSORequest request) +0
"Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host."
This error could be generated because of Group Policy Settings. Try connecting to Analysis Service using SQL Management Studio, if error persist try to elevate the user privilages.

Is there any difference in hosting net.tcp wcf services under Windows 7 and Windows 2008 Server in IIS?

I have a situation where I can't host a service using net.tcp under windows 7 but it works fine on windows 2008 server. I have enabled WAS, and made the same settings in both windows 7 and windows server but for some reason it doesn't work in windows 7. The error I get on the client side is:
System.ServiceModel.EndpointNotFoundException: The message could not be dispatched because the service at the endpoint address 'net.tcp://localhost:908/TcpTest/MySuperService.svc' is unavailable for the protocol of the address.
Server stack trace:
at System.ServiceModel.Channels.ConnectionUpgradeHelper.DecodeFramingFault(ClientFramingDecoder decoder, IConnection connection, Uri via, String contentType, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.SendPreamble(IConnection connection, ArraySegment`1 preamble, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.DuplexConnectionPoolHelper.AcceptPooledConnection(IConnection connection, TimeoutHelper& timeoutHelper)
at System.ServiceModel.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout)
at System.ServiceModel.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.ServiceChannel.OnOpen(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
at System.ServiceModel.Channels.CommunicationObject.Open()
And in the event log I got the following error for the service:
An error occurred while trying to listen for the URL '/LM/W3SVC/9/ROOT/TcpTest'. This worker process will be terminated.
Sender Information: net.tcp
Exception: System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler/24230272
Process Name: System.ServiceModel.CommunicationException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: .
at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Register()
at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Open(Boolean isReconnecting)
at System.ServiceModel.Channels.SharedConnectionListener.StartListen(Boolean isReconnecting)
at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpenInternal(Int32 queueId, Guid token)
at System.ServiceModel.Activation.HostedTcpTransportManager.Start(Int32 queueId, Guid token, Action messageReceivedCallback)
at System.ServiceModel.WasHosting.TcpAppDomainProtocolHandler.OnStart()
at System.ServiceModel.WasHosting.BaseAppDomainProtocolHandler.StartListenerChannel(IListenerChannelCallback listenerChannelCallback)
Process ID: w3wp
The web.config is exactly the same for the service on both windows 7 and windows 2008. Any clues?
I was having this same problem, in which the exception message ends in
... NetTcpPortSharing service: .
which gives no clue where to go from there.
It turned out that the Net.Tcp Listener Adapter service was pointing to .NET 3 and the Net.TCP Port Sharing Service was pointing to .NET 4
I was able to quickly fix it by running
c:\Windows\Microsoft.NET\Framework64\v4.0.30319\ServiceModelReg.exe -r
I guess you've already solved it since...
Was it the case with portsharing was not enabled ?
http://msdn.microsoft.com/en-us/library/aa395195.aspx
It seems like it is working. I have a new computer now and tried it again with not problem at all. So it should work just fine to host net.tcp on Win 7 with IIS7.

WCF Session problem

I'm new to WCF and have not much idea. By using a sample code I tried WCF through remoting...
It works fine for few min but if i leave the client without accessing the WCF server I get an exception like this....
Exception:Unable to connect to the remote server.
Inner Exception :
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 122.165.27.38:80
at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
at System.Net.Sockets.Socket.InternalConnect(EndPoint remoteEP)
at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Int32 timeout, Exception& exception)
Stack Trace :
at System.Net.HttpWebRequest.GetRequestStream()
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at TeleMailer.TeleMailer.cbxtmuname_SelectedIndexChanged(Object sender, EventArgs e)
Source :
System
Exception :Server was unable to process request. ---> The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state.
Inner Exception :
Stack Trace :
at System.Web.Services.Protocols.SoapHttpClientProtocol.ReadResponse(SoapClientMessage message, WebResponse response, Stream responseStream, Boolean asyncCall)
at System.Web.Services.Protocols.SoapHttpClientProtocol.Invoke(String methodName, Object[] parameters)
at TeleMailer.Server.Service.get_path()
at TeleMailer.TeleMailer.TeleMailer_Load(Object sender, EventArgs e)
Source :
System.Web.Services
But it's not in faulted state nor it's closed!!!
Actually in my application the client communicates to the server which in turn contacts the WCF and gives him the work to do....
Right now I'm using Cassini as my server. It works great for few min but after nearly ten min it just shows this error message.... but if i restart my Cassini it works properly for few min again and gets the problem....
I cant understand how it goes to faulted state when it's able to connect more clients....
is it because the session has timed out or what? and if session has timed out then from which side from my server or client???
Any Idea plz..........
I've been siting with it for whole day but could not trace out any thing!!!
It may be a timeout problem, related to when you create the wcf proxy object in your client code.
It looks like you create the proxy object when you start the client and then just reuse it. This object maintains a connection to the server, which timesout after 10 min.
A better way to do it would be to create a new proxy object with a using statement, each time you need it.
" if i leave the client without accessing the WCF server I get an exception like "
May be due to inactivityTimeout, so you can increase it, or dispose your client object as soon as possible (try using statement)
you can set the property as follows
<reliableSession ordered="true" inactivityTimeout="00:00:05"
enabled="false" />