Symptom
CloudSense managed package installation fails during the post-install script execution. The installation may appear to start correctly but fails at the step where the post-install script attempts to schedule Apex jobs (e.g., CS AsyncTask Cleanup Schedulable).
The error indicates that the Salesforce org has reached the maximum number of scheduled Apex jobs (100 limit).
Cause
Salesforce enforces a limit of 100 concurrent scheduled Apex jobs per org. When the CloudSense package post-install script tries to schedule its required Apex jobs, the operation fails if the org has already reached this limit.
A common cause is a large number of stale or redundant scheduled jobs accumulating over time. For example, a custom scheduler class (such as OMToolBatchScheduler) may have created many duplicate scheduled job entries.
Resolution
Step 1: Check current scheduled Apex jobs
Run the following SOQL query in Developer Console or Workbench to see all currently scheduled Apex jobs:
SELECT Id, CreatedDate, CreatedBy.Name, JobType,
ApexClass.Name, Status, CronTriggerId
FROM AsyncApexJob
WHERE JobType = 'ScheduledApex'
ORDER BY CreatedDate DESC
Review the results to identify:
- The total number of scheduled jobs
- Any classes with an unusually high number of scheduled entries
- Stale or redundant jobs that can be safely removed
Step 2: Identify and remove stale scheduled jobs
To see the CronTrigger records (which control scheduled job timing), run:
SELECT Id, CronJobDetail.Name, State, NextFireTime, StartTime
FROM CronTrigger
WHERE CronJobDetail.JobType = '7'
ORDER BY NextFireTime ASC
Delete unnecessary CronTrigger records to bring the count below 100. Focus on:
- Duplicate entries from the same Apex class
- Jobs with no upcoming NextFireTime
- Jobs from classes that are no longer in use
You can delete CronTrigger records via Developer Console:
// Example: Abort a specific scheduled job
System.abortJob('<CRON_TRIGGER_ID>');
Or to bulk-abort jobs from a specific class:
List<CronTrigger> jobs = [
SELECT Id FROM CronTrigger
WHERE CronJobDetail.Name LIKE '%OMToolBatchScheduler%'
];
for (CronTrigger job : jobs) {
System.abortJob(job.Id);
}
Step 3: Retry the package installation
Once the scheduled job count is below 100 (recommend keeping well under the limit), retry the CloudSense package installation.
Navigate to the package install URL:
/packaging/installPackage.apexp?p0=<PACKAGE_VERSION_ID>
Step 4: Verify the installation completed successfully
After installation, confirm:
- The package appears in Setup → Installed Packages with the correct version
- The CloudSense scheduled jobs were created successfully (check AsyncApexJob again)
Additional Notes
- The Salesforce limit of 100 scheduled Apex jobs is a hard platform limit. Monitor this count regularly, especially in orgs with many managed packages or custom schedulers.
- Consider implementing a governance process to review and clean up scheduled jobs periodically.
- If the same scheduler class keeps creating duplicate entries, investigate the root cause (e.g., a trigger or process that re-schedules the job on every execution).
- This issue can affect any CloudSense package installation, not just the Product Explorer package.
Priyanka Bhotika
Comments