Thursday, 10 June 2021

Internal Salesforce Error - Debugging

Internal Salesforce Error we face some times in our work, This is called as Gack error which means the error thrown is not handled by the application.

Understanding the root cause for these kind of errors is difficult, Can try below options to figure it out. Along with the raising of case with Salesforce Support team.

1. Perform the action when this error occurring and see the Execution Log (Developer Console --> Logs),This will show the apex trigger order execution failing at which place.

Ex: Loading/Validations/Before Triggers/Saving The Record/After Trigger/WF/PB/etc

2.Based on the above can identify where its failing and try disabling that part and try to execute that flow.

Ex: Validation rules / Triggers/WF/PB /Flows etc.as per order execution.

3.Identify from when the error is occurring.(or) rom when you noticed.

4. Verify is there any recent release and change in api versions is triggering this error.

5. Verify the  audit log to see just before the issue is getting triggered what are the activities performed and what could be the potential possibility.

One of the experience : All the test classes are failing in development org.

Below are the tried steps to identify the root cause :

1.First create new test class and Take any one of the failing test class and add the part of code to new test class and try executing ,You will be able to figure out due to which object data set up its failing.

2.In our case its failing for Account object, And then further verify Is it failing for specific field entry / any field its failing, Identified failing only when first name /last name entered this is person account.  

3.See the execution log and based on that tried disabling all the triggers and validations, PB w.r.t that object, Still face the same issue. This confirms its not occurring due to any custom code /config change of project. 

4.Compare the Salesforce API version in this org w.r.t other org where its working fine, That also looks same no change in versions.

5.Verify Audit log & See is there any new release of Salesforce / Any 3rd part packages deployed or updated just before the issue is noticed. There was one Salesforce Release but nothing will affect because of that features.

6.In the audit log found there is a Started data sync for Account - Platform Encryption ,Which causing this issue ,Whenever you do (Setup --> Encryption Statistics --> Data Sync) be mindful and if it is very much required then only play around with this.

7.From our end to progress refresh sandbox to get going, Its dev org so its easy to get refreshed but same issue if you face in other org then definitely difficult perform refresh. 

8. Salesforce has to figure out why this is causing the issue & Fix from their end.