500 AppHarbor上出现错误,但下载的构建在我的机器上有效



我在Windows 8上使用Visual Studio 2013。我有一个基于ServiceStack构建的web服务。在我的机器上一切都很好,但当把它部署到AppHarbor时,我得到了一个500的错误。我设置了customErrors mode="off",但仍然得到一个没有堆栈跟踪的500错误。

根据AppHarbor的常见问题解答:

如果启用"自定义错误"不会产生堆栈争用,则表明存在阻止ASP.NET运行时初始化的配置问题。您可以通过将应用程序(本地生成或从AppHarbor下载的生成输出)部署到本地计算机上运行的完整IIS来调试此类问题。必须将应用程序池配置为在集成管道模式下运行,才能正确复制AppHarbor的环境。

所以我这么做了。我从AppHarbor下载了构建输出,并在本地IIS上运行,它运行得很好!

AppHarbor错误页面显示

没有可显示的错误。

AppHarbor的日志会话功能没有显示任何有意义的信息:

2013-12-31T09:55:20.886+00:0-appharbor-web.1创建了新的worker(版本1388526921)2013-12-31T09:55:24.864+000:00 appharbor web.1预热(版本1388526921)2013-12-31T09:55:32.134+00:00-appharbor-web.1 web工作程序根URL返回HTTP状态代码500(内部服务器错误)(版本1388526921)

有什么建议吗?

--作为参考,这里是我的web.config的概要:

<?xml version="1.0" encoding="utf-8"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth">
<section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth" requirePermission="false" allowLocation="true" />
<section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth" requirePermission="false" allowLocation="true" />
<section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth" requirePermission="false" allowLocation="true" />
<section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth" requirePermission="false" allowLocation="true" />
</sectionGroup>
</configSections>
<appSettings>
....
</appSettings>
<connectionStrings>
....
</connectionStrings>
<system.web>
<customErrors mode="Off">
</customErrors>
<httpHandlers>
<add path="*" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" />
</httpHandlers>
<compilation debug="true" />
</system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false" />
<handlers>
<add path="*" name="ServiceStack.Factory" type="ServiceStack.WebHost.Endpoints.ServiceStackHttpHandlerFactory, ServiceStack" verb="*" preCondition="integratedMode" resourceType="Unspecified" allowPathInfo="true" />
</handlers>
<directoryBrowse enabled="true" />
</system.webServer>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="MongoDB.Driver" publicKeyToken="f686731cfb9cc103" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.2.34" newVersion="1.8.2.34" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="MongoDB.Bson" publicKeyToken="f686731cfb9cc103" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-1.8.2.34" newVersion="1.8.2.34" />
</dependentAssembly>
</assemblyBinding>
<!-- This prevents the Windows Event Log from frequently logging that HMAC1 is being used (when the other party needs it). -->
<legacyHMACWarning enabled="0" />
</runtime>
<uri>
<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
which is necessary for OpenID urls with unicode characters in the domain/host name. 
It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
<idn enabled="All" />
<iriParsing enabled="true" />
</uri>
<system.net>
<defaultProxy enabled="true" />
<settings>
</settings>
</system.net>
<dotNetOpenAuth>
<!-- This is an optional configuration section where aspects of dotnetopenauth can be customized. -->
<!-- For a complete set of configuration options see http://www.dotnetopenauth.net/developers/code-snippets/configuration-options/ -->
<openid>
<relyingParty>
<security requireSsl="false">
</security>
<behaviors>
<!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
with OPs that use Attribute Exchange (in various formats). -->
<add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" />
</behaviors>
</relyingParty>
</openid>
<messaging>
<untrustedWebRequest>
<whitelistHosts>
</whitelistHosts>
</untrustedWebRequest>
</messaging>
<!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
<reporting enabled="true" />
</dotNetOpenAuth>
</configuration>

只是一个粗略的猜测:(没有太多内容)但我也遇到过类似的问题,例如,当我在本地机器上使用IIS重写模块时(它运行得很好),但当我上传到没有安装该附加模块的主机时,我会得到一个500错误,几乎没有什么内容-听起来很相似。它让我疯狂地试图找到它。

因此,请确保您可能拥有并在IIS中本地使用的任何选项/插件也安装在主机上。

同样,确保您了解web.config中引用/使用的所有内容——这可能是问题所在。

最新更新