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 »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • cli cron: Class 'CRM_Utils_System_Drupal' not found
Pages: [1] 2 3

Author Topic: cli cron: Class 'CRM_Utils_System_Drupal' not found  (Read 9056 times)

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
cli cron: Class 'CRM_Utils_System_Drupal' not found
February 17, 2012, 03:48:16 am
I tried to follow instructions on http://wiki.civicrm.org/confluence/display/CRMDOC41/Managing+Scheduled+Jobs

My cron script looks like
Code: [Select]
#!/bin/bash
cd /var/www/sites/all/modules/civicrm
php bin/cli.php -j -u <user> -p <pwd> -e Job -a execute

If I execute the script I get:
Fatal error: Class 'CRM_Utils_System_Drupal' not found in /var/www/sites/all/modules/civicrm/bin/cli.php on line 153

What did I do wrong?
The user and pwd are the same as the old cron script, and are validated.

Drupal 6
Civicrm 4.1

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: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 17, 2012, 06:30:48 am

can u debug the script and see why it is not using

CRM_Utils_System_Drupal6

thanx

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

CatorgHans

  • I post frequently
  • ***
  • Posts: 157
  • Karma: 5
  • CiviCRM version: 4.4
  • CMS version: drupal
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 17, 2012, 07:13:33 am
Not there yet, this is what I found until now:

in $this->_config there is

Code: [Select]
    [userFrameworkClass] => CRM_Utils_System_Drupal6
    [userHookClass] => CRM_Utils_Hook_Drupal6
    [userPermissionClass] => CRM_Core_Permission_Drupal6

while
Code: [Select]
   [userFramework] => Drupal

It looks like it uses the default userFramework from CRM_Core_Config.


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: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 17, 2012, 07:42:47 am
Seems like it reads Drupal6 from the settings file, sets it for a brief period (so userFrameworkClass etc are all valid) and then resets it back to Drupal. So the issue is where is it resetting it and why?

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

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 21, 2012, 08:18:36 am
I'm having the same issue on my upgraded installation.
Is there is issue created for this?

Dave Greenberg

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 5760
  • Karma: 226
    • My CiviCRM Blog
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 21, 2012, 09:17:03 am
http://issues.civicrm.org/jira/browse/CRM-9707
Protect your investment in CiviCRM by  becoming a Member!

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 22, 2012, 12:31:49 am
Thanks,

That was me after searching for it and not finding it.

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 24, 2012, 08:02:59 pm
Actually - ignore that last comment - it wasn't the problem

The problem is that the civicrm_domain.config holds a value for userframework & this is loaded from the DB - overwriting the one in civicrm settings.php.

Options are to fix on upgrade, to fix at some other determined time or not to store in DB

    private function _initVariables()
    {
        // retrieve serialised settings
        require_once "CRM/Core/BAO/ConfigSetting.php";
        $variables = array();
        CRM_Core_BAO_ConfigSetting::retrieve($variables);
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 24, 2012, 08:54:35 pm

we should definitely fix this on upgrade and avoid storing it in the DB

there are a set of variables that we skip storing in DB. We should add this one to that set in:

CRM/Core/BAO/ConfigSetting.php, function skipVars

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

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 24, 2012, 10:38:25 pm
OK - I've committed this against CRM/Core/BAO/ConfigSetting.php

Can those who reported please test that this is sufficient. It doesn't remove the UF setting from the DB but I think it will prevent it being retrieved.

We may still need to remove from the DB.

Code: [Select]
Index: ConfigSetting.php
===================================================================
--- ConfigSetting.php (revision 38893)
+++ ConfigSetting.php (revision 38870)
@@ -621,8 +621,7 @@
 
     static function skipVars( ) {
         return array( 'dsn', 'templateCompileDir',
-                      'userFrameworkDSN',
-                      'userFramework',
+                      'userFrameworkDSN',
                       'userFrameworkBaseURL', 'userFrameworkClass', 'userHookClass',
                       'userPermissionClass', 'userFrameworkURLVar', 'userFrameworkVersion',
                       'newBaseURL', 'newBaseDir', 'newSiteName', 'configAndLogDir',
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

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: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 25, 2012, 09:50:01 am

when the settings are saved the next time (in some cases we do it during upgrade also), that value will automatically get removed.

we dont need to explicitly remove it (or so i think)

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

Carlo Landmeter

  • I post occasionally
  • **
  • Posts: 31
  • Karma: 3
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 25, 2012, 01:59:34 pm
Applied patch and now i get:

Failed to bootstrap CMS

planigan

  • I post occasionally
  • **
  • Posts: 37
  • Karma: 1
    • Allegheny CleanWays
  • CiviCRM version: 4.1.0
  • CMS version: Drupal 6.24
  • MySQL version: 5.0.90
  • PHP version: 5.2.13
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 25, 2012, 02:35:18 pm
Just upgraded today and I'm running into the same issue.

For what it's worth, I also tried two different hacks (not at the same time) to force Drupal6.

1) Manually changing line 152 in cli.php to:

Code: [Select]
$class = 'CRM_Utils_System_Drupal6';
2) Manually editing the serialized UserFramework value in civicrm_domain.config from 's:6:Drupal' to 's:7:Drupal6'

Each of these just results in the "Failed to bootstrap CMS" message as well.
« Last Edit: February 25, 2012, 03:16:30 pm by planigan »

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 25, 2012, 03:16:51 pm
Yes, I think the failed to bootstrap cms means it's getting a bit further but still not quite there...
Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Eileen

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4195
  • Karma: 218
    • Fuzion
Re: cli cron: Class 'CRM_Utils_System_Drupal' not found
February 26, 2012, 02:42:36 pm
OK - there's an early exit in the Drupal 7 file that I've added into drupal 6 file. Try the latest version of CRM_Utils_System_Drupal6

http://issues.civicrm.org/jira/browse/CRM-9707

This seems to have arisen, in part, because simple changes were made to the Drupal 7 file without any checks as to whether they needed to be copied to the D6 file. We should be aware of checking for this in future.

Make today the day you step up to support CiviCRM and all the amazing organisations that are using it to improve our world - http://civicrm.org/contribute

Pages: [1] 2 3
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Installing CiviCRM »
  • CiviMail installation and configuration (Moderator: Donald Lobo) »
  • cli cron: Class 'CRM_Utils_System_Drupal' not found

This forum was archived on 2017-11-26.