CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • cron problem
Pages: [1]

Author Topic: cron problem  (Read 2211 times)

Kisoki

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: wp
  • MySQL version: -
  • PHP version: -
cron problem
March 12, 2015, 02:32:14 pm
Hi,

If i use System Settings / Scheduled jobs / by hand to run, it's working and updated the last date field.

If i use the correct url and creditentals in my browser:

http://www.domain.org/wp-content/plugins/civicrm/civicrm/bin/cron.php?name=cronuser&pass=password&key=key

i got a blank page. I read this is it a good sign. But it is not working. It's not add new inbound email to activity and not updated last date field.

How can is solve this?

Kevin Cristiano

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: WordPress
  • MySQL version: 5.6
  • PHP version: 5.6
Re: cron problem
March 12, 2015, 02:35:36 pm
Hi,

I have come across this many time where a plugin throws a fatal error and the process halts with a white screen when run via cron or by manually using the url.   Can you see if there is an entry in the php error_log when you run this?

Kisoki

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: wp
  • MySQL version: -
  • PHP version: -
Re: cron problem
March 13, 2015, 05:23:42 am
Helo,

i got this:

[Fri Mar 13 11:30:22.480115 2015] [access_compat:error] [pid 23785:tid 140718763173632] [client 94.199.180.102:36790] AH01797: client denied by server configuration: /home/szekesfe/domains/domain.org/public_html/wp-content/plugins/files/civicrm/custom/delete-this-aXePLyBi8r
[Fri Mar 13 13:20:55.324517 2015] [fcgid:warn] [pid 15936:tid 140718620497664] [client 84.236.28.143:39273] mod_fcgid: stderr: PHP Warning:  mysqli_error() expects parameter 1 to be mysqli, resource given in /home/szekesfe/domains/domain.org/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 224
[Fri Mar 13 13:20:55.336342 2015] [fcgid:warn] [pid 15936:tid 140718620497664] [client 84.236.28.143:39273] mod_fcgid: stderr: PHP Fatal error:  Call to undefined function is_admin() in /home/szekesfe/domains/domain.org/public_html/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 83


Have you any idea?

Thank you
« Last Edit: March 13, 2015, 05:25:54 am by Kisoki »

Kevin Cristiano

  • I’m new here
  • *
  • Posts: 22
  • Karma: 0
  • CiviCRM version: 4.x
  • CMS version: WordPress
  • MySQL version: 5.6
  • PHP version: 5.6
Re: cron problem
March 13, 2015, 11:53:40 am
I think it is the fatal error here
Code: [Select]
PHP Fatal error:  Call to undefined function is_admin()
That should not happen, do you see that only when running the cron process or is that in your error_logs at other times?

I've not seen errors like this, I've had issues with badly coded plugins, not CiviCRM itself

Kisoki

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: wp
  • MySQL version: -
  • PHP version: -
Re: cron problem
March 14, 2015, 12:59:07 pm
I got this same error on civicrm demo:

http://wp45.demo.civicrm.org/wp-content/plugins/civicrm/civicrm/sql/GenerateData.php

Starting data generation on March 14th 07:55:20 PM Generating Domain Generating Contact Generating Individual Warning: mysqli_error() expects parameter 1 to be mysqli, resource given in /srv/buildkit/build/wp45/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 224 Fatal error: Call to undefined function is_admin() in /srv/buildkit/build/wp45/wp-content/plugins/civicrm/civicrm/CRM/Utils/System/Base.php on line 83

I get this error only when i run the cron.

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: cron problem
March 19, 2015, 09:49:52 pm
A few things:

1. I reproduced the warning about "mysqli_error" and wrote a patch.

2. I reproduced and examined the error about is_admin when running GenerateData.php. GenerateData.php hits a SQL error and tries to display the SQL error as a pretty web-page, but - while formatting the error web-page - it encounters a second problem: WordPress hasn't been loaded, so it can't format the web-page. In point of fact, I don't think it would make sense to load WordPress here -- GenerateData.php  is intended to be run on the command-line as part of an automated process (before we ship the code to the site-admins like you). It doesn't make sense to run this script from a web-page at all, and it should frankly be locked down to prevent remote access. So that'll make the bug moot - but it was educational.

3. I could not organically reproduce the problem with "is_admin" in "cron.php". Now, an important thing to know here: the error indicates that WordPress hasn't loaded, but "cron.php" does load WordPress (when it calls "CRM_Utils_System::authenticateScript(TRUE);"). How can this be? Based on the GeneratedData.php experience, here's an educated guess: your system is encountering some *other* error *before* WordPress is loaded.

4. Suggestions:
 - Check the CiviCRM log file (underneath wp-content/plugins/files/civicrm/ConfigAndLog). It may have recorded the true/original error even if it couldn't get printed to the screen.
 - In CRM/Utils/System/Base.php (circa line 83), patch it to degrade gracefully (below) and rerun cron. Hopefully, it will spit out a formatted message with the true/original error.

Code: [Select]
FILE: CRM/Utils/System/Base.php
OLD LINE: if (is_admin()) {
NEW LINE: if (function_exists('is_admin') && is_admin()) {

Kisoki

  • I’m new here
  • *
  • Posts: 4
  • Karma: 0
  • CiviCRM version: 4.5.5
  • CMS version: wp
  • MySQL version: -
  • PHP version: -
Re: cron problem
March 20, 2015, 02:33:16 am
Dear totten,

thank you for your investigation. I made your suggested modification and i get this on the browser after i run the cron url.

DB Error: connect failed

Do you have any ide?

There are in my error log:

[Fri Mar 20 10:25:37.446448 2015] [access_compat:error] [pid 18836:tid 139686619150080] [client 94.199.180.102:34291] AH01797: client denied by server configuration: /home/szekesfe/domains/domain.org/public_html/wp-content/plugins/files/civicrm/upload/delete-this-vdyOMxY1Z6
[Fri Mar 20 10:25:37.969069 2015] [access_compat:error] [pid 18836:tid 139686627542784] [client 94.199.180.102:34293] AH01797: client denied by server configuration: /home/szekesfe/domains/domain.org/public_html/wp-content/plugins/files/civicrm/custom/delete-this-4eJhEdIYBr
[Fri Mar 20 10:31:37.922023 2015] [fcgid:warn] [pid 18836:tid 139686199514880] [client 84.236.6.238:40205] mod_fcgid: stderr: PHP Warning:  mysqli_error() expects parameter 1 to be mysqli, resource given in /home/szekesfe/domains/domain.org/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php on line 224

totten

  • Administrator
  • Ask me questions
  • *****
  • Posts: 695
  • Karma: 64
Re: cron problem
March 23, 2015, 05:45:53 pm
I think those three errors in the log are OK. The first two are expected -- they're part of a behavioral-test to ensure that certain security rules are working. The third one is a warning but shouldn't cause the page to fail.

Those messages look like log entries from the httpd or PHP log. You should look for CiviCRM's log file (underneath wp-content/plugins/files/civicrm/ConfigAndLog).

Also, you might navigate to "Administer => System Settings => Debug". Enable debugging and backtrace. Then the error message "DB Error: connect failed" may print out more details.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • WordPress Installations (Moderators: Kurund Jalmi, Coleman Watts) »
  • cron problem

This forum was archived on 2017-11-26.