2

I have an issue with the database for which I find no solution, even after intensive search on Internet. It now unables me to add a Participant to an Event. And even has consequences on adding Relationship or Memberships. Could you kindly help to solve this? Thanks for your help. Drupal 7.69 CiviCRM 5.21.1

Below are the logs

Feb 28 11:13:28  [error] $Fatal Error Details = Array
(
    [callback] => Array
        (
            [0] => CRM_Core_Error
            [1] => handle
        )

    [code] => -19
    [message] => DB Error: no such field
    [mode] => 16
    [debug_info] => INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , message , entity_table , entity_id ) VALUES ( 509 , 'Array' , '%display_name has created participant.' , 'Participant' ,  1677 )  [nativecode=1054 ** Unknown column 'data' in 'field list']
    [type] => DB_Error
    [user_info] => INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , message , entity_table , entity_id ) VALUES ( 509 , 'Array' , '%display_name has created participant.' , 'Participant' ,  1677 )  [nativecode=1054 ** Unknown column 'data' in 'field list']
    [to_string] => [db_error: message="DB Error: no such field" code=-19 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , message , entity_table , entity_id ) VALUES ( 509 , 'Array' , '%display_name has created participant.' , 'Participant' ,  1677 )  [nativecode=1054 ** Unknown column 'data' in 'field list']"]
)


Feb 28 11:13:28  [debug] $backTrace = #0 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/Error.php(192): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /home/leboucli/activites/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::handle(Object(DB_Error))
#2 /home/leboucli/activites/sites/all/modules/civicrm/packages/DB.php(987): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , m...")
#3 /home/leboucli/activites/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , m...")
#4 /home/leboucli/activites/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , m...", "DB_Error", TRUE)
#5 /home/leboucli/activites/sites/all/modules/civicrm/packages/DB/common.php(1920): PEAR->__call("raiseError", (Array:7))
#6 /home/leboucli/activites/sites/all/modules/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, "INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , m...", "1054 ** Unknown column 'data' in 'field list'")
#7 /home/leboucli/activites/sites/all/modules/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 /home/leboucli/activites/sites/all/modules/civicrm/packages/DB/common.php(1229): DB_mysqli->simpleQuery("INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , m...")
#9 /home/leboucli/activites/sites/all/modules/civicrm/packages/DB/DataObject.php(2416): DB_common->query("INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , m...")
#10 /home/leboucli/activites/sites/all/modules/civicrm/packages/DB/DataObject.php(1040): DB_DataObject->_query("INSERT INTO civicrm_contact_push_notification_messages (contact_id , data , m...")
#11 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/DAO.php(554): DB_DataObject->insert()
#12 /home/leboucli/activites/sites/default/files/civicrm/ext/com.agiliway.civimobileapi/CRM/CiviMobileAPI/BAO/PushNotificationMessages.php(20): CRM_Core_DAO->save()
#13 /home/leboucli/activites/sites/default/files/civicrm/ext/com.agiliway.civimobileapi/CRM/CiviMobileAPI/BAO/PushNotificationMessages.php(40): CRM_CiviMobileAPI_BAO_PushNotificationMessages::add((Array:7))
#14 /home/leboucli/activites/sites/default/files/civicrm/ext/com.agiliway.civimobileapi/CRM/CiviMobileAPI/PushNotification/SaveMessageHelper.php(29): CRM_CiviMobileAPI_BAO_PushNotificationMessages::create((Array:7))
#15 /home/leboucli/activites/sites/default/files/civicrm/ext/com.agiliway.civimobileapi/CRM/CiviMobileAPI/PushNotification/Utils/BasePushNotificationManager.php(59): CRM_CiviMobileAPI_PushNotification_SaveMessageHelper::saveMessages((Array:1), 1677, "Participant", "Soirée Dansante Mars 2020", "%display_name has created participant.", (Array:3))
#16 /home/leboucli/activites/sites/default/files/civicrm/ext/com.agiliway.civimobileapi/civimobileapi.php(332): CRM_CiviMobileAPI_PushNotification_Utils_BasePushNotificationManager->sendNotification()
#17 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Utils/Hook.php(298): civimobileapi_civicrm_post("create", "Participant", 1677, Object(CRM_Event_BAO_Participant))
#18 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Utils/Hook/DrupalBase.php(74): CRM_Utils_Hook->runHooks((Array:72), "civicrm_post", 4, "create", "Participant", 1677, Object(CRM_Event_BAO_Participant), NULL, NULL)
#19 /home/leboucli/activites/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(98): CRM_Utils_Hook_DrupalBase->invokeViaUF(4, "create", "Participant", 1677, Object(CRM_Event_BAO_Participant), NULL, NULL, "civicrm_post")
#20 /home/leboucli/activites/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(184): Civi\Core\CiviEventDispatcher::delegateToUF(Object(Civi\Core\Event\PostEvent), "hook_civicrm_post", Object(Civi\Core\CiviEventDispatcher))
#21 /home/leboucli/activites/sites/all/modules/civicrm/vendor/symfony/event-dispatcher/EventDispatcher.php(46): Symfony\Component\EventDispatcher\EventDispatcher->doDispatch((Array:2), "hook_civicrm_post", Object(Civi\Core\Event\PostEvent))
#22 /home/leboucli/activites/sites/all/modules/civicrm/Civi/Core/CiviEventDispatcher.php(47): Symfony\Component\EventDispatcher\EventDispatcher->dispatch("hook_civicrm_post", Object(Civi\Core\Event\PostEvent))
#23 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Utils/Hook.php(392): Civi\Core\CiviEventDispatcher->dispatch("hook_civicrm_post", Object(Civi\Core\Event\PostEvent))
#24 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Event/BAO/Participant.php(129): CRM_Utils_Hook::post("create", "Participant", 1677, Object(CRM_Event_BAO_Participant))
#25 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Event/BAO/Participant.php(181): CRM_Event_BAO_Participant::add((Array:15))
#26 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Event/Form/Registration.php(853): CRM_Event_BAO_Participant::create((Array:15))
#27 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Event/Form/Registration.php(695): CRM_Event_Form_Registration::addParticipant(Object(CRM_Event_Form_Registration_Confirm), "509")
#28 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Event/Form/Registration/Confirm.php(637): CRM_Event_Form_Registration->confirmPostProcess("509", NULL)
#29 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/Form.php(479): CRM_Event_Form_Registration_Confirm->postProcess()

