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 »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Cron difficulties
Pages: [1]

Author Topic: Cron difficulties  (Read 1190 times)

neherp

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
Cron difficulties
December 08, 2013, 07:40:25 pm
OK, I am feeling terribly thick at the moment.  I've been trying to get the cron job working on a CiviCRM 4.4.3 installation, and I'm getting nowhere. 

I hope someone can point me in the right direction.....

To simplify things, I am doing all testing on barebones installs, and trying to start the cron job using the url method.  To further simplify, I have enabled only the Update Membership Statuses scheduled job.  Job runs manually from the Settings - Scheduled Jobs screen.

Attempt #1:

Joomla! 3.2 with no addon components, modules, or plugins, just Joomla! and CiviCRM 4.4.3.
I have configured only one Administrator user on Joomla!, and am using that for all testing.

URL attempted:
http://[SITEROOT]/administrator/components/com_civicrm/civicrm/bin/cron.php?name=username&pass=password&key=site-key

username and password work perfectly for admin access to site, and site-key is confirmed to be as entered in civicrm.settings.php.

URL always returns:
ERROR: Invalid username and/or password

If I put the wrong site-key in the URL, I do receive a wrong key error.  As long as that is correct, no matter what I put in the user / password fields, I receive the same Invalid username and/or password error. 


Since so many more posts / users are operating on Drupal, I decided to try a Drupal 7 install, in hopes I might have better luck.....

Attempt #2:

Drupal 7.24 with no added modules beyond CiviCRM 4.4.3.  Again, there is only one user defined, an all access admin user.

http://[SITEROOT]/sites/all/modules/civicrm/bin/cron.php?name=username&pass=password&key=site-key 

In this case, any inaccurate entry in username, password, or site-key return the expected error.  Unfortunately, when all entries are correct, all I get is a white screen in response.  There is no report of the cron job starting in the logs.  The job just silently stops.

I figure I must be missing some crucial part of the initial setup, but I can't seem to sort it out.

Any assistance is greatly appreciated!

Cheers,
Mike

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Cron difficulties
December 09, 2013, 06:14:08 am
Your Attempt #2: is correct. A blank white screen is the expected output. :)
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

neherp

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
Re: Cron difficulties
December 09, 2013, 08:11:10 am
Thanks for the response, but I'm still confused...If the cron job was working correctly, wouldn't the Last Run field update in Scheduled Jobs screen?  Or is that only an indication that the job was manually run? 

I am seeing no entry in the scheduled jobs log either.

Cheers,
Mike

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Cron difficulties
December 09, 2013, 08:17:39 am
Yes, you are correct--those data should be updated. Perhaps put an echo statement in cron.php to make sure it is being executed properly.
CiviHosting and CiviOnline -- The CiviCRM hosting experts, since 2007

See here for the official: What to do if you think you've found a bug.

neherp

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
Re: Cron difficulties
December 09, 2013, 05:45:31 pm
Good thought. 

Since Joomla! is my preferred CMS, I've switched back to my original configuration for troubleshooting, and have added a bunch of echo commands to the cron.php file.

Current environment is Joomla! 3.1.5, CiviCRM 4.4.3.

cron.php contents:
echo "Step 1";
require_once '../civicrm.config.php';
echo "Step 2";
require_once 'CRM/Core/Config.php';
echo "Step 3";
require_once 'CRM/Utils/Request.php';
echo "Step 4";
$config = CRM_Core_Config::singleton();
echo "Step 5";
CRM_Utils_System::authenticateScript(TRUE);
echo "Step 6";
....


When I run, I receive echo responses through Step 5.  CRM_Utils_System::authenticateScript(TRUE).


I then moved my attention to the Joomla.php file in CRM/Utils/System.  Placing echo statements that file shows the script running to the following point:

