Answers.Body: <p>I managed to find the solution. It seems the Drupal account used for the cron has to be synchronized with CiviCRM (to create its CiviCRM Contact) first before it can run.</p>
  
  <p>Use the menu to trigger manual synchronization: <code>Administer -&gt; Users and Permissions -&gt; Synchronize Users to Contacts</code>.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-02-12T15:25:49.407Z
Answers.LastActivityDate: 2019-02-12T15:25:49.407Z
Answers.UserDisplayName: sleidig
Body: <p>I am trying to set up the cron job through the <strong>cli.php method</strong> following the <a href="https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#php-cli" rel="nofollow noreferrer">CiviCRM Docs</a>.</p>
  
  <p>Running the command from my ssh session on the server as <code>www-data</code> user, I am getting the error:</p>
  
  <blockquote>
    <p>could not match userID and contactID</p>
  </blockquote>
  
  <p>But neither the CiviCRM logs, nor the Drupal logs, nor the apache error log gives me any further hints on what this means. </p>
  
  <p>I am running CiviCRM 5.9.1 on Drupal 8.6.9.</p>
  
  <p>How can I solve this?</p>
  
Tags: <cron>
Title: Cron through cli.php
ThreadText: # Cron through cli.php
  
  (Asked by: username_0 on 2019-02-12)
  
  I am trying to set up the cron job through the **cli.php method** following the [CiviCRM Docs](https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#php-cli).
  
  Running the command from my ssh session on the server as `www-data` user, I am getting the error:
  
  > could not match userID and contactID
  
  But neither the CiviCRM logs, nor the Drupal logs, nor the apache error log gives me any further hints on what this means.
  
  I am running CiviCRM 5.9.1 on Drupal 8.6.9.
  
  How can I solve this?
  
  **Tags:** cron
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-02-12. Score: 2
  
  I managed to find the solution. It seems the Drupal account used for the cron has to be synchronized with CiviCRM (to create its CiviCRM Contact) first before it can run.
  
  Use the menu to trigger manual synchronization: `Administer -> Users and Permissions -> Synchronize Users to Contacts`.
  
  
  ---
  
  