error connecting to rabbitmq using easynetq driver - c#

I was connecting to RabbitMQ with easynetQ driver without any issues when all of a sudden. I started getting this error
System.ArgumentException occurred
Message: Exception thrown: 'System.ArgumentException' in System.dll
Additional information: None of the discovered or specified addresses match the socket address family.
Why am i not able to find the rabbit mq server all of a sudden. What would be the root cause of this issue. No network configuration has changed.

Turns out I had the Break on exception setting turned on leading me to believe that the exception was coming through my code. The driver connects to the rabbitmq after the error is thrown.

Related

MongoDB C# unable to connect to database: Unable to create an authenticator

While setting up my new environment with a freshly deployed MongoDB container with authentication enabled, I ran into this exception: "An unhandled exception has occurred while executing the request. MongoDB.Driver.MongoConnectionException: An exception occurred while opening a connection to the server. ---> System.NotSupportedException: Unable to create an authenticator."
In my case I'm using a connection string like this example: mongodb://USER:PASSWORD#HOST:27017/?authMechanism=DEFAULT. This string works perfectly fine in MongoDB Compass but not inside my .NET 6.0 application.
If you take a look at the source code of C# MongoDB driver in MongoCredential.cs#L469, you see this exception gets thrown while checking the auth mechanism.
After specifying the exact auth mechanism in the connection string, all exceptions are gone!
example: mongodb://USER:PASSWORD#HOST:27017/?authMechanism=SCRAM-SHA-256
Hope anyone else googeling around will find my answer helpful!
happy coding.
For me this just changed the exception to unable to authenticate using sasl protocol mechanism scram-sha-256
After some trial and error I got it working by changing the connection string to:
mongodb://USER:PASSWORD#HOST:27017/?authSource=admin
I have no idea why this was needed as the default and SCRAM-SHA-256 connectionstrings works fine in other contexts...
Remove the authMechanism=DEFAULT parameter from the connection string

Botframework Web Application Azure IDX20803: Unable to obtain configuration from: '[PII is hidden]

We have a issues with our bot
It was working fine during the last 4 months without any errors.
But today we receive the relevant error :
2018-12-17T17:50:25 PID[5736] Error
Error refreshing OpenId configuration: System.InvalidOperationException:
IDX20803: Unable to obtain configuration from: '[PII is hidden]'.
---> System.IO.IOException: IDX20804: Unable to retrieve document from: '[PII is hidden]'.
---> System.Net.Http.HttpRequestException: An error occurred while sending the request.
---> 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
The complete log file was shown at this link : https://pastebin.com/ZLx9G9W7
I think it's a exception due too IIS configuration but we have not changed anything on that.
Thanks you in advance.
Okay I have had a phone call with an engineer from Microsoft. They told me BotFramework doesn't support TLS 1.0 anymore and we have to migrate to version 1.2. They have anounced this in a blog post: https://blog.botframework.com/2018/11/06/announcement-azure-bot-service-enforcing-transport-layer-security-tls-1-2/
My bot was fixed by adding this line in the startup code (in my case it was Application_Start in Global.asax.cs):
System.Net.ServicePointManager.SecurityProtocol = System.Net.SecurityProtocolType.Tls12;
I know this post is quite old, but I just ran into this exact error message yesterday with an Azure App Service (Bot Framework v4.15):
Exception: System.InvalidOperationException: IDX20803: Unable to obtain configuration from: 'https://login.botframework.com/v1/.well-known/openidconfiguration'.
The issue was that the App Service had lost the ability to resolve DNS. This was confirmed by opening the Kudu Debug Console and running:
nameresolver.exe login.botframework.com (and any other hostname)
Unfortunately, this was a temporary outage of some sort on Microsoft's end (currently being investigated with MS support). I had to deploy a separate plan and App Service in order to restore service. Frustratingly, the broken App Service started magically working again the next morning.

RabbitMQ error: .Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable

I am starting RabbitMQ Tutorial,
https://www.rabbitmq.com/tutorials/tutorial-one-dotnet.html
For some reason, I am receiving error below. Anyone receive this error when starting Rabbit mq, and any solutions? Just started programming few months ago. How would I resolve this?
Unhandled Exception: RabbitMQ.Client.Exceptions.BrokerUnreachableException: None of the specified endpoints were reachable ---> System.AggregateException: One or more errors occurred. (Connection failed) ---> RabbitMQ.Client.Exceptions.ConnectFailureException: Connection failed ---> System.Net.Internals.SocketExceptionFactory+ExtendedSocketException: No connection could be made because the target machine actively refused it (IP address)
This is on my local desktop pc.

What would cause AmqpException in azure wcf relay?

I am logging the connection status events with the wcf relay, and I'm seeing something like this in the logs.
1/26 06:47:12 ERROR Service Bus ConnectionStatus: 'Reconnecting' Event. [(null)][42]
LastError: System.ServiceModel.CommunicationException: Exception of type 'System.ServiceModel.CommunicationException' was thrown. ---> Microsoft.ServiceBus.Messaging.Amqp.AmqpException: An AMQP error occurred (condition='amqp:unauthorized-access').
--- End of inner exception stack trace ---
This exception doesn't show up in the list on this microsoft page, and the only other post I can find anywhere related to this error message is here. However, that post does not have any recent comments or a resolution or workaround for the issue. Also, the exception doesn't have any stacktrace, so how am I supposed to troubleshoot this error?
I guess as a follow-up, I would ask whether this is anything to actually worry about if the wcf connection is never faulting.
Apparently, the token that the relay keeps refreshing to stay active requires the time on the server to match the azure service that it is connecting with, and if not, this type of error will show up. We were able to fix it by correcting the server time.

NServiceBus exception and subscriber not able to read queue

I've been battling with this for a few days now with no luck. I've setup a NServiceBus project by following the guidelines on the getting started guide.
My MVC site successfully pushed messages onto my queue, but the subscriber never reads them off. No error messages until after about a minute, where the following pops up on the console:
2012-06-26 13:05:43,648 [1] FATAL NServiceBus.Hosting.GenericHost [(null)] <(null)> - Autofac.Core.DependencyResolutionException: An exception was thrown while invoking the constructor 'Void .ctor(Raven.Client.IDocumentStore)' on type 'RavenTimeoutPersistence'. ---> System.Net.WebException: The operation has timed out at System.Net.HttpWebRequest.GetResponse()
at Raven.Client.Connection.HttpJsonRequest.ReadStringInternal(Func`1 getRespo
nse)
at Raven.Client.Connection.HttpJsonRequest.ReadResponseString()
at Raven.Client.Connection.HttpJsonRequest.ReadResponseJson()
I can successfully connect to Raven via the web portal, and I can see my queues listed there - so am at a loss as to why NServiceBus cannot read the messages on the queue. I've reinstalled MSMQ, rebooted machine, re-installed NServiceBus - nothing seems to work.
Does anyone have any idea as to whats going wrong here?
This turned out to be another victim of Kaspersky Anti Virus. Even though firewall was set to "Allow all network connections", turning it off solved the issue.

Categories