We've used Copado to deploy changes between environments for a couple years, but for the past couple weeks, we've seen our deployments in Salesforce complete successfully (in the Deployment Status UI with the two circles), and then automatically retry again, until we get:
Fatal Error LIMIT_EXCEEDED: Try deploying again. Your deployment exceeded its maximum retry limit. If you keep seeing this error, please contact Salesforce Customer Support.
It happens for very simple deployments (just a field): what causes Salesforce to retry it?
For some of these deployments, we see the changes in the Setup Audit History, for each retry (so duplicate lines in that history), despite a deployment that ends with Failed.
For example, when watching the deployment in Workbench (via Metadata API Process Status), we see that this one succeeded at 2021-03-09T03:06:20
But then there's another one, same id and Created Date, but that started seven seconds later:
And finally this one, same id and Created Date, but that started 9 seconds after the second one:
And a few seconds after that, the Status changes to failed, but there are no componentFailures, only successes. Why is it failing without any failures?
Copado says it's a Salesforce issue, and Salesforce says it's a developer issue.
The closest open known issue I can find is Deployment Fails with UNKNOWN_EXCEPTION: admin operation already in progress" or "LIMIT_EXCEEDED error" When there is more one Deployment in queue., but we don't have more than one deployment in queue (according to the Deployment Status UI). Is there another way of checking to see if there are pending deployments that aren't showing up in the UI?
Any other ideas? We're running all tests which takes 45 minutes, but that doesn't seem excessively long compared to other instances I've heard about.
Our DeployRequest records (all of these succeeded, with the exception of the one that was cancelled) don't all seem to overlap, though some were created close in time:
UPDATE: This started when we deployed code based on the Kevin Poorman's apex Promise implementation (which is really nice to use and appreciated!).
I reproduced it in a fresh developer org using class one, two, three, and four. When trying to deploy a field label change via workbench running all local tests, I can reproduce the LIMIT_EXCEEDED result:
DeployRequestwith the tooling api (see here) to see if you see multiple rows. I also see this doc about how sending multiple requests at once/close together present this error message. I'd assume the answer lies in your Copado setup and making sure multiple things aren't triggered/scheduled at once.