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.
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 in a pipeline, simply hitting the re-run validation.
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: