Loading

Metadata Deployments are Dequeuing Before a Previous Deployment has Finished and therefore is Failing with a Fatal Error

Дата публикации: Apr 23, 2024
Описание

When executing two deployments where the second deployment was made shortly after the first one, the second is failing with the following fatal error, “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.”

Expected Results
The second deployment succeeds.

Actual Results
The second deployment fails.

REPRODUCER:
1) Login in the org
2) Create the following Apex test class.

public class Test {
  @isTest
   public static void test1() {
   String dummyString = '';
   Integer max = 100000;
   for (Integer i = 0; i < max; i++) {
   Integer rand = Math.round(Math.random() * 1000);
   dummyString = dummyString + String.valueOf(rand);
   }
}

@isTest
public static void test2() {
String dummyString = '';
Integer max = 100000;
for (Integer i = 0; i < max; i++) {
Integer rand = Math.round(Math.random() * 1000);
dummyString = dummyString + String.valueOf(rand);
}
}

3) Download the zip files that'll be used for the testing.

4) Go to workbench, deploy using the zip file, choose test level as RunAllTestInOrg, leave everything else as default. Click Next and click Deploy.

5) Repeat step 5 immediately.

6) The second deployment should fail with the error.

Решение

Space out the deployments.
The second deployment shouldn't be dequeued until the first deployment has finished. It doesn't make sense to dequeue it if another deployment is executing because it won't be able to get the lock. Retry the deployment after failing to acquire the lock.

 

Номер статьи базы знаний

000381180

 
Загрузка
Salesforce Help | Article