We have been getting persistent deployment failures saying:

UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: [specific log number] (2104429247)

We have to contact support each time and it takes about a day++ to get a resolution. It always tends to be a problem with an Apex Class; removing that particular Apex Class resolves the issue.

1 Answer 1


We got some helpful insight on this from Salesforce support:

This can occur if the same components are in both the package.xml and the destructivechanges.xml files. If we deploy and delete the same component inside the package.xml and destructivechanges.xml we will get the "Couldn't load apex class/trigger for compile" error. It seems it is not possible to execute both operations at the same time.

If this is the case, the advice is to complete any destructive changes before doing a deploy (as 2 separate ANT deployments) to avoid this issue. If you are completing the destructive changes separately, in order to deploy the destructive changes you must also have a package.xml file that lists no components to deploy, includes the API version, and is in the same directory as destructiveChanges.xml (https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/daas_destructive_changes.htm).

In other words, you should do the following:

Step 1. Delete Components

Replace the current package.xml by an empty package.xm and deploy:

Step 2. Deploy Components (to add or update existing components)

Remove the destructiveChanges.xml from the ANT folder and replace the empty package.xml by the original one. Execute the deploy operation

If you ONLY want to delete components, follow Step 1 only

  • Please do note that this exception can appear for many different reasons across the platform...while this post may be useful to someone that has the exact same scenario as you, the vast majority of people who see this exception in their org will not be experiencing the same issue, so this resolution will likely not be relevant to them. Oct 19, 2016 at 17:51
  • Hi @BrianMansfield I agree that there are a ton of reasons someone might encounter an "UNKNOWN_EXCEPTION". But here I'm specifically talking about exception #2104429247. That exception ID indicates "cannot load Apex class". We've gone back and forth with different support agents and they were not able to give us a clear explanation until today. This post is to provide more information publicly to other users experiencing that same Exception ID.
    – abd3721
    Oct 19, 2016 at 21:10

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .