function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
AlwaysConfusedAlwaysConfused 

Problem with SOQL query ... causes server 500 error

Hi guys, no idea why but when I run this query the server throws a 500 error at me, any ideas why ?

 

SELECT col1, col2, colx

FROM Contact

WHERE LastModifiedDate > 2000-01-01T01:00:00.000Z

AND SystemModstamp > 2000-01-01T01:00:00.000Z

 

The query contains quite a few cols so i chopped them out (total query length is normally just over 3,000 chars).

 

The Contacts list is pretty big (2.7 million records) which might result in a query timeout or something ... not sure though, surely a timeout would result in some sort of .Net exception on the service but this is just dying on the server.

 

SuperfellSuperfell

SOAP Faults are returned via 500 http status code, can you detail the exact error you're getting,

AlwaysConfusedAlwaysConfused

The exact error reads:

 

 The remote server returned an error: (500) Internal Server Error.

 

 

... If this response came through IE it would result in a standard 500 error message simply telling me the server crashed.

I'm getting this in .Net after making the API call detailed above.

 

It's raised by the async result method :

WebResponse

EndGetResponse(IAsyncResult asyncResult) {}

 

The code in question that passes the fault to me is .Net framework code so I'm pretty sure I didn't break the response in some way.

 

The only thing i can think of is that there is some issue with what I send to the server.

 

I wish the API gave back something useful but alas all i get is this.

 

Another obvious way to reproduce this fault is to call QueryAsync and pass it half a query string.

Blatantly the query is broken in that case but it does result in the same response.

 

I think I might have found something that relates to the issue, not sure though, seems to be indicative of high loading.

If I make a lot of QueryMoreAsync queries in succession it cries and drops my connection, i'm guessing this is safety against DDOS attacks or something but it does mean I have to "intentionally slow my code down" in order to get a clean response from the server when running queries with huge result counts (eg 5 million or more records).

SuperfellSuperfell

There should be an HTTP body with the 500 error as well, remember that SOAP requires that SOAP Faults are returned with a 500 status code.

AlwaysConfusedAlwaysConfused

I agree .... there should be an http body.

 

In this instance however and the instance detailed in this thread ...

http://community.salesforce.com/t5/NET-Development/Internal-Server-Error-500-in-Upsert/m-p/182886/highlight/false#M8193

 

... That's all I get.

 

No html, just a simple text string telling me something went wrong on the server.

 

I wonder if .Net is handling and parsing the html out to just return the raw data?

 

I couldn't find anything on the msdn that details exactly how this process works but from what I can tell the .Net framework simply takes a 500 as "No valid response could be created" therefore I can only assuming that as soon as it hits that response code it simply returns a generic message saying "the server did something I don't like".