Can you open a shell with that user and run the php -f cron.php command manually? I assume that the user executing the script is not allowed to.
Pls have a look at your config.php-file, you should see an array like:
In admin > scheduler > Process Workflow Tasks > Last Successful Run
The value changed from NEVER to
LAST SUCCESSFUL RUN: 2022-06-21 01:20 PM
After 30 minutes, I noticed the "Last Successful Run: was the same at 01:20 PM, so I ran the command again:
LAST SUCCESSFUL RUN: 2022-06-21 01:52 PM
In order to test the cron job:
I created a “Web Person Form” and completed the basic questionnaire. The data was inserted as a new lead, but the Workflow to send an email template after 2 minutos was never executed.
I tested with a conditional:
Date created “is less than or equal to” Now - 2 minutes
Give us a screen shot of your workflow conditions. Now that we’ve established your cron jobs are running, it must be the workflow conditions (also are any errors in the error log that relate to that specific workflow so we can rule out that it’s erroring out).
Ok so the issue is still who is running Cron. The user is not being authorized by the server because it’s viewed as external to run the job (I’m not a server admin expert but that’s how I understand it it) That’s what the running as CLI error is all about. You might want to try something like easycron to trigger the Cron job from an external source. I’ve used this in the past when I run into these kinds of issues. If anyone has a better solution to this problem I’d love to hear it.
Just so you know, by commenting that out it will work, but it will also allow cron.php to be run from web through a browser just by navigating to https://yourinstalldirectory/cron.php (this is how easycron does it, but you edit these lines of code to specifically allow easycron to trigger cron.php).
If you’re server isn’t open to the web maybe not such a big deal, but if open to the web someone could theoretically hit that URL over and over and bog up your server.
I have changed the incoming leads to “ONLY ON SAVE” and the second action, email sent after 1 day, to:
RUN: Only in the Scheduler
RUN ON: Modified Records
When I screen captured these settings, I was trying to troubleshoot the workflow.