I'm using Visual Studio 2013 on Windows 8. I have a web service built off ServiceStack. Everything works fine on my machine but when deploying it to AppHarbor I get a 500 error. I set customErrors mode="off"
and I still get a 500 error with no stack trace.
According to AppHarbor's FAQ:
If enabling Custom Errors doesn't produce a stacktrace, then that's indicative of a configuration problem that prevents the ASP.NET runtime from initializing. You can debug such problems by deploying your app (either built locally or build output downloaded from AppHarbor) to a full IIS running on your local machine. You must configure the application pool to run in Integrated Pipeline mode to properly replicate AppHarbor's environment.
So I did this. I downloaded the build output from AppHarbor and ran it on my local IIS and it worked fine!
The AppHarbor Errors page says
No errors to display.
And a AppHarbor's log session feature displays no meaningful information:
2013-12-31T09:55:20.886+00:00 appharbor web.1 Created new worker (version 1388526921) 2013-12-31T09:55:24.864+00:00 appharbor web.1 Warming up (version 1388526921) 2013-12-31T09:55:32.134+00:00 appharbor web.1 Web worker root URL returned HTTP status code 500 (Internal Server Error) (version 1388526921)
Any suggestions?
-- for references, here's an outline of my 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>
This question is related to
servicestack
appharbor
Just a wild guess: (not much to go on) but I have had similar problems when, for example, I was using the IIS rewrite module on my local machine (and it worked fine), but when I uploaded to a host that did not have that add-on module installed, I would get a 500 error with very little to go on - sounds similar. It drove me crazy trying to find it.
So make sure whatever options/addons that you might have and be using locally in IIS are also installed on the host.
Similarly, make sure you understand everything that is being referenced/used in your web.config - that is likely the problem area.
Source: Stackoverflow.com