Skip to main content

Resolving validation errors - "Failure DestructiveChanges.xml"

"Failure DestructiveChanges.xml" was surfaced during a deployment

Mateusz Kochanowicz avatar
Written by Mateusz Kochanowicz
Updated this week

Explanation of the error

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

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

When doing a validation Gearset uses 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 in the org (or metadata was deleted through a method that did not include the CI job deployment).

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 navigate to CI jobs page in Gearset, finding the correct CI job and clicking the play button to manually re-run the validation, like so:

How to resolve in Gearset Pipelines

In your Gearset Pipeline page, simply select Retry validation for a PR in question.

Alternative workaround in Gearset

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?