How to fix UNKNOWN_EXCEPTION in Salesforce deployments
Salesforce returned a generic, uncategorized error, usually pointing to an org-side issue rather than the deployment's own metadata.
Surfaces during: any deploy or DML operation, as a catch-all when nothing more specific appliesWhat it means
UNKNOWN_EXCEPTION is Salesforce's catch-all error code for failures that don't map to a specific, documented error type. It often indicates an org-level issue, a temporary platform problem, an unhandled exception deep inside a managed package, or a metadata conflict too unusual to categorize, rather than something wrong with the deployment package itself.
Because the code itself carries no diagnostic detail, treat it as a signal to look outward, at instance status, package internals, and prior partial deployments, rather than assuming the fix is somewhere in the metadata you just wrote.
Common causes
The fix
- Retry the deploymentMany UNKNOWN_EXCEPTION failures are transient; a straightforward retry resolves them without any change.
- Check Salesforce Trust status for the target instanceConfirm there isn't an active incident or maintenance window on the org's instance before troubleshooting further.
https://status.salesforce.com/instances/<your-instance> - Deploy a smaller subset to isolate the causeSplit the deployment into smaller pieces to identify which specific component triggers the exception, since the error itself gives no detail.
How Serpent prevents this
Serpent keeps full deploy logs and history per task, so a retried deployment after an UNKNOWN_EXCEPTION is traceable to the exact attempt that failed instead of getting lost in a one-off CI run. See the Salesforce deployment error library.

Prevention
Related errors
UNKNOWN_EXCEPTION, answered
Start free. No credit card, no install, no commitment.
Set up in under 15 minutes. No DevOps hire needed.
