2

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 DeployResult 1

But then there's another one, same id and Created Date, but that started seven seconds later: enter image description here

And finally this one, same id and Created Date, but that started 9 seconds after the second one: enter image description here

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? enter image description here

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: enter image description here

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:enter image description here

7
  • what are you deploying exactly (i see 43 components) and how are you deploying? I'm not clear on if you replicated this behavior purely using workbench (with no copado involvement) or not. – Kris Goncalves Mar 9 at 20:27
  • Ah, thanks for looking Kris. This deployment includes 25 custom apex classes, 1 trigger, 4 custom fields, a duplicate rule, 2 flows, three layouts, a profile password policy, a permission set, FLS for three profiles, and 2 validation rules. But this same behavior also happens on the simplest deployment. We're deploying through Copado, and I'm just just using Workbench to try to get more information about deployment status (since we don't get that through the UI or Copado). – Peter Yao Mar 9 at 21:56
  • How does the deployment get triggered? Manually initiated, from a source control push, etc. The "simplest" answer sounds like copado sending multiple request at once and running into the issue but I would've suspected they could've helped with that – Kris Goncalves Mar 9 at 22:03
  • Yes, Copado triggers it (and we use it on schedule). If it's sending multiple requests at once, would we see multiple deployments in the Deployment Status UI (in a list of Deployments waiting - I forget the text exactly). Is there any way of querying for deployments awaiting execution? The thing that's surprising to me is that the same deployment id is being retried multiple times. – Peter Yao Mar 9 at 22:41
  • 1
    Is what you're trying to deploy, deployed in the end of all this? You can query DeployRequest with 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. – Kris Goncalves Mar 10 at 0:19
0

Another customer posted the same problem in the Apex Transaction Finalizers community: https://trailblazers.salesforce.com/0D54S00000ANXvQ

Sounds like a bug - both of us have open cases with Salesforce.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.