Opening this as an offshoot of #1825018: CiviCRM 4.2 and higher require more SQL privileges than past versions or binary logging disabled
Migrations are failing with the following error:
Drush command terminated abnormally due to an unrecoverable error. Error: Cannot redeclare class CRM_Core_ClassLoader in
/. . . /sites/all/modules/civicrm/CRM/Core/ClassLoader.php, line 36
Setups tested so far that have given the error:
D7.15 + Civi 4.2.1 to D7.15 + Civi 4.2.2
D7.17 + Civi 4.2.6 to D7.17 + Civi 4.2.6
D7.14 + Civi 4.2.2 to D7.18 + Civi 4.2.6
D7.15 + Civi 4.2.1 to D7.19 + Civi 4.2.7
D7.15 + Civi 4.2.7 to D7.19 + Civi 4.2.7
I've test the last setup with binary logging and redis disabled but still received the error.
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | 1907884-provision_civicrm_debugsettings-civicrm427.patch | 1021 bytes | bgm |
| #3 | provision_civicrm_debugsettings.patch | 996 bytes | bgm |
Comments
Comment #1
bgm commentedI modified the tests to install php5-xdebug, so that we can get a backtrace:
Comment #2
bgm commentedI think the best way to debug this, would be to apply a patch to the civicrm.settings.php *template* in CiviCRM (via makefile), so that it outputs the values of $civicrm_root and the $include_path.
This type of error has come up now and again, so it will be useful to have it automated to debug it easily in future versions.
Comment #3
bgm commentedHere is a patch for the civicrm.settings.php template, so that we can have more debug information when running tests.
Attaching it here, so that I can refer to it from the tests makefile.
Comment #4
bgm commentedPatch should use drush_log() with 'ok' to be vislble.. new patch attached.
Comment #5
bgm commentedI committed a patch that uses the provision_deploy() hook to regenerate the civicrm.settings.php file earlier.
The backtrace incidates that in the post_provision hook for drupal, it flushes the cache. Since CiviCRM 4.2, clearning the cache invokes some user hook that then tries to initialize CiviCRM, hence the error, since the civicrm.settings.php was still pointing to the old platform.
I can the tests and it seems to work. Also added tests on CiviCRM 4.3 alpha.
Can someone who had the error please confirm if it solves their issue as well? (if not, install php5-xdebug in order to get a backtrace)
Comment #6
urlisse commentedI pulled the latest provision_civicrm version from git and I no longer receive the "Cannot redeclare class CRM_Core_ClassLoader" error during migration on a website that used to fail this operation. It was a D6 site running CiviCRM 4.1.7.
We have a few other sites to migrate. By the end of next week, we should take care of a few other test cases...
Thanks bgm.
Comment #7
bgm commentedComment #8
Poieo commentedThis release has solved the issue for me as well.