44578

Azure Cloud Service Web Role web pages do not load

This is most likely going to be a very long post to try to fully explain how my Azure Cloud Service is deployed and what I have already tried to tackle this issue, so apologies and thanks in advance.

Framwork: 4.5.1 Azure SDK: 2.5 Visual Studio: 2013 Update 4

<strong>The Problem:</strong>

Upon publishing my Azure Cloud Service when I try to load a web page the browser will load continuously, never displaying the page or any error (no web error code or .Net error). This is the same behaviour whether I try to load the website after remoting onto the VM in Azure itself, from the external IP or from -cloudservicename-.cloudapp.net. This is the case for both release and debug configurations when deployed to Azure.

However the application works and runs absolutely fine in both Debug and Release modes when running locally on the Azure Emulator. There are no differences between my cloud and local .cscfg files, barring a NetworkConfiguration section for VPN config.

The Cloud Service deploys from Visual Studio without error and I can RDP onto the VMs and open IIS etc no problem, with the configuration of the website and certificates looking fine.

<strong>My Application</strong>

My Azure Cloud Service is made up of two roles, a Web Role that hosts the website and a Worker role that runs various background jobs.

This project has been going for a while and I have published several iterations to Azure in the past from different machines. This is my first time publishing from a new Windows 8.1 laptop, although this shouldn't make a difference. The configuration has changed very little since the previous release (one connection string added to the role). The only major thing that has changed is that I upgraded to VS2013 update 4 (from update 3) and Azure SDK 2.5 (from 2.4).

I can post the configuration files if required, however everything seems to be OK with them given the deployment does work.

<strong>Investigation:</strong>

I have taken numerous steps to try to investigate and solve the problem.

RDPing onto the server reveals no immidiate issues, there are no IIS entries in the event log and my own logging doesn't seem to have anything useful in it (more on this later).

I have also enabled Azure Diagnostics but looking at the returned logs nothing jumps out at me as being a log of the issue at hand.

The next thing I tried is attaching the remote debugger to the Azure VM, this works and I can debug the project. I placed breakpoints on all of the methods I handle in Global.asax.vb, including:

Application_BeginRequest Application_AuthenticateRequest Application_Error

Upon requesting a page Application_BeginRequest is hit immidiately, followed by Application_AuthenticateRequest, as expected. however following the code through Application_AuthenticateRequest leads to some strange behaviour.

In this code I validate a FormsAuthenticationCookie, which if found to be something would set HttpContext.Current.User and Thread.CurrentPrincipal. IN this case the cookie is nothing as the user has not logged in, meaning the Application_AuthenticateRequest method finishes. At this point I can continue to step through the .Net framework code and can see the successful completion of HttpApplication.ExecuteStep.

At this point I would expect either the master_Page_PreLoad method or one of the other pre-load events in the MasterPage or my custom implementation of Page to execute, however none of them are hit.

After leaving the process in debug for a number of minutes eventually Application_Error is hit, meaning my logging writes the exception that apparently caused the error. This rarely happens but when it does I have seen two different errors come out:

<hr>

First Error in my logging:

ErrorCode:SubStatus:There is a temporary failure. Please retry later. (One or more specified cache servers are unavailable, which could be caused by busy network or servers. For on-premises cache clusters, also verify the following conditions. Ensure that security permission has been granted for this client account, and check that the AppFabric Caching Service is allowed through the firewall on all cache hosts. Also the MaxBufferSize on the server must be greater than or equal to the serialized object size sent from the client.). Additional Information : The client was trying to communicate with the server: net.tcp://rolename.here:24233.. GUID: 9f85d178-968f-4908-bec4-d1a5f57bb819

at Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus errStatus, Guid trackingId, Exception responseException, Byte[][] payload, EndpointID destination) at Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable'1 servers, RequestBody request, Func'3 sendMessageDelegate, DataCacheReadyRetryPolicy retryPolicy) at Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable'1 servers) at Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(String cacheName, CreateNewCacheDelegate cacheCreationDelegate, DataCacheInitializationViaCopyDelegate initializeDelegate) at Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs fetchingEventArgs, IDataCacheFactory dataCacheFactory, Object sender, EventHandler'1 fetchingHandler, EventHandler'1 fetchedHandler) at Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.CreateInternalProvider(IHttpRuntime httpRuntime, OutputCacheInitializationData initData, IDataCacheFactory dataCacheFactory, EventHandler'1 cacheFetching, EventHandler'1 cacheFetched) at Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.GetInternalProvider() at Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.Get(String key) at System.Web.Caching.OutputCache.Get(String key) at System.Web.Caching.OutputCacheModule.OnEnter(Object source, EventArgs eventArgs) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

