问题描述
这是最有可能会是一个很长的帖子,试图充分解释我的Azure云服务是如何部署的,什么我已经尝试解决这一问题,所以道歉和感谢提前。
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更新4
Framwork: 4.5.1
Azure SDK: 2.5
Visual Studio: 2013 Update 4
问题:
当我发布的Azure云服务时,我尝试加载一个网页浏览器会不断加载,从不显示页面或任何错误(没有网络错误code或.Net错误)。这是相同的行为是否我尝试远程处理到上述VM天青本身,从外部IP或从-cloudservicename-.cloudapp.net后到网站加载。当部署到Azure的这是发布和调试配置的情况。
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.
但应用程序的工作,并运行在这两个调试绝对精品和在Azure模拟器在本地运行时释放模式。还有我的云和当地.cscfg文件之间没有差异,不包括对VPN配置一个NetworkConfiguration部分。
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.
云服务从Visual Studio部署没有错误,我可以RDP到虚拟机,并打开IIS等没有问题,与网站的配置和证书看起来很不错。
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.
我的应用
我的Azure云服务是由两个角色,即承载运行各种后台作业本网站的辅助角色Web角色的。
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.
该项目已经持续了一段时间,我从不同的机器上发表了几篇迭代Azure在过去。这是我第一次从一个新的Windows 8.1发布的笔记本电脑,虽然这不应该有所作为。自previous发布(一个连接字符串添加到角色)的配置变化不大。已更改的唯一的主要的事情是,我升级到VS2013更新4(从更新3)和Azure的SDK 2.5(2.4)。
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.
调查:
我已经采取了许多措施,试图调查和解决问题。
I have taken numerous steps to try to investigate and solve the problem.
RDPing到服务器上显示没有immidiate问题,也有在事件日志中没有IIS条目和我自己的日志似乎并不具备(关于这个版本以上)在它有用的东西。
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).
我也启用了Azure诊断但看着返回日志没有我,就在眼前是一个日志问题跳出来。
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.
我试过被安装远程调试器到Azure的VM接下来的事情,这个工作我可以调试项目。我把所有的我在Global.asax.vb处理方法的断点,其中包括:
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
当请求一个页面的Application_BeginRequest
是immidiately命中,随后 Application_AuthenticateRequest
,符合市场预期。然而,通过如下 Application_AuthenticateRequest
的code会导致一些奇怪的行为。
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.
在此code我验证 FormsAuthenticationCookie
,而如果发现有什么东西会设置 HttpContext.Current.User
和 Thread.CurrentPrincipal中
。在这种情况下,cookie是毫无作为用户没有登录,这意味着 Application_AuthenticateRequest
方法完成。在这一点上,我可以继续步骤通过.NET Framework code和可以看到的圆满完成 HttpApplication.ExecuteStep
。
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
.
在这一点上我希望无论是 master_Page_ preLOAD
法或母版其他pre-负荷事件之一或我的自定义实现页
来执行,但是他们没有被击中。
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.
在离开过程中调试的分钟数最终的Application_Error
被击中,这意味着我的记录后写道,显然引起错误的例外。这种情况很少发生,但是当它确实我看到两个不同的错误出来:
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:
在我的日志记录第一个错误:
First Error in my logging:
错误code:子状态:有一个临时故障。
请稍后再试。 (一个或多个指定的缓存服务器是
不可用,这可能是由网络繁忙或服务器引起。对于
导通premises缓存集群,也验证了以下条件。
确保安全权限已被授予此客户端
帐户,并检查AppFabric缓存服务是允许的
通过在所有缓存主机防火墙。另外,MAXBUFFERSIZE上
服务器必须大于或等于所述序列化的对象的大小
从客户端发送。)。客户端试图:附加信息
的net.tcp:与服务器进行通信// rolename.here 的:24233 ..
GUID:9f85d178-968f-4908-bec4-d1a5f57bb819
在
Microsoft.ApplicationServer.Caching.DataCache.ThrowException(ErrStatus
errStatus中GUID trackingId,异常responseException,字节[] []
有效载荷的EndpointId目的地)在
Microsoft.ApplicationServer.Caching.DataCacheFactory.EstablishConnection(IEnumerable'1
服务器,RequestBody要求,Func'3 sendMessageDelegate,
DataCacheReadyRetryPolicy retryPolicy)在
Microsoft.ApplicationServer.Caching.SocketClientProtocol.Initialize(IEnumerable'1
服务器)在
Microsoft.ApplicationServer.Caching.DataCacheFactory.GetCache(字符串
cacheName,CreateNewCacheDelegate cacheCreationDelegate,
DataCacheInitializationViaCopyDelegate initializeDelegate)在
Microsoft.Web.DistributedCache.CacheHelpers.RunCacheCreationHooks(CacheConnectingEventArgs
fetchingEventArgs,IDataCacheFactory dataCacheFactory,对象发件人,
EventHandler'1 fetchingHandler,EventHandler'1 fetchedHandler)在
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.CreateInternalProvider(IHttpRuntime
的httpRuntime,OutputCacheInitializationData initData,IDataCacheFactory
dataCacheFactory,EventHandler'1 cacheFetching,EventHandler'1
cacheFetched)在
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.GetInternalProvider()
在
Microsoft.Web.DistributedCache.DistributedCacheOutputCacheProvider.Get(字符串
键)在System.Web.Caching.OutputCache.Get(字符串键)在
System.Web.Caching.OutputCacheModule.OnEnter(对象源,EventArgs的
EventArgs的)在
System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在System.Web.HttpApplication.ExecuteStep(IExecutionStep一步,
布尔和放大器; completedSynchronously)
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)
经调查这个错误就行,我发现一个微软源(对不起,我不再有链接)说基本上是它应该有时会发生的,不用担心它然而,这感觉不对。我没有在我的开发工作,但工作ONT他项目在调试经历过最近的其他开发商之一见过这个错误。有没有人经历过这种或确切地知道,我们不担心呢?
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.
下面是在web.config中我的缓存配置。
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>
这将记录在我的记录第二个错误是:
The second error that gets recorded in my logging is:
System.Web.HttpException(0X80004005):服务器不能追加头
后HTTP标头已发送。在
System.Web.Htt presponse.AppendHeader(字符串名称,字符串值)
System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
在System.Web.HttpApplication.ExecuteStep(IExecutionStep一步,
布尔和放大器; completedSynchronously)
这感觉就像一个副作用,而不是问题的原因,但任何意见都欢迎。
This feels like a side effect rather than the cause of the issue but any comments are welcome.
其他的东西我曾尝试:
- 创建一个配置一个新的云服务Azure的中 - 同样的结果
- 增加了一个新的Azure云服务项目的解决方案,并从头开始配置它 - 同样的结果 。
在这一点上,我完全失去了,以什么做的,我无法理解为什么它完美的作品在调试,但没有部署的时候,为什么没有记录在这个问题上脱落的越光 - 此刻我甚至不一定要什么搜索找到谁都有过类似的问题的人。
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?
我要启动我的旧的Windows 7盒备份到从那里部署并看看是否有任何区别。
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.
推荐答案
请确保缓存库的版本与SDK版本相匹配。如果有一个版本不匹配,您将收到此错误。
Please ensure that the version of caching library matches with the SDK version. You will get this error if there is a version mismatch.
这篇关于Azure云服务Web角色的网页不加载的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!