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 »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Weird dedupe / record entry error (resolved)
Pages: [1]

Author Topic: Weird dedupe / record entry error (resolved)  (Read 841 times)

CityBloc

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.2
  • MySQL version: 5.5.37
  • PHP version: 5.3.10
Weird dedupe / record entry error (resolved)
June 02, 2014, 08:46:47 am
Hi:

In the regular course of data entry (some records by hand, some imports) we've seen a weird MySQL error kick out all new records entered by hand.  The error was not prefaced by any usual suspects - no upgrades to WordPress or MySQL, no config changes. 

The error reads:

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]"]

Any help greatly appreciated.
« Last Edit: June 02, 2014, 01:48:34 pm by CityBloc »

CityBloc

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.2
  • MySQL version: 5.5.37
  • PHP version: 5.3.10
Re: Weird record entry error
June 02, 2014, 10:09:40 am
So I think there's a dedupe rule on individual contacts that was created by a data entry person because I don't recognize it.

Rule name: Name

Supervised

Reserved

If I use it here: 

/wp-admin/admin.php?page=CiviCRM&q=civicrm/contact/dedupefind&reset=1&action=update&rgid=8


...I get the identical error I get during record entry.

No other rules produce any errors.  So I think I'd like to get rid of it, but how - there's no delete link.

Thanks.

« Last Edit: June 02, 2014, 10:14:34 am by CityBloc »

CityBloc

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.2
  • MySQL version: 5.5.37
  • PHP version: 5.3.10
Re: Weird record entry error
June 02, 2014, 10:27:36 am
Looking further,  I can see the value in the table civicrm_dedupe_rule_group. 

I can restore the rule to unreserved if I simply change the errant rule's record is_reserved field to 0, BUT are there any unintended consequences?

Thanks.

CityBloc

  • I post occasionally
  • **
  • Posts: 38
  • Karma: 0
  • CiviCRM version: 4.4.6
  • CMS version: WordPress 3.9.2
  • MySQL version: 5.5.37
  • PHP version: 5.3.10
Re: Weird dedupe / record entry error
June 02, 2014, 12:45:37 pm
After poking around the code and grepping for  civicrm_dedupe_rule_group I guessed I could change the value in the DB table without a disaster.  So I did, and it did produce a "delete" link which I used to get rid of the offending rule.

Then adding a new record resulted in the error:

Unsupervised rule for Individual does not exist

Which led me to this thread:

http://forum.civicrm.org/index.php?topic=31205.0

Which suggests building a supervised rule, which I did, using some trivial fields such as Last Name and Birthdate.

After doing that, Civi now accepts records.

So it seems there is a minimum number of 1 for supervised rules for individuals that must exist.  I don't know why.  Anybody?

Thanks.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Post-installation Setup and Configuration (Moderator: Dave Greenberg) »
  • Weird dedupe / record entry error (resolved)

This forum was archived on 2017-11-26.