Having investigated this error on line I found a Microsoft source (sorry I no longer have the link) saying basically "It is supposed to happen sometimes, don't worry about it" however this doesn't feel right. I have not seen this error before in my development work but one of the other developers working ont he project has experienced it in debug recently. Has anybody experienced this or knows for certain we dont have to worry about it?

In an attempt to rule this out I deployed the service with caching turned off on the web role but this made no difference.

Here is my cache configuration in web.config.

<!--To use the in-role flavor of Windows Azure Cache, set identifier to be the cache cluster role name --> <!--To use the Windows Azure Cache Service, set identifier to be the endpoint of the cache cluster --> <autoDiscover isEnabled="true" identifier="rolename.here" /> <!--<localCache isEnabled="true" sync="TimeoutBased" objectCount="100000" ttlValue="300" />--> <!--Use this section to specify security settings for connecting to your cache. This section is not required if your cache is hosted on a role that is a part of your cloud service. --> <!--<securityProperties mode="Message" sslEnabled="true"> <messageSecurity authorizationInfo="[Authentication Key]" /> </securityProperties>--> </dataCacheClient>

<hr>

The second error that gets recorded in my logging is:

System.Web.HttpException (0x80004005): Server cannot append header after HTTP headers have been sent. at System.Web.HttpResponse.AppendHeader(String name, String value) at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

This feels like a side effect rather than the cause of the issue but any comments are welcome.

<hr>

<strong>Other things I have tried:</strong>

    <li>Created an configured a new Cloud Service in Azure - same result.</li> <li>Added a new Azure Cloud Service Project to the solution and configured it from scratch - same result.</li> </ul>

    At this point I am totally lost as to what to do, I cant understand why it works perfectly in debug but not when deployed, and why there is no log shedding more light on the issue - at the moment I am not even sure what to search for to find people who have had a similar problem.

    The final question all this boils down to is why are my pages not loading?

    I'm going to boot my old Windows 7 box back up to deploy from there and see if there is any difference.

    Please don't hesitate to ask if you need any more information.

    Thanks for reading this and for any help you can give.

    Answer1:

    Please ensure that the version of caching library matches with the SDK version. You will get this error if there is a version mismatch.

Recommend

  • MVC3 generic handler (.ashx) for Images resizing (Need clean URL)
  • Routing ASP.NET MVC URL to url with querystring
  • What is the disadvantage of manually registering Log4Net Logger instance to ILog in Autofac?
  • IoC Register Instance Issue with MVC3, Unity & NHibernate - (Unity.MVC3 lib from codeplex)
  • Url.Action(action,controller,routeValues) doubling up ID in URL
  • Job Scheduler inside of MVC3 Website
  • ASP.NET MVC Routing strategy for static content for each View
  • How to redirect to home page after session timeout
  • Web API Basic Auth inside an MVC app with Identity Auth
  • IsAuthenticated is false! weird behaviour + review question
  • Why cygnus crashes when using ngsiv2 in orion?
  • WPF Listbox commands
  • Sum values in array of hash if they have the same value
  • Why is OpenID Connect considered mobile friendly compared to SAML
  • JavaScript overloading with a callback
  • Implementing Oracle.Web.dll, Oracle.DataAccess.dll 64-bit failed on Windows Server 2008 with IIS 7.5
  • Excel 2007: Format of email address from Outlook 2007
  • Access Google Maps from outside
  • QueryString id parameter not being used
  • dismiss Progress Dialog in another Activity … Android
  • How to override __call__ in celery on main?
  • Get the last date of each month in a list of dates in Python
  • Access the state of control in Winforms from another application
  • Opening two instances of InAppBrowser (_system and _blank) prevents events from triggering
  • Android - Calling Java from Webview
  • How to display a tooltip according to mouse position? - JavaFX
  • Streaming screenshots over WebRTC as a video stream from iOS
  • Android onKey w/ virtual keyboard
  • HttpServletRequest getLocale returns OS locale not browser locale
  • LESS CSS how to modify parent property in mixin
  • How to access meteor package name inside package?
  • Updating Dojo provide
  • Defined variables not working in javascript files when I use getScript
  • How can I display the parent menu item's description using Wordpress walkers?
  • Graphics.CopyFromScreen [Web application] + The handle is invalid
  • x64 applications using gdi+: what are the consequences on performance?
  • Django rest serializer Breaks when data exists
  • How to rebase a series of branches?
  • Azure Cloud Service Web Role web pages do not load
  • what is the difference between the asp.net mvc application and asp.net web application