简体   繁体   中英

Microsoft.ServiceBus.InvalidRequestException: The connection was failed. Cache refresh timed out

Microsoft.ServiceBus.InvalidRequestException: The connection was failed. Cache refresh timed out. Server stack trace: at Microsoft.ServiceBus.RelayedSocketInitiator.Connect(Uri uri, TimeSpan timeout) at Microsoft.ServiceBus.ConnectivityModeConnectionInitiator.Connect(Uri uri, TimeSpan timeout) at Microsoft.ServiceBus.Channels.BufferedConnectionInitiator.Connect(Uri uri, TimeSpan timeout) at Microsoft.ServiceBus.Channels.ConnectionPoolHelper.EstablishConnection(TimeSpan timeout) at Microsoft.ServiceBus.Channels.ClientFramingDuplexSessionChannel.OnOpen(TimeSpan timeout) at System.ServiceModel.Channels.CommunicationObject.Open(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) Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at Syst em.ServiceModel.ICommunicationObject.Open()

when opening a connection with a NetTcpRelayBinding

try
{
   NetTcpRelayBinding netTcpRelay = new NetTcpRelayBinding();
   if (ApplicationServer.Common.Utilities.ServicesConfigurationManager.ClientMaxConnections > 0)
   {
     netTcpRelay.MaxConnections = ApplicationServer.Common.Utilities.ServicesConfigurationManager.ClientMaxConnections;
    }
    netTcpRelay.MaxReceivedMessageSize = ApplicationServer.Common.Utilities.ServicesConfigurationManager.ClientMaxReceivedMessageSize;
    if (ApplicationServer.Common.Utilities.ServicesConfigurationManager.ClientSendTimeout > 0)
    {
     netTcpRelay.SendTimeout = new TimeSpan(0, 0, ApplicationServer.Common.Utilities.ServicesConfigurationManager.ClientSendTimeout);
     }

   if (ApplicationServer.Common.Utilities.ServicesConfigurationManager.ClientReceiveTimeout > 0)
    {
      netTcpRelay.ReceiveTimeout = new TimeSpan(0, 0, ApplicationServer.Common.Utilities.ServicesConfigurationManager.ClientReceiveTimeout);
      }

    channelFactory = new ChannelFactory<TServiceChannel>(
                               netTcpRelay,
                               new EndpointAddress(serviceBusUri));

                    // Set the signature token
                    policyName = ...
                    accessKey = ...
                    channelFactory.Endpoint.Behaviors.Add(new TransportClientEndpointBehavior { TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider(policyName, accessKey) });
                }
                catch (Exception exc)
                {
                    throw new ServiceBusRelayException("\nServiceBusRelayProxyHelper.Initialize (sb://): An error ocurred with ServiceBusUri='" + serviceBusUri + "' - PolicyName='"+ policyName +"'.\nException Message: " + exc.Message, exc);
                }

I had this exact same issue starting today. It's not a problem with your code, I had to work with MSFT support to get the issue resolved. They had to move my service bus namespace to a different node, which then solved the issue. I would suggest opening a support ticket with Azure support.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM