1

I've installed CiviCRM 4.6.4 on my WordPress site. But on admin.php page, I get a message box warning me that "New codebase version detected. You might want to visit upgrade screen to upgrade the database."

I visit the upgrade screen which invites me to "Use this utility to upgrade your CiviCRM database from 4.4.6 to 4.6.4."

Doing this produces a series of error messages and corrupts the database:

[Error: Migrate honoree information to module_data]
Error Field Error Value
Type    DB_Error
Code    -1
Message DB Error: unknown error
Mode    16
UserInfo    ALTER TABLE `civicrm_uf_join` ADD COLUMN `module_data` longtext COMMENT 'Json serialized array of data used by the ufjoin.module' [nativecode=1060 ** Duplicate column name 'module_data']
DebugInfo   ALTER TABLE `civicrm_uf_join` ADD COLUMN `module_data` longtext COMMENT 'Json serialized array of data used by the ufjoin.module' [nativecode=1060 ** Duplicate column name 'module_data']
PEAR_Exception: DB Error: unknown error in unknown on line unknown
- DB_Error: DB Error: unknown error in unknown on line unknown

Exception trace

#   Function    Location
0   CRM_Core_Error::exceptionHandler(Object(DB_Error))  unknown:unknown
1   call_user_func(Array, Object(DB_Error)) /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/PEAR.php:931
2   PEAR_Error->PEAR_Error('DB Error: unknow…', -1, 16, Array, 'ALTER TABLE `civ…') /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/DB.php:976
3   DB_Error->DB_Error(-1, 16, Array, 'ALTER TABLE `civ…')  /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/PEAR.php:564
4   PEAR->raiseError(null, -1, null, null, 'ALTER TABLE `civ…', 'DB_Error', true)   /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/DB/common.php:1905
5   DB_common->raiseError(-1, null, null, null, '1060 ** Duplicat…')    /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php:899
6   DB_mysql->mysqlRaiseError() /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php:328
7   DB_mysql->simpleQuery('ALTER TABLE `civ…')  /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/DB/common.php:1216
8   DB_common->query('ALTER TABLE `civ…')   /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:2442
9   DB_DataObject->_query('ALTER TABLE `civ…')  /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php:1634
10  DB_DataObject->query('ALTER TABLE `civ…')   /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:325
11  CRM_Core_DAO->query('ALTER TABLE `civ…', true)  /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php:1179
12  CRM_Core_DAO::executeQuery('ALTER TABLE `civ…') /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Upgrade/Incremental/php/FourFive.php:265
13  CRM_Upgrade_Incremental_php_FourFive::migrateHonoreeInfo(Object(CRM_Queue_TaskContext)) unknown:unknown
14  call_user_func_array(Array, Array)  /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Queue/Task.php:88
15  CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))  /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Queue/Runner.php:213
16  CRM_Queue_Runner->runNext(true) /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php:52
17  CRM_Queue_Page_AJAX::{closure}()    /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Queue/ErrorPolicy.php:106
18  CRM_Queue_ErrorPolicy->call(Object(Closure))    /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Queue/Page/AJAX.php:54
19  CRM_Queue_Page_AJAX::runNext()  unknown:unknown
20  call_user_func(Array)   /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:278
21  CRM_Core_Invoke::runItem(Array) /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:86
22  CRM_Core_Invoke::_invoke(Array) /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php:54
23  CRM_Core_Invoke::invoke(Array)  /home/coventry/public_html/wpsite/wp-content/plugins/civicrm/civicrm.php:1189
24  CiviCRM_For_WordPress->invoke('')   unknown:unknown
25  call_user_func_array(Array, Array)  /home/coventry/public_html/wpsite/wp-includes/plugin.php:496
26  do_action('toplevel_page_Ci…')  /home/coventry/public_html/wpsite/wp-admin/admin.php:226
27  {main}

Can anyone point me in the direction of working out what's going on?

Many thanks,

David

3

On a fresh install, this should not be required. The reply below is suitable for a site which is seeing this error during an expected upgrade.


In CRM/Upgrade/Incremental/php/FourFive.php (or an included .sql file from there) is an instruction to add a new column to civicrm_uf_join

Your DB already contains this column, so CiviCRM runs into trouble when it tries to add it again.

Go back to as pristine a copy of the 4.4 DB as you can, and ensure that column (civicrm_uf_join.module_data) does not exist, removing it if it does. Then, re-run the upgrader.

Running upgrades twice on a DB will lead to these sorts of errors, but sometimes applying a patch on a site before upgrade will mean that your DB changes are already applied and need to be eliminated from the following upgrade.

  • This is very helpful - thank you. I'm perplexed as to why a brand new installation of 4.6.4 thought it had a 4.4.6 database. Anyway, what I have done in the meantime is to uninstall 4.6.4 and install 4.4.16 instead. When I'm feeling brave - or foolhardy! - I'll try upgrading... – David Stone Jul 6 '15 at 5:05
  • Looking again at your description - I wonder if somehow your CiviCRM has a typo in the civicrm_domain table, reporting 4.4.6 instead of 4.6.4. That would be unfortunate, but it seems plausible. Could someone have directly edited the DB? – Chris Burgess Jul 6 '15 at 5:09
  • Yes, I agree, a typo seems plausible. But no-one at this end would have edited the database directly. Is it an error in the original download that no-one has noticed? Can I be the only person who has tried to install 4.6.4 into the WordPress environment?! – David Stone Jul 6 '15 at 12:54
1

Since this is a brand-new install, there is no need to run upgrades, and attempting to upgrade a 4.6.4 site as if it were 4.4.6 is going to cause errors as you observed.

You could fix this by editing your civicrm_domain sql table to contain the correct version number (look for "4.4.6" and change it to 4.6.4").

As for what caused the problem, it's a mystery to me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.