Azure Deployment - Server Error Caching

Topics: Installing Orchard
Jun 18, 2014 at 8:14 PM

I deployed Orchard 1.8 to Azure Cloud Service. The CMS works correctly on the local Debugger, but after deploying it to Azure, I get a rundime exception.

Orachard: 1.8
Azure SDK: 2.3

[SocketException (0x2af9): No such host is known]
System.Net.Dns.HostResolutionEndHelper(IAsyncResult asyncResult) +2969577
System.Net.Sockets.Socket.DoDnsCallback(IAsyncResult result, MultipleAddressConnectAsyncResult context) +141
System.Net.Sockets.Socket.BeginConnect(String host, Int32 port, AsyncCallback requestCallback, Object state) +344
Microsoft.ApplicationServer.Caching.SocketConnectionFactory.BeginConnect(String host, Int32 port, AsyncCallback callback, Object state, TimeSpan timeout) +710
Microsoft.ApplicationServer.Caching.TcpClientChannelFactory.BeginConnect(String host, Int32 port, AsyncCallback callback, Object state) +160
Microsoft.ApplicationServer.Caching.TcpClientChannel.ConnectAsync() +431
Microsoft.ApplicationServer.Caching.SocketClientChannel.TryGetTcpChannelUntilTimeout(TcpClientChannel clientChannel, ITcpChannel& chnl) +54
Microsoft.ApplicationServer.Caching.SocketClientChannel.Send(EndpointID endpoint, IVelocityRequestPacket packet) +319
Microsoft.ApplicationServer.Caching.SocketClientChannel.Send(EndpointID endpoint, ICreateMessage message) +139
Microsoft.ApplicationServer.Caching.SimpleSendReceiveModule.Send(EndpointID endpoint, RequestBody request, Int32 retries) +95
Microsoft.ApplicationServer.Caching.SimpleSendReceiveModule.SendMsgAndWait(EndpointID endpt, RequestBody reqMsg, TimeSpan requestTimeout, IRequestTracker& tracker) +667
Microsoft.ApplicationServer.Caching.SocketClientProtocol.SendMessage(EndpointID endPt, RequestBody request) +72
Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable1 servers, RequestBody request, Func3 sendMessageDelegate, DataCacheReadyRetryPolicy retryPolicy) +413
Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable1 servers) +563
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName, CreateNewCacheDelegate cacheCreationDelegate, DataCacheInitializationViaCopyDelegate initializeDelegate) +679
Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler
1 fetchingHandler, EventHandler1 fetchedHandler) +95
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateInternalProvider(IHttpRuntime httpRuntime, SessionInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler
1 cacheFetching, EventHandler`1 cacheFetched) +145
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.GetInternalProvider() +224
Microsoft.Web.DistributedCache.DistributedCacheSessionStateStoreProvider.CreateNewStoreData(HttpContext context, Int32 timeout) +19
System.Web.SessionState.SessionStateModule.InitStateStoreItem(Boolean addToContext) +160
System.Web.SessionState.SessionStateModule.CompleteAcquireState() +363
System.Web.SessionState.SessionStateModule.BeginAcquireState(Object source, EventArgs e, AsyncCallback cb, Object extraData) +1269
System.Web.AsyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +12319038
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +288

What could be wrong? I already got it deployed and running on azure but since 2 days it is just crashing with the above error. Any help is appreciated.

Thank you!
Jun 18, 2014 at 9:43 PM
First, it's weird that it's working in the debugger if you are using the Azure solution. But your issue seems to be that your Azure Cache settings are wrong.
Jun 19, 2014 at 6:03 AM
Thank you for your answer. This is really weird. It worked also on an azure web role instance, but now it keeps failing. The local azure emulator also works correctly. If the configuration is incorrect, than the Emulator should also fail, right?

I found some posts regarding this error message which were based on wrong SDK versions. Do you have any idea where I could search for the error? Can I simply Switch of the caching to get the website running again?
Jun 19, 2014 at 4:14 PM
Can you confirm you are building an Azure Cloud Service package from command line and not using Azure Websites ?
Jun 19, 2014 at 7:43 PM
Yes, I can confirm that wir are using Azure Cloud Services. The package is not build from command line since the new Version of Orchard supports the direct Publishing from visual Studio.

We changed the Orchard.Azure.Web to copy the artefacts from Themes and Modules in debug mode that we are able to debug the application in the Azure emulator. The web site runs ok in local Azure Emulator. But when it is deployed to the web role on azure, it immediately fails with the above error. The really weird thing is that a running deployment has stopped working. It is not that a new version does not work. If I redeploy the package, it is still the same Situation.

I need a quick solution, because it is a productive web site which is not working anymore. Is it easy to just disable the caching? Bad Performance would still be better then being offline. ;-)
Jun 19, 2014 at 8:17 PM
You can disable the module by renaming the module.txt to _module.txt

You could also try to get the latest version of the module, or even upgrade to 1.8.1 which contains some fixes regarding this feature.
Jun 19, 2014 at 8:18 PM
Why not try on Azure Web Sites?
Jun 20, 2014 at 6:19 AM
Which module should I disable? Disabling the caching module does not have any effect on the error. I think the error is related to the main config since the Azure Cache is configured in the web.config file. Is the solution fault tolerant, is it possible to comment out all azure caching settings?

Sorry for bothering you again. We need to bring this website online again and the analysis of the error is quiet hard since the behavior on azure web role is completely different than in local emulator. When we debug in local Emulator, we use the same persistency components as in production, so we are connected to the same azure SQL Server as well as the same blob storage as in production. No error at all.
Jun 20, 2014 at 7:08 AM
In the meanwhile I got the solution working with disabling all the data cache features in the web config file (Orchard.Azure.Web). I'm really busy right now so I could not spend time to analyse the problem in detail.

I'll try to check if the azure cache libraries could have caused this issue. I found multiple Posts about this error in combination with the wrong version of the libs and Azure SDK. If there are compatibility issues, an update on the web role could have caused this error. I need some time to analyze this. If you have any idea or new Information, please Keep me informed. I'd like to switch on the caching features as soon as possible.
Jun 20, 2014 at 6:19 PM
It seems lots of users are reporting issues relateed to Azure Cache and Database cache module. My recommendation right now is to disable the Database cache module or not use Azure Cache to store it. Azure Cache is still fine for Output cache.
Jul 2, 2014 at 3:25 PM
@MarcMueller, the problem is you upgrade your Azure Solution to Azure SDK 2.3.
And you did not update the libraries to use Azure SDK 2.3.

I got the same error you did "No such host is known" when my configurations were otherwise correct.
Jul 2, 2014 at 3:31 PM
I was trying to address this issue last week.

I extracted the retry logic that Sebastien added to AzureOutputCacheStorageProvider, I generalized it, and added it to all the calls to Azure Cache.
I accidentally forgot to include the logic that Sebastien uses between retries in the AzureOutputCacheStorageProvider and tried everything out.
I'm using Output Cache, Database Caching, and Shared Session State on an Azure Cache instance and it's all working fine.

I realized that i forgot to include Sebastien's logic, I added it, and I cannot get the systems to start with that change.

Can someone try out my changeset and verify for me that things work with it?

The first changeset is what you need to make it work. Adding the second changeset makes it not work for me.
But I wouldn't mind the confirmations from others.
Dec 15, 2014 at 9:25 AM
Hi guys,

I'm experiencing the same issue. I've read carefully the blog but still could not find a solution at this point.

I've downloaded the Orchard source 1.8.1 a few weeks ago and deployed to a simple cloud service (1 web role).

I get the same issue as Mark Mueller = "no such host is known"

The only way to avoid the error is to comment out the <dataCacheClients> section from the web config.

Even though the latest orchard sources references Azure SDK 2.2 (in the lib directoryà , I had to upgrade my solution to SDK 2.5, as the SDK 2.2 is not available anymore on Microsoft Update Web Platform.

So I'm stuck with the "disabling the cache" work around...

To my understanding the default orchard caching configuration is 30 % co-located on each web role, if I disable the caching section from my web config, how will this influence the output caching behaviour of my application ?

Is there any new information since july on that issue ?

Dec 22, 2014 at 12:49 PM
I finally could resolve the issue by myself.

Here is what I had to do :
  • Uninstall the Azure SDK 2.5 from my machine
  • Download the Azure SDK 2.2 (not available anymore on the Microsoft update Platform but only on the Microsoft website).
  • Reinstalll the SDK 2.2
  • Start from a fresh download of Orchard 1.8.1
  • This time your are not asked to upgrade your solution as you possess the SDK 2.2 wich is referenced in the lib.
  • Deploy to Azure.
  • Reinstall SDK 2.5 if you want to.
Hope this may help some others.