ashes999
ashes999

Reputation: 10163

Debugging HTTP 500 (Internal Server Error) in WCF Service / Staging

I have some WCF services which are running great locally; client can consume them and the server is putting data in the DB as expected. The problem is that when I deploy these to a staging machine, all I can see are HTTP 500 errors.

How do I start debugging the problem?

Given that it's only on staging and not on my local dev machine, I assume it's an IIS configuration problem somewhere.

When I use Fiddler to see what's being sent and what the response is, I can see (as expected) correct request data, and only a 500 as the response -- no further details.

I'm pretty green to WCF and IIS, so it's probably something obvious; I've used aspnet_iisreg, deployed my .svc file and all the built DLLs/files from bin; maybe I missed something.

I looked in the IIS logs, but they're pretty skimpy; no error information there, either (or maybe I'm looking in the wrong place?)

(More important than solving the specific problem is figuring out how to see enough details about errors so I can work through problems myself.)

Edit: I of course checked the event logs first -- and surprisingly, didn't find any mention of the exceptions. So I assume that the service is at least being invoked, and that something is faulting in the middle.

Upvotes: 9

Views: 33677

Answers (4)

Alaa Alweish
Alaa Alweish

Reputation: 9084

Add:

<httpErrors errorMode="Detailed"/>

In Web.config under:

<system.webServer>

And see what's happening in more details.

Upvotes: 4

ashes999
ashes999

Reputation: 10163

It turns out that the server was returning a 500 because of a huge dataset returned; WCF puts some limitations on the size of data (and strings) you can return, to prevent DOS attacks. I solved the problem by increasing the limits, and decreasing the size of data returned (where applicable).

Upvotes: 1

Srikanth
Srikanth

Reputation: 309

'Http 500 Internal Server Error' might occur if your Service Account's password got expired. Please make sure that you don't have any issues with Service Account which is running the app pool on IIS.

Upvotes: 2

Ladislav Mrnka
Ladislav Mrnka

Reputation: 364299

The first place to look for errors is event log on the server. There should be basic information why request was not processed. If it is WCF related you can turn on WCF tracing and check for more details in generated logs.

Upvotes: 7

Related Questions