Salesforce stuck in Administration Locked state organization after using Apex Test Execution

I used the Apex Test Execution screen to run all test cases in a sandbox.

Several test cases passed, and then the progress seemed to depend on one test case that previously worked.

Then I used the Abort button to try and cancel the execution of the test, which turned out to work.

Now, any subsequent attempts to run tests will never go past the queue state.

ApexTestQueueItem stuck in Queued State

Selecting an individual apex class and using the synchronous Run Test button results in the following error message:

Organization administration blocked

The changes required require salesforce.com to temporarily block your organization’s administration from setting up. However, the administration setting is already blocked by another change. Wait for the previous action to finish, then try again later.

Trying to save changes to the Apex class from Eclipse gives an error:

  • Save error: Unable to save to all files. Your changes require that> salesforce.com temporarily block your organization’s setup. However, the administration setting is already blocked by another change. Wait until> the previous action ends, then try again later. (ALREADY_IN_PROCESS)

If I query the ApexTestQueueItem table, then 3 test cases appear related to the processing state.

ApexTestQueueItem stuck in Processing

How can I remove these ApexTestQueueItems from the processing state? I guess this will lead me to block the organization.

I checked Test Audit Trail and only the latest changes were from my user to the Apex classes.

+6
source share
4 answers

Updated

My support offer has moved to the Senior Support Team. They did something with my sandbox and reported that it was a known problem, and at the same time run test cases for one class using the Apex Class interface (for example, https://xyz.salesforce.com/01pL00000000001 ).

I should not run test cases with:

  • Apex Progress Checker User Interface
  • Manually creating ApexTestQueueItem records
  • Apex Classes - [Run All Tests]

I assume Eclipse is currently ok for individual test cases, as it is not asynchronous in nature.

I would like to tell you exactly what they did with my problematic sandboxes, but at the moment I'm not sure. We hope that a parallel question on the developerforce forum gives several answers - Using Apex Test Execution leads to an “organization lock” that doesn't get cleared

Interesting information from Twitter:

"... worked on this all day. I hope the fix will be next wk." - Rich Unger

"@rich_unger good to hear, thanks for the update, any short-term solution? If not, I will transfer my code to another organization until then" - Michael Gallagher. "Workaround @ mjgallag24 - don't use asynchronous testing" - Rich Unger

So, to answer my own question, "How can I remove these ApexTestQueueItems from the" Processing "state?

Answer: you cannot at present if you are experiencing a "known problem". The only option is to raise a support question and wait for Salesforce to clear it.


I tried the following anonymous vertex to clear the apex test cases from the processing queue:

List<ApexTestQueueItem> items = [Select Id,ApexClassId,Status,ExtendedStatus,ParentJobId from ApexTestQueueItem where Status != 'Completed']; for(ApexTestQueueItem atqi : items) { atqi.Status = 'ABORTED'; } update items; 

This does not seem to have the desired result, as in the subsequent SOQL query for ApexTestQueueItem, the status column remains unchanged.

I searched for Apex in [Administration Setup> Monitoring> Apex Jobs], but not one of the entries where JobType = TestRequest appeared.

Then I tried to abort using an anonymous vertex:

 System.abortJob('707L0000000FgZIIA0'); 

AsyncApexJob changed the status to "Canceled".

+5
source

In one of my organizations, it unlocked after about 16 hours, I was able to avoid re-locking by running tests one at a time, but not through the Apex Text Execution page that I either did, the IDE or Apex Class page in the user interface

+1
source

You really have to apply for it. Without knowing more information, for example, your org identifier, we cannot say what really happens. The short-term solution is likely to require us to destroy the zombie processing tests at our end.

Rich Unger Code Apex Team

0
source

We were told by SF Support that this is a known issue, a fix is ​​under development, and they hope to release it next Wednesday.

0
source

Source: https://habr.com/ru/post/909590/


All Articles