ICloud – “cron” processes spawning and piling up, but no crontab

activity-monitorcatalinacronicloudlaunchd

EDIT: I solved this, so see below for my own answer. While the bounty asks for a fix to the problem, I'd like to award it to someone who can explain why a cron process that ran for 6 years over multiple MacOS versions suddenly became a problem in Catalina.

First note, this is not a duplicate of "cron" processes piling up because I don't have active crontabs on my computer. Cron processes spawn, but they never finish, so they just keep piling up. I'm running MacOS Catalina 10.15.1

Cron jobs are spawning every couple of minutes and never dying. The oldest cron process always has a parent process "launchd", and I've searched for populated crontabs and can't find any. If I let this go on long enough, eventually I run into a scenario where I have hundreds of running cron processes and everything on my computer grinds to a halt, and I can't even open new apps (I get cryptic messages like ".app cannot be opened" when I try to open an app). My only solution at this point has been to keep activity monitor open and periodically killing off all active cron processes.

I've been able to create a new user account that seems to be immune from this issue. However, as soon as I logged into my apple ID on that account to set up iCloud drive, the problem started with that account, too. I logged out of my Apple ID and attempted uninstall iCloud drive, but the problem persisted. Clean installs of Catalina don't clear up the problem, I've reset SMC and PRAM multiple times, and repairing permissions (via this https://support.apple.com/en-us/HT203538). I've also ensured that cron has full disk access (via this https://blog.bejarano.io/fixing-cron-jobs-in-mojave/). I'm at a dead end with trying to troubleshoot this problem.

I'm not sure it's related, but my "system.log" file seems to get spammed the following few lines:

<redacted> AMPDeviceDiscoveryAgent[2132]: Entered:_AMMuxedDeviceDisconnected, mux-device:63
<redacted> AMPDeviceDiscoveryAgent[2132]: Entered:__thr_AMMuxedDeviceDisconnected, mux-device:63
<redacted> AMPDeviceDiscoveryAgent[2132]: tid:9a27 - Mux ID not found in mapping dictionary

ANY help is appreciated.

Best Answer

So I found a relevant answer here:

Cron job keeps running, not in any crontabs

I don't think this question should be removed because this seems to be relevant to Catalina, even though it seems to be user error.

Explanation:

The root crontab had been edited at some point, with cron jobs that I created 6 years ago on my computer (I may have done this before learning that was a bad idea). This crontab had two lines that each referenced a script that was supposed to run every minute. Neither one of these referenced existing locations on my drive, and for whatever reason cron wouldn't exit after attempting to run them.

This problem never manifested before upgrading to Catalina, but I don't know why that is - either cron was running every minute for the last 6 years and the Catalina update semi-broke cron, or something got copied to the root cron file. Probably the former problem, which would be a PIBCAK scenario combined with typical Catalina issues.

The solution was to edit the root-owned crontab to remove the two offending lines, and boom, the problem is gone!

I created a new user crontab for testing, and this leaves one persistent cron job (with parent = launchd), but the rest of the cron jobs that I run will exit predictably and not suck up resources. Cron itself doesn't seem to be broken, but root-run cron jobs may be problematic. (EDIT: I deleted the root crontab and now activity monitor doesn't show any cron processes running - I'm mystified as to why this happened with only certain user accounts, since none of this happened at the user level)