0

This invocation now returns a result code of 0.
And still I see no evidence that it ran my civimail,
in the browser UI, at /civicrm/mailing/browse/unscheduled,
nor in the logs at /civicrm/admin/joblog, nor in my inbox.

I've been struggling with this issue for a moment now.
Sorting through these issues, to get to this point is documented here:
CiviMail cron job unable to find: civicrm.config.php, built with: roundearth/drupal-civicrm-project

/usr/bin/nice -n19 /usr/bin/php \
    -d require /opt/local/my_client/drupal/vendor/autoload.php \
    /opt/local/my_client/drupal/vendor/civicrm/cv/bin/cv api job.execute \
    --cwd=/opt/local/my_client/drupal --user=mailprocess

My script now reads:

#!/bin/bash
set -x

CMD=$1
CWD='/opt/local/my_client/drupal'
CV="${CWD}/vendor/civicrm/cv/bin/cv"
CIVIMAIL_USER='mailprocess'
requirements="-d require ${CWD}/vendor/autoload.php"
PHP="/usr/bin/nice -n19 /usr/bin/php"
ARGS="--cwd=${CWD} --user=${CIVIMAIL_USER}"

cd ${CWD}; ${PHP} ${requirements} ${CV} api job.execute ${ARGS}
exit "$?"
2

Your script is nicely designed for running the civi cron using "cv", quietly in the background. But you want to run it w/ noise so you can debug it.

To start, try running it manually without the last line and see if you get anything. The main script here is "cv" (run as a php script) and the other bits are making sure cv runs with the right arguments. If it's quitting silently, try something simpler, like seeing if you can actually run php and then if you can run cv via php with a simpler argument like "vars:show".

Documentation of cv is here: https://github.com/civicrm/cv

2
  • Thank you, Alan Dixon. Testing an api call to the 'vars:show' target still produces no output. Do I need to enable these API calls in the user permissions at the CMS level, somehow? – Hugh Esco Jun 5 '20 at 4:17
  • If it were a permissions error, you should see an error to that effect. It sounds like your civicrm or cv is not setup properly. Running cv by itself should at least prompt you for the command. – Alan Dixon Jun 9 '20 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.