.....
  function authenticate($name, $password, $loadCMSBootstrap = FALSE) {
    require_once 'DB.php';

    $config = CRM_Core_Config::singleton();

    if ($loadCMSBootstrap) {
      $bootStrapParams = array();
      if ($name && $password) {
        $bootStrapParams = array(
          'name' => $name,
          'pass' => $password,
        );
      }
      CRM_Utils_System::loadBootStrap($bootStrapParams, TRUE, TRUE, FALSE);
    }

    jimport('joomla.application.component.helper');
    jimport('joomla.database.table');

echo "Jooma.php Check 1";

    $JUserTable = JTable::getInstance('User', 'JTable');

echo "Joomla.php Check 2";
.....

Script echos Step 1, but not step 2.

JTable::getInstance('User', 'JTable'); seems to be the culprit.  I don't quite understand what this is doing.  I'm only finding documentation on this Class for J!1.5 and J!2.5, nothing for J!3. 

Can y'all help me to sort out what this is doing, or not doing as the case may be?

Cheers,
Mike
« Last Edit: December 10, 2013, 04:58:27 am by neherp »

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Cron difficulties
December 10, 2013, 06:51:15 am

in J! 3.2, i see the definition here: libraries/joomla/table/table.php

not sure if that interface has changed between J! 2.5 / 3.1 / 3.2 but if so, might want to check what the new way should be and submit a patch

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

neherp

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
Re: Cron difficulties
December 10, 2013, 04:08:48 pm
Here's the info from the API for various versions of Joomla!

J! 1.5
& getInstance($type, $prefix= 'JTable', $config=array())

J! 2.5
getInstance(string $type, string $prefix = 'JTable', array $config = array()) : mixed

J! 3.x
getInstance(string $type, string $prefix = 'JTable', array $config = array()) : mixed

I don't really know what to do with this info....Any help out there?

Cheers,
Mike

jern

  • I post occasionally
  • **
  • Posts: 46
  • Karma: 0
    • SEN Magazine
  • CiviCRM version: 4.5.8
  • CMS version: Joomla 2.5.28
  • MySQL version: 5.5.40
  • PHP version: 5.4.33
Re: Cron difficulties
December 22, 2013, 10:58:49 pm
Did you find a solution? I'm having the same problem, with the same setup (Joomla 3.2, Civi 4.4.3). Whatever I do, it refuses to authenticate, and gives the ERROR: Invalid username and/or password response.

neherp

  • I’m new here
  • *
  • Posts: 10
  • Karma: 0
Re: Cron difficulties
December 26, 2013, 07:40:51 am
No, I'm still plugging away at this.  I've figured out a few things, but am still not able get this to work.

First, while I can't tell you exactly why, the jump from Joomla! 3.1.5 to 3.2 did help.  In reading other similar posts, it appears that there may have been a problem with the Joomla! version check, resulting in the Joomla! framework not loading, which caused a failure whenever getInstance was called.  Upgrading to 3.2 or 3.2.1 resolved that problem.

The current sticking point seems to be the new password scheme in Joomla! 3.2, which now defaults to "strong passwords", which has a different hashing scheme.  Because of this, the check of the password from the URL cron entry against the database entry for the user fails.

I see where it's going wrong, but I am not code competent to a level where I can sort out the changes that need to be made to make this work.

I'm surprised there aren't more people clamoring for this, as it appears that it is impossible for anyone to run scheduled crons with any Joomla! 3 installation.

If there is anyone with the expertise to dig into the joomla.php code to deal with the new Joomla! password scheme, they would certainly receive my undying gratitude!

Cheers,
Mike

Jeremy Proffitt

  • I post occasionally
  • **
  • Posts: 63
  • Karma: 2
    • Mobius New Media
  • CiviCRM version: 4.4.x
  • CMS version: Joomla 2.5.x/3.x / D7
  • MySQL version: 5.1.x
  • PHP version: 5.3.10+, 5.4.x
Re: Cron difficulties
January 28, 2014, 04:22:23 pm
I submitted a pull request for this, which scheduled to appear in 4.5. See http://issues.civicrm.org/jira/browse/CRM-14140.

 - CRM_Utils_System_Joomla::authenticate() has a number of changes, but the hash comparison is now done using JUserHelper::verifyPassword($plaintext, $hash, $userid).

- civicrm/bin/cli.class.php was redundantly requiring CRM_Core_ClassLoader.

- CRM_Utils_Hooks_Joomla required the new jimport path for JPluginHelper (cms.plugin.helper).
Jeremy Proffitt
Mobius New Media
IRC: JP_EzoD

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Cron difficulties

This forum was archived on 2017-11-26.