Body: <p>I'm trying to kill off an error in WP "Cron Not Running"</p>
  
  <p>I installed cv.  Im putting lines into crontab that trigger cv, such as</p>
  
  <pre><code>*/5 * * * * cv api --user=www-data job.execute
  </code></pre>
  
  <p>...as per instructions related to this error.</p>
  
  <p>The Civi error is persisting.  Also, cv, unexpectedly to me, returns HTML as output at the command line, e.g.</p>
  
  <pre><code>foo@bar  sudo cv ext:list
  </code></pre>
  
  <p>Outputs HTML, counterintuitively.</p>
  
  <p>This HTML appears to be the Wordpress site's top page itself (aka a maintenance mode page.</p>
  
  <p>I thought cv with that option would list a bunch of vars, not spit up the site.</p>
  
  <p>Anybody know what's up here?  </p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-27T23:26:16.570Z
Comments.Text: Do you have a WordPress user named `www-data` or is that the name of the *system* user your webserver/cron run as? If there's no WP user by that name, that could trigger an error when using the `--user` param.
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-27T23:26:20.553Z
Comments.Text: You might be able to scroll through the HTML output looking for an error, or check CiviCRM's debug log for the cause of the problem. See also https://issues.civicrm.org/jira/browse/CRM-20820
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-28T00:32:35.887Z
Comments.Text: I think I need help understanding why I'm even bothering with cv, or why "cron isn't running" when it's absolutely running.  (Crontab entries run fine, tested that using touch /some/file way back at the beginning of this.
  
  Thanks for the note about the user name - I gave it a system user name (www-data) to match Apache's user and I guess I should give it the WP user name.  Will do.
Comments.UserDisplayName: harrumph
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-28T01:05:41.247Z
Comments.Text: UNIX cron calls CiviCRM's [Scheduled Jobs](https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cv) via `cv`. The error message you're seeing is a bit misleading in that regard; ideally it would say *Scheduled Jobs not running* rather than introducing a new term "cron" which has other meanings in the same domain. Scheduled Jobs are discussed in depth at that linked docs page (which I guess you've seen, since you got here already!).
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-28T16:04:10.840Z
Comments.Text: Thanks Chris. Am I seeing expected results with cv?  Meaning, if i run sudo cv ext:list I'm supposed to see the site's top page HTML and nothing else?
Comments.UserDisplayName: harrumph
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-28T16:18:22.857Z
Comments.Text: Depends what the HTML says? To read that HTML, I would `cv ext:list > out.html` then open out.html in a browser. `sudo cv ext:list` might work, but it might also leave behind files in `templates_c/*` that your system `www-data` user can't overwrite. So I recommend either executing `cv` as the system user `www-data` (easy), or [follow some other process which permits shared file access](https://civicrm.stackexchange.com/questions/2923/civicrm-does-not-have-permission-to-write-temp-files/2931) (complex).
Comments.UserDisplayName: Chris Burgess
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-11-28T16:30:49.153Z
Comments.Text: IMO you've run into a place where CiviCRM's admin experience could improve - if those `cv` outputs were clear people would struggle less to configure CiviCRM. IMO cv should not output HTML for you like that, but that's what CiviCRM does for now, hence [CRM-20820](https://issues.civicrm.org/jira/browse/CRM-20820). Would be good to improve on that.
Comments.UserDisplayName: Chris Burgess
Tags: <wordpress><cv>
Title: Why does cv output HTML?
ThreadText: # Why does cv output HTML?
  
  (Asked by: username_0 on 2017-11-27)
  
  I'm trying to kill off an error in WP "Cron Not Running"
  
  I installed cv. Im putting lines into crontab that trigger cv, such as
  
  ```
  */5 * * * * cv api --user=www-data job.execute
  
  ```
  
  ...as per instructions related to this error.
  
  The Civi error is persisting. Also, cv, unexpectedly to me, returns HTML as output at the command line, e.g.
  
  ```
  foo@bar  sudo cv ext:list
  
  ```
  
  Outputs HTML, counterintuitively.
  
  This HTML appears to be the Wordpress site's top page itself (aka a maintenance mode page.
  
  I thought cv with that option would list a bunch of vars, not spit up the site.
  
  Anybody know what's up here?
  
  **Tags:** wordpress, cv
  
  > **Comments:**
  > **username_1**: Do you have a WordPress user named `www-data` or is that the name of the *system* user your webserver/cron run as? If there's no WP user by that name, that could trigger an error when using the `--user` param.  
  > **username_1**: You might be able to scroll through the HTML output looking for an error, or check CiviCRM's debug log for the cause of the problem. See also https://issues.civicrm.org/jira/browse/CRM-20820  
  > **username_0**: I think I need help understanding why I'm even bothering with cv, or why "cron isn't running" when it's absolutely running.  (Crontab entries run fine, tested that using touch /some/file way back at the beginning of this.  Thanks for the note about the user name - I gave it a system user name (www-data) to match Apache's user and I guess I should give it the WP user name.  Will do.  
  > **username_1**: UNIX cron calls CiviCRM's [Scheduled Jobs](https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/#cv) via `cv`. The error message you're seeing is a bit misleading in that regard; ideally it would say *Scheduled Jobs not running* rather than introducing a new term "cron" which has other meanings in the same domain. Scheduled Jobs are discussed in depth at that linked docs page (which I guess you've seen, since you got here already!).  
  > **username_0**: Thanks username_1. Am I seeing expected results with cv?  Meaning, if i run sudo cv ext:list I'm supposed to see the site's top page HTML and nothing else?  
  > **username_1**: Depends what the HTML says? To read that HTML, I would `cv ext:list > out.html` then open out.html in a browser. `sudo cv ext:list` might work, but it might also leave behind files in `templates_c/*` that your system `www-data` user can't overwrite. So I recommend either executing `cv` as the system user `www-data` (easy), or [follow some other process which permits shared file access](https://civicrm.stackexchange.com/questions/2923/civicrm-does-not-have-permission-to-write-temp-files/2931) (complex).  
  > **username_1**: IMO you've run into a place where CiviCRM's admin experience could improve - if those `cv` outputs were clear people would struggle less to configure CiviCRM. IMO cv should not output HTML for you like that, but that's what CiviCRM does for now, hence [CRM-20820](https://issues.civicrm.org/jira/browse/CRM-20820). Would be good to improve on that.  
  
  ---
  
  ## 0 answers
  
  