Answers.Body: <p>Turns out the issue was with captcha on our site. The plugin <a href="https://wordpress.org/plugins/captcha-bws/" rel="nofollow noreferrer">Captcha by BestWebSoft</a> and all other captcha's that I have tested, including Wordfence captcha cause cron error. I found a <a href="https://wordpress.org/plugins/google-captcha/" rel="nofollow noreferrer">captcha plugin</a> that allowed me to restrict registration but not login pages in the mean time.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-04T19:47:37.367Z
Answers.Text: Very interesting. I also had this problem just a couple of days ago. I tried switching to wp-cli and it worked (https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/). I haven't identified the problem, but I had enabled reCaptcha support in the Wordfence plugin recently!
Answers.UserDisplayName: Mark Westergaard
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-06T22:26:31.490Z
Answers.Text: Interesting @MarkWestergaard - its good to know I wasn't alone - I wonder what would have been different.
Answers.UserDisplayName: themak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-07T21:27:15.597Z
Answers.Text: @MarkWestergaard I can confirm - I just enabled wordfence captcha - same thing.
Answers.UserDisplayName: themak
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-07T23:35:47.350Z
Answers.Text: I just remembered that when I was trying to determine why cron wasn't running, I tried the HTTP method from a browser and received an email asking me to verify my login attempt because it was flagged as suspicious. I wonder if that's what's happening to cli,php when cron runs with captcha enabled.
Answers.UserDisplayName: Mark Westergaard
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-04-04T17:13:23.367Z
Answers.LastActivityDate: 2020-04-07T22:42:29.067Z
Answers.LastEditDate: 2020-04-07T22:42:29.067Z
Answers.UserDisplayName: themak
Body: <p>Our cron has worked without issue then all of a sudden it stopped and provided the error: Civi 5.23.3 WP 5.3</p>
  
  <p>When the cron runs - I get the following:
  ERROR: Invalid username and/or password</p>
  
  <p>My cron is as follows:
  <code>/usr/local/bin/php.cli -q /home/tarabnyc/www/www/wp-content/plugins/civicrm/civicrm/bin/cli.php -u username -p password -e Job -a execute</code></p>
  
Tags: <wordpress><cron><cron-job>
Title: Cron ERROR: Invalid username and/or password (Wordpress)
ThreadText: # Cron ERROR: Invalid username and/or password (Wordpress)
  
  (Asked by: username_0 on 2020-04-04)
  
  Our cron has worked without issue then all of a sudden it stopped and provided the error: Civi 5.23.3 WP 5.3
  
  When the cron runs - I get the following:
  ERROR: Invalid username and/or password
  
  My cron is as follows:
  `/usr/local/bin/php.cli -q /home/tarabnyc/www/www/wp-content/plugins/civicrm/civicrm/bin/cli.php -u username -p password -e Job -a execute`
  
  **Tags:** wordpress, cron, cron-job
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2020-04-04. Score: 1 | Accepted answer
  
  Turns out the issue was with captcha on our site. The plugin [Captcha by BestWebSoft](https://wordpress.org/plugins/captcha-bws/) and all other captcha's that I have tested, including Wordfence captcha cause cron error. I found a [captcha plugin](https://wordpress.org/plugins/google-captcha/) that allowed me to restrict registration but not login pages in the mean time.
  
  > **Comments:**
  > **username_1**: Very interesting. I also had this problem just a couple of days ago. I tried switching to wp-cli and it worked (https://docs.civicrm.org/sysadmin/en/latest/setup/jobs/). I haven't identified the problem, but I had enabled reCaptcha support in the Wordfence plugin recently!  
  > **username_0**: Interesting @username_1 - its good to know I wasn't alone - I wonder what would have been different.  
  > **username_0**: @username_1 I can confirm - I just enabled wordfence captcha - same thing.  
  > **username_1**: I just remembered that when I was trying to determine why cron wasn't running, I tried the HTTP method from a browser and received an email asking me to verify my login attempt because it was flagged as suspicious. I wonder if that's what's happening to cli,php when cron runs with captcha enabled.  
  
  ---
  
  