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

Random 503 Service Unavailable Errors while testing

We've only recently discovered this in our testing, but we seem to be getting random 503 errors while doing testing of our .NET code against Salesforce Sandbox.
It always seems to happen during a query call.

When tests are re-run, it seems to throw that error in different places in the test, there seems to be no consistency for when I receive these 503 errors.

Is there anyway to tell whether I am hitting any of the API call limits (25 concurrent calls)?

I tried to do debug monitoring in Salesforce, but unfortunately, they only record 20 logs (the tests we do are a lot more), so we've been unsuccessful in capturing the issue in those logs.

Help anyone?
ForceMantis (Amit Jain)ForceMantis (Amit Jain)
Go to Company Information and check API Request, Last 24 Hours. If you are doing excessive testing on sandbox chances are high that you have breached these limits.
Thanks Amit,
Checking the API requests for the last 24 hours, we are well under the limit (about 40k requests out of 5 million).
Do you know if there's anyway to check whether we are hitting the 25 concurrent calls API limit?
VikashVikash (Salesforce Developers) 

503 Service Unavailable
Types of service issues are listed below. Be sure to check the X-Google-Command header to determine whether a retry is allowed.
Server error
Service unavailable
Insufficient quota

If the upload operation is interrupted or gets an HTTP 503 or 500 response, you should query for the number of bytes it has received by implementing another PUT Object request. The PUT Object request must have the following:

An empty entity body.
A Content-Length request header, which must be set to 0.
A Content-Range request header, which specifies the byte range you are seeking status for.
An upload_id query string parameter, which specifies the upload ID for the resumable upload.

503 – Service Unavailable All Events The end-point is unable to handle the API call. For example, there is scheduled downtime for the end-point back-end systems. The Push API will retry three times, and then suspend the call.

See the examples in the doc,

Reply back if you have further questions.