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
Rich FiekowskyRich Fiekowsky 

why might it be that our integration suddenly gets a 500 server error?

We have had an integration working smoothly for years. Two months ago, it stopped working for no obvious reason. The developers find that they no longer can query the contents of an Account!  
For instance, creating the account succeeds: 
..... method=post url="https://<OurSandboxName>.my.salesforce.com/services/data/v41.0/sobjects/Account (https://alertlogic--fullsb.my.salesforce.com/services/data/v41.0/sobjects/Account" style="color:#0563c1; text-decoration:underline)" headers=[{"Authorization","Bearer ***"},{"Content-Type","application/json"}] body=<<"{\"RecordTypeId\":\"012500000009a9EAAQ\",\"Name\":\"Test 1\", ....... 
No Problem. Reply gives the record id:


[{<<"id">>,<<"001nnnnnnnnnnnnnnnn">>},
{<<"success">>,true},
{<<"errors">>,[]}]
 
But then, try to get the Account later using the ID:

...method=get url="https://alertlogic--fullsb.my.salesforce.com/services/data/v41.0/sobjects/Account/001n (https://alertlogic--fullsb.my.salesforce.com/services/data/v41.0/sobjects/Account/0013F00000aKGbfQAG" style="color:#0563c1; text-decoration:underline)nnnnnnnnnnnnnn" headers=[{"Authorization","Bearer ***"}] body=[] timeout=60000 options=[{pool,sfdc_connection_pool}]

result={ok,{{500,"Internal Server Error"},[{"transfer-encoding","chunked"},{"content-type","application/json;charset=UTF-8"},{"sforce-limit-info","api-usage=59898/2545000"}, ......"}],<<"[{\"message\":\"An unexpected error occurred. Please include this ErrorId if you contact support: 587797726-215951 (689075404)\",\"errorCode\":\"UNKNOWN_EXCEPTION\"}]">>}}


I can view the Account it created in the UI. In the Developer workbench, in REST Explorer, it throws an error when I try the URL 
services/data/v41.0/sobjects/Account/001n (https://alertlogic--fullsb.my.salesforce.com/services/data/v41.0/sobjects/Account/0013F00000aKGbfQAG" style="color:#0563c1; text-decoration:underline)nnnnnnnnnnn" 

"Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details. You can do this from the Heroku CLI with the command
heroku logs --tail"
(I also tried v49.0)
Any ideas ?
 
Andrew GAndrew G
long shot - sharing rules?
 
Rich FiekowskyRich Fiekowsky
It turns out that this is a known problem of long standing and has a slot on the "known issues" pages.  It occurs when REST or SOQL queries fetch a large number of fields. In Apex where SOQL provokes the error, the workaround is to query fewer fields, perhaps doing two queries, instead of getting all the needed fields at once. In REST there is no such option, the usual fetch of a record fetches all the fields. One way around it would be to create one's own REST endpoint in Apex code, and use that instead of the built-in REST endpoint.
Possibly the problem started suddenly for us because we added fields to the object, and crossed the threshold of the issue.