+ Start a Discussion

Deployment error: Schedulable class has jobs pending or in progress, but it doesn't

I keep getting this error when I try to validate a deployment. The classes in question are not schedule classes or related to scheduling in any way. Once is a controller for a VF page, then tests for that controller, and a utility class with some static methods.

I have a completely seperate and unrelated scheduled job but it was not running when I got this error.



C:\Documents and Settings\venable\Desktop\deploy\build.xml:7: Failures:
classes/configAddProductsVF.cls(1,8):Schedulable class has jobs pending or in progress
classes/configAddProductsVFTEST.cls(1,8):Schedulable class has jobs pending or in progress
classes/utility.cls(1,8):Schedulable class has jobs pending or in progress

Anyone seen this before?


Best Answer chosen by Admin (Salesforce Developers) 
The error messages above is when I was using ANT to deploy. Using cloud deploy with the exact same contents worked fine......go figure.

All Answers

The error messages above is when I was using ANT to deploy. Using cloud deploy with the exact same contents worked fine......go figure.
This was selected as the best answer

What can possible be causing this?  I get the same error no matter what using ANT or Eclipse to deploy to production.  I do not get it when deploying to Sandbox.  I do not have and scheduled jobs using those classes.  What could it be?


By "cloud deploy" do you mean using Change Sets?


We've seen this error this week, we unscheduled (heh, is that even a word?) the job and scheduled it after deployment.Not ideal, but we can cope, though I can understand this would be undesirable in some cases.


Have you raised a case?


Yup, with Change Sets you should be able to do deployments without unscheduling your jobs.....which is a pain.


This is a real problem for us since we heavilly use the Ant Migration Tool to aid with deployment and continuous integration using Hudson.  How can we resolve this.  Change sets are an option for this kind of setup?  Do we need to abandon Scheduleable Apex Jobs?




I'm getting a whole lot of errors when trying to deploy from Eclipse today.  I don't know if it is related to the updates that Salesforce pushed over the weekend or if it's something else.  All I know is I haven't been able to push anything into production today.  A lot of the classes/triggers I've been trying to push in have been throwing "too many SOQL queries: 101" errors on lines that don't even have queries.  One of them is just a line that sets a variable.  I also got this "Schedulable Class has jobs pending..." error on a class that not only isn't scheduled, it's not even a schedulable class.  ???


Is your class used within another class which is scedulable?

Pragya JLTPragya JLT



I am getting the same error while deploying to full sandbox using ANT,  while deplyoing to Dev or Config sandbox there was no error. We can not use changeset instead of ANT tool for deploymnet due to some complex process.


So is there any workaround to resolve this issue while deploying through ANT


No. It's not related to a scheduable class in any way - I think there was something wrong with the Salesforce system that day, but I can't say for sure...either way, the issue went away by itself and I haven't seen it since.


I think you'll probably have to delete/abort the scheduled apex, deploy, then reschedule in order to use ANT, but it's possible that somebody else might know of a way to do it without having to cancel your scheduled classes

Pragya JLTPragya JLT


Thanks for the post. My issue is resolved now. It was wired but I had to delete all Apex schedule Job from target environment even those were not relevant to my deployment package to deploy it successfully.


Ken KoellnerKen Koellner

Does anyone know if that's a new behavior, errors on classes because of scheduled jobs, even classes having nothing to do with the jobs?


I have a package with 72 classes and I have six scheduled jobs, I'm getting that error on 62 classes and I know not every one of 62 with errors references something in common with the scheduled jobs.


I'm actually now surprised that 10 didn't have the error.



Pragya JLTPragya JLT

Yes, I am also getting same error if I am trying to deploy with schedule apex job in target org and these errors are coming for non related apex class also. After deleting Schedule job, deployment is done successfully and there is no further issue. Even I raised support request to salesforce about this and reason behind this but no luck.

So the best option is to delete jobs and then reschedule.


Not even talking about deployment - I couldn't save edits to a non-scchedulable class from IDE because of this weird error...  Of course saving is an API call similar in nature to deployment.




i am also facing this error while deploying from Sandbox to Sandbox. there is no any schedule jobs running in both source and target instances. still facing this issue. is this related to Cookies that get saved in salesforce server?


ganesh jadhavganesh jadhav

I am trying to Run Schedule job........but Schedulable class has jobs pending or in progress? This Error is occurs again and again, i have deleted the scheduler class and tried again still same problem occurs if have any suggetions please let me know...... here is my scheduler class :-


global class BirthdayMailSend implements Schedulable
    global void execute (SchedulableContext ctx)
    Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();    
    for ( Employee__c emp : [SELECT Id, Name,email__c,First_Name__c FROM Employee__c WHERE Birth_date__c = TODAY] )
     mail.setSubject('New Employee Record Created..!');
     mail.setHtmlBody('Hello'+emp.First_Name__c+'!<br/>today is your birth day bhikarya cake kap nahi tar muskadin');
     mail.setToAddresses(new String[] {emp.email__c});
     Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });        
    BirthdayMailSend mc = new BirthdayMailSend();
    String sch = '0 0,1 * * * *';
    system.schedule('Birthdaymail', sch, mc);