Skip to main content
All CollectionsTroubleshootingSalesforce validation errors
Resolving validation errors - "Failure DestructiveChanges.xml"
Resolving validation errors - "Failure DestructiveChanges.xml"

"Failure DestructiveChanges.xml" was surfaced during a deployment

Quinn Kuiper avatar
Written by Quinn Kuiper
Updated over 9 months ago

Explanation of the error:

This Salesforce error that Gearset is surfacing is usually encountered when validating a pull request targeting a branch with the CI job with the setting Validate pull requests targeting the source branch.

This is because of how we have created our delta CI jobs for increased performance.

When doing a validation we use a cached version of the org rather than downloading the metadata from Salesforce every time, saving time and resources.

In this case, the metadata has been deleted in the branch, as well as manually (or through a method that does not include the CI job) in the org.

Gearset cannot know that it has been deleted independently (outside of the validation job), and creates the package to be deployed, including the Destructive Changes.xml.

When it comes to validation, Salesforce cannot find the changes to be deleted, and therefore throws the validation error "Failure DestructiveChanges.xml".

Resolution:

To resolve this issue try going into the CI job list, finding the correct CI job and clicking the play button to manually re-run the validation. Or if the in a pipeline, simply select Retry validation.

From a pipeline

From the CI job list

OR

To workaround this issue try going to your team’s deployment settings and turn off Treat warnings as errors.

Further examples of this Salesforce validation error can be found here:

Disclaimer: This error is returned by Salesforce directly, rather than Gearset. Even so, we offer guidance based on our combined experience with the Metadata API. Where possible, we try to help guide you to fix or avoid this error. In the case that this isn't possible, we may need to direct you to Salesforce support for further clarification.

Did this answer your question?