This took forever for me to figure out. The related things people mention about cron are unrelated. You need to go to Settings->General->Sharing->Remote Login click on the "i", and enable "Allow full disk access for remote users"