Answers.Body: <p>While it's hard to tell without the entire error message it looks like given that the query appears to be an update to a cache table I'd recommend clearing your caches. </p>
  
  <p>drush cc all or via /civicrm/admin/setting/updateConfigBackend?reset=1</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-17T19:51:49.517Z
Answers.LastActivityDate: 2020-02-17T19:51:49.517Z
Answers.UserDisplayName: Luke Stewart
Answers.Body: <p>It happened to me on a website with Drupal and CiviCRM. I had no access to drush. I have done a truncate of the civicrm_cache table, and it has been enough to solve the problem.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2023-03-31T18:27:30.087Z
Answers.LastActivityDate: 2023-03-31T18:27:30.087Z
Answers.UserDisplayName: Francesc Bassas i Bullich
Body: <p>Using Civi 5.20.3
  Contacts are getting an error (DB error: Already Exists) when filling out a profile form. 
  This is what I saw on the Drupal Watchdog. What does it mean? </p>
  
  <p>$Fatal Error Details = Array ( [callback] => Array ( [0] => CRM_Core_Error [1] => handle ) [code] => -5 [message] => DB Error: already exists [mode] => 16 [debug_info] => UPDATE civicrm_cache SET data = .....</p>
  
  <p>created_date = FROM_UNIXTIME(1581961411), expired_date = FROM_UNIXTIME(1581983012) WHERE group_name = "contact-20fields" AND path = "exportableFields All_0_0_0_" [nativecode=1062 ** Duplicate entry 'contact-20fields-exportableFields All_0_0_0_-2020-02-17 11:43:31' for key 'UI_group_path_date'] [type] => DB_Error [user_info] => UPDATE civicrm_cache SET data</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-02-08T15:31:26.093Z
Comments.Text: For what it's worth, this still happens:
      [code] => -5
      [message] => DB Error: already exists
      [mode] => 16
      [debug_info] => UPDATE civicrm_cache SET data = '[SOME DATA HERE]', created_date = FROM_UNIXTIME(1612723665), expired_date = FROM_UNIXTIME(1612745265) WHERE group_name = "contact-20fields" AND path = "custom importableFields 49f393f8cc6aed05fdb0b39c686d1d28" [nativecode=1062 ** Duplicate entry 'contact-20fields-custom importableFields 49f393f8cc6aed05fdb0...' for key 'UI_group_path_date']
  
  This bricked the whole system until cache clear.
Comments.UserDisplayName: Björn Endres
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2023-02-03T11:16:28.727Z
Comments.Text: Got burned by this today :)
Comments.UserDisplayName: michaelmcandrew
Tags: <error>
Title: DB error: Already Exists
ThreadText: # DB error: Already Exists
  
  (Asked by: username_0 on 2020-02-17)
  
  Using Civi 5.20.3
  Contacts are getting an error (DB error: Already Exists) when filling out a profile form.
  This is what I saw on the Drupal Watchdog. What does it mean?
  
  $Fatal Error Details = Array ( [callback] => Array ( [0] => CRM\_Core\_Error [1] => handle ) [code] => -5 [message] => DB Error: already exists [mode] => 16 [debug\_info] => UPDATE civicrm\_cache SET data = .....
  
  created\_date = FROM\_UNIXTIME(1581961411), expired\_date = FROM\_UNIXTIME(1581983012) WHERE group\_name = "contact-20fields" AND path = "exportableFields All\_0\_0\_0\_" [nativecode=1062 \*\* Duplicate entry 'contact-20fields-exportableFields All\_0\_0\_0\_-2020-02-17 11:43:31' for key 'UI\_group\_path\_date'] [type] => DB\_Error [user\_info] => UPDATE civicrm\_cache SET data
  
  **Tags:** error
  
  > **Comments:**
  > **username_1**: For what it's worth, this still happens:     [code] => -5     [message] => DB Error: already exists     [mode] => 16     [debug_info] => UPDATE civicrm_cache SET data = '[SOME DATA HERE]', created_date = FROM_UNIXTIME(1612723665), expired_date = FROM_UNIXTIME(1612745265) WHERE group_name = "contact-20fields" AND path = "custom importableFields 49f393f8cc6aed05fdb0b39c686d1d28" [nativecode=1062 ** Duplicate entry 'contact-20fields-custom importableFields 49f393f8cc6aed05fdb0...' for key 'UI_group_path_date']  This bricked the whole system until cache clear.  
  > **username_2**: Got burned by this today :)  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_3 on 2020-02-17. Score: 1
  
  While it's hard to tell without the entire error message it looks like given that the query appears to be an update to a cache table I'd recommend clearing your caches.
  
  drush cc all or via /civicrm/admin/setting/updateConfigBackend?reset=1
  
  
  ---
  
  ### Answer by username_4 on 2023-03-31. Score: 1
  
  It happened to me on a website with Drupal and CiviCRM. I had no access to drush. I have done a truncate of the civicrm\_cache table, and it has been enough to solve the problem.
  
  
  ---
  
  