function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ilya MedvedevIlya Medvedev 

Unable to deploy code

We are trying to deploy to our production org. All deployments give the following error, no matter which apex classes are being deployed:

Error: Cannot deploy while the apex code is currently executing.

This has been happening all day.
Our suspicion is that there is a stuck deployment from yesterday, but there are no active deployments listed in the org.

Thoughts?
 
PratikPratik (Salesforce Developers) 
Hi Ilya,

Is ther any scheduled apex or any batch running in the background while you deploying the code.

If there are any scheduled jobs or batches, you can stop/abort them and then try to deploy.

Thanks,
Pratik
Ilya MedvedevIlya Medvedev
There were not any listed. We also tried multiple times throughout the day.
It looks like it started working all of a sudden this morning - I cannot find anything that would have changed on our end, so I am worried this can happen again.
Matt WhalleyMatt Whalley
I was just getting that error.  I deployed some objects (with no apex code in the package) and that worked.  After the objects went in, I deployed the Code and everything was fine.  Very odd, but I think that's the work around, deploy non code to get it out of that funky state, then put in your stuff.
PratikPratik (Salesforce Developers) 
Hi Ilya,

Is there issue now, or as Matt said you can even try deploying a custom field  (depoyments without any apex class, trigger of VF pages) as to check if issue still persists. 

Thanks,
Pratik
Brian RichardsonBrian Richardson

This (or something similar) is occuring right meow in our production org. We attempted the config-only trick, deploying an unneeded checkbox on a custom object, but the deployment is stuck as well, as indicated below...

Anyone else find a solution to this? Currently working with Tier 3 support on this.

hangin