#30 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
#31 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(45): CRM_Core_StateMachine->perform(Object(CRM_Event_Form_Registration_Confirm), "next", "Next")
#32 /home/leboucli/activites/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Event_Form_Registration_Confirm), "next")
#33 /home/leboucli/activites/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Event_Form_Registration_Confirm), "next")
#34 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/Controller.php(335): HTML_QuickForm_Page->handle("next")
#35 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/Invoke.php(268): CRM_Core_Controller->run((Array:3), NULL)
#36 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:15))
#37 /home/leboucli/activites/sites/all/modules/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
#38 /home/leboucli/activites/sites/all/modules/civicrm/drupal/civicrm.module(456): CRM_Core_Invoke::invoke((Array:3))
#39 /home/leboucli/activites/includes/menu.inc(527): civicrm_invoke("event", "register")
#40 /home/leboucli/activites/index.php(21): menu_execute_active_handler()
#41 {main}

[SOLVED] This issue was solved by installing a new extension, as Jon G - Megaphone Tech suggests below. Thanks @Jon G - Megaphone Tech for the very useful help.

4

This error is related to the CiviMobile extension - you can see it mentioned in the backtrace, and the table with the error, civicrm_contact_push_notification_messages, is created by the CiviMobile extension.

The error is that there's a field in that database table which is missing called data. I can see from the CiviMobile source code that this field was added with Version 5.0. Is it possible that you installed the upgrade but didn't run the database upgrade? Go to Administer menu » Administration Console » System Status and see if there's a message telling you to run the database upgrades.

If the database upgrade ran but failed, you might be in your current situation. In that case, you'll need to run the following query on your MySQL database. I copied the query from the link above, which is the upgrade code.

ALTER TABLE civicrm_contact_push_notification_messages ADD data varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL

UPDATE: Based on the comments below, it seems clear that the issue is with log_civicrm_contact_push_notification_messages, not civicrm_contact_push_notification_messages. This is a bug in the CiviMobile upgrade routine (though a common one). The trick is to run CRM_Logging_Schema->fixSchemaDifferences. The easiest way to do this is to install or enable an extension that's not currently installed; you can uninstall it immediately afterward.

| improve this answer | |
  • Thanks @Jon G - Megaphone Tech for your quick answer. I had a look at the SQL table and the Data field is allready there. Nevertheless I ran the SQL command. But it just confirmed that the field is existing. Requête SQL : ALTER TABLE civicrm_contact_push_notification_messages ADD data varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL MySQL a répondu : Documentation #1060 - Nom du champ 'data' déjà utilisé What can I look at now to try and solve this issue ? – Webmaster du Bouclier Mar 2 at 20:32
  • @WebmasterduBouclier Do you have advanced logging turned on? If so, can you see if log_civicrm_contact_push_notification_messagesis missing the data field? – Jon G - Megaphone Tech Mar 2 at 22:29
  • Hi @Jon G - Megaphone Tech. I ran the following SQL command show create table log_civicrm_contact_push_notification_messages Here's the result : – Webmaster du Bouclier Mar 3 at 17:59
  • CREATE TABLE `log_civicrm_contact_push_notification_messages` ( `id` int(10) unsigned DEFAULT NULL, `contact_id` int(10) unsigned DEFAULT NULL, `message` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_table` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `entity_id` int(11) DEFAULT NULL, `send_date` timestamp NULL DEFAULT NULL, `is_read` tinyint(4) DEFAULT '0', `invoke_contact_id` int(10) unsigned DEFAULT NULL, `message_title` varchar(255) COLLATE utf8_unicode_ci DEFAULT NULL, `log_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, – Webmaster du Bouclier Mar 3 at 17:59
  • `` log_conn_id varchar(17) COLLATE utf8_unicode_ci DEFAULT NULL, log_user_id int(11) DEFAULT NULL, log_action enum('Initialization','Insert','Update','Delete') COLLATE utf8_unicode_ci DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci`` – Webmaster du Bouclier Mar 3 at 17:59

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.