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 »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Get DB Error when I try to add New Individual
Pages: [1]

Author Topic: Get DB Error when I try to add New Individual  (Read 2098 times)

asdl

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: WordPress 3.9.1
  • MySQL version: 5.0.10
  • PHP version: 5.4.17
Get DB Error when I try to add New Individual
June 01, 2014, 07:37:07 pm
New Wordpress 3.9.1 install with Civi 4.4.5, can't add New Individual from the Contacts menu - when I go to save the new record, I get
Quote
Sorry but we are not able to provide this at the moment.
DB Error: syntax error

Everythings else seems to be working fine - and I can create New Households and New Organizations.

Steps leading up to this:

Imported about 250 contacts as individuals from a CSV file.

Did an update import from CSV to add five custom fields to those records.

Things looked fine - records were all there, could add them to groups, etc.

Decided some should be households, so permanently deleted one contact and created a household with similar name. In that Household, clicked Relationships>Add Relationship>Member of Household>New Individual.
After filling out the New Individual data, got my first DB Error message.
Tried creating New Individual from Contact menu - same thing.

Switched to TwentyFourteen theme, fearing it might be a theme/plugin issue, but got exactly same problem.

Turned on debugging and trace (in TwentyFourteen), got these results:


backTrace

#0 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(149): CRM_Core_Error::backtrace()#1 [internal function](): CRM_Core_Error::handle(Object(DB_Error))#2 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(931): call_user_func((Array:2), Object(DB_Error))#3 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/DB.php(969): PEAR_Error->PEAR_Error("DB Error: syntax error", -2, 16, (Array:2), "INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 G...")#4 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(564): DB_Error->DB_Error(-2, 16, (Array:2), "INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 G...")#5 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1905): PEAR->raiseError(NULL, -2, NULL, NULL, "INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 G...", "DB_Error", TRUE)#6 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(898): DB_common->raiseError(-2, NULL, NULL, NULL, "1064 ** You have an error in your SQL syntax; check the manual that correspon...")#7 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/DB/mysql.php(327): DB_mysql->mysqlRaiseError()#8 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysql->simpleQuery("INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 G...")#9 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2421): DB_common->query("INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 G...")#10 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1613): DB_DataObject->_query("INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 G...")#11 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(160): DB_DataObject->query("INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 G...")#12 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Dedupe/BAO/RuleGroup.php(254): CRM_Core_DAO->query("INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 G...")#13 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Dedupe/Finder.php(122): CRM_Dedupe_BAO_RuleGroup->fillTable()#14 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Contact.php(1139): CRM_Dedupe_Finder::dupesByParams((Array:3), "Individual", "Supervised", (Array:1))#15 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Contact/Form/Edit/Individual.php(152): CRM_Contact_Form_Contact::checkDuplicateContacts((Array:51), (Array:0), NULL, "Individual")#16 [internal function](): CRM_Contact_Form_Edit_Individual::formRule((Array:51), (Array:1), NULL)#17 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm.php(1598): call_user_func((Array:2), (Array:51), (Array:1), NULL)#18 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(314): HTML_QuickForm->validate()#19 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(135): CRM_Core_Form->validate()#20 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Upload.php(128): CRM_Core_QuickForm_Action_Upload->realPerform(Object(CRM_Contact_Form_Contact), "upload")#21 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Upload->perform(Object(CRM_Contact_Form_Contact), "upload")#22 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Contact_Form_Contact), "upload")#23 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(339): HTML_QuickForm_Page->handle("upload")#24 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Utils/Wrapper.php(117): CRM_Core_Controller->run()#25 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(297): CRM_Utils_Wrapper->run("CRM_Contact_Form_Contact", "New Contact", (Array:1))#26 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(72): CRM_Core_Invoke::runItem((Array:13))#27 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:3))#28 /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm.php(470): CRM_Core_Invoke::invoke((Array:3))#29 [internal function](): CiviCRM_For_WordPress->invoke("")#30 /home/bpoolyc/webapps/bpoolyc_wp/wp-includes/plugin.php(470): call_user_func_array((Array:2), (Array:1))#31 /home/bpoolyc/webapps/bpoolyc_wp/wp-admin/admin.php(211): do_action("toplevel_page_CiviCRM")#32 {main}


Warning: Cannot modify header information - headers already sent by (output started at /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php:456) in/home/bpoolyc/webapps/bpoolyc_wp/wp-includes/option.php on line 747


Warning: Cannot modify header information - headers already sent by (output started at /home/bpoolyc/webapps/bpoolyc_wp/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php:456) in/home/bpoolyc/webapps/bpoolyc_wp/wp-includes/option.php on line 748

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Get DB Error when I try to add New Individual
June 02, 2014, 10:39:36 am
Please enable debugging and try again and post the full error message.
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.

asdl

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: WordPress 3.9.1
  • MySQL version: 5.0.10
  • PHP version: 5.4.17
Re: Get DB Error when I try to add New Individual
June 02, 2014, 11:36:48 am
Code: [Select]

Database Error Code: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)' at line 1, 1064
Additional Details:

Array(    [callback] => Array        (            [0] => CRM_Core_Error            [1] => handle        )    [code] => -2    [message] => DB Error: syntax error    [mode] => 16    [debug_info] => INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)' at line 1]    [type] => DB_Error    [user_info] => INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)' at line 1]    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="INSERT INTO dedupe (id1, id2, weight) SELECT 0 id1, 0 id2, 0 weight LIMIT 0 GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight) [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'GROUP BY id1, id2 ON DUPLICATE KEY UPDATE weight = weight + VALUES(weight)' at line 1]"])
« Last Edit: June 03, 2014, 04:27:59 am by asdl »

Hershel

  • Forum Godess / God
  • I’m (like) Lobo ;)
  • *****
  • Posts: 4640
  • Karma: 176
    • CiviHosting
  • CiviCRM version: Latest
  • CMS version: Mostly WordPress and Drupal
Re: Get DB Error when I try to add New Individual
June 03, 2014, 01:57:19 am
I suggest you file a bug report using the "Issue Tracker" link at the top of this page. Refer to this thread and then post here the link to your bug report there.
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.

asdl

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: WordPress 3.9.1
  • MySQL version: 5.0.10
  • PHP version: 5.4.17
Re: Get DB Error when I try to add New Individual
June 03, 2014, 04:18:46 am
New Bug Report: CRM-14779
https://issues.civicrm.org/jira/browse/CRM-14779

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: Get DB Error when I try to add New Individual
June 03, 2014, 07:00:09 am

In general it helps if you reproduce the error on our demo server before filing an issue

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

asdl

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: WordPress 3.9.1
  • MySQL version: 5.0.10
  • PHP version: 5.4.17
Re: Get DB Error when I try to add New Individual
June 03, 2014, 10:18:17 am
Sorry to post the bug prematurely - I was just following orders    :'(

I spent a chunk of the morning creating a list similar to mine but with random names, emails, phone #s, etc., then doing the exact sequence of import, update, Group creation, contact deletion, Household creation, etc. on the WordPress sandbox installation - and couldn't recreate the error.

So that's good news for Civi, but not so good for me. Any options - or just drop all the Civi tables and restore from previous backups? Or better to do a fresh install?

asdl

  • I’m new here
  • *
  • Posts: 18
  • Karma: 0
  • CiviCRM version: 4.4.5
  • CMS version: WordPress 3.9.1
  • MySQL version: 5.0.10
  • PHP version: 5.4.17
Re: Get DB Error when I try to add New Individual
June 04, 2014, 09:59:26 am
So I've  solved it - had to go through the Civi dedupe table and eliminate an external ID dedupe rule that I somehow saved.

Found that thanks to this Civi support forum link:
http://forum.civicrm.org/index.php?topic=29398.0

When I deleted that dedupe rule, I then got a new error message when trying to add a new individual:
Error Message: Unsupervised rule for Individual does not exist

This forum link solved that problem:
http://forum.civicrm.org/index.php/topic,31205.0.html

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using Core CiviCRM Functions (Moderator: Yashodha Chaku) »
  • Get DB Error when I try to add New Individual

This forum was archived on 2017-11-26.