Answers.Body: <p>I just encountered this and solved it.</p>
  
  <p>I've opened a ticket <a href="https://issues.civicrm.org/jira/browse/CRM-18264" rel="nofollow">CRM-18264</a> to address this issue, and I've submitted a pull request for both 4.6LTS and 4.7.  They've been merged, so you just need to upgrade to CiviCRM 4.6.15+ or CiviCRM 4.7.5+.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-22T15:52:37.973Z
Answers.Text: Thank you, Jon! I'm trying it tonight after business hours have ended for the client and I'll let you know if it worked for me. Much appreciated.
Answers.UserDisplayName: Barbara Forbes-Lyons
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-03-18T20:09:26.120Z
Answers.LastActivityDate: 2016-08-15T22:44:32.070Z
Answers.LastEditDate: 2016-08-15T22:44:32.070Z
Answers.UserDisplayName: Jon G - Megaphone Tech
Body: <p>CiviCRM 4.6.11 to 4.7.1 Update
  Joomla 3.4.8</p>
  
  <p>Error page during DB upgrade utility:</p>
  
  <pre><code>[Error: Add Getting Started dashlet]
  
  Error Field
  Error Value
  Type
  DB_Error
  Code
  -3
  Message
  DB Error: constraint violation
  Mode  16
  UserInfo
  INSERT INTO `civicrm_dashboard_contact` (dashboard_id, contact_id, column_no, is_active) SELECT (SELECT MAX(id) FROM `civicrm_dashboard`), contact_id, 0, IF (SUM(is_active) &gt; 0, 1, 0) FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`famcafe_sandbox`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
  
  DebugInfo
  
  INSERT INTO `civicrm_dashboard_contact` (dashboard_id, contact_id, column_no, is_active) SELECT (SELECT MAX(id) FROM `civicrm_dashboard`), contact_id, 0, IF (SUM(is_active) &gt; 0, 1, 0) FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`famcafe_sandbox`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
  
  PEAR_Exception: DB Error: constraint violation in unknown on line unknown
  - DB_Error: DB Error: constraint violation 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/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php:931
  2 PEAR_Error-&gt;PEAR_Error('DB Error: constr…', -3, 16, Array, 'INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB.php:976
  3 DB_Error-&gt;DB_Error(-3, 16, Array, 'INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php:564
  4  PEAR-&gt;raiseError(null, -3, null, null, 'INSERT INTO `civ…', 'DB_Error', true)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php:1905
  5  DB_common-&gt;raiseError(-3, null, null, null, '1452 ** Cannot a…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php:895
  6  DB_mysql-&gt;mysqlRaiseError()
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php:328
  7  DB_mysql-&gt;simpleQuery('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php:1216
  8  DB_common-&gt;query('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php:2435
  9  DB_DataObject-&gt;_query('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php:1627
  10  DB_DataObject-&gt;query('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php:334
  11  CRM_Core_DAO-&gt;query('INSERT INTO `civ…', true)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php:1267
  12  CRM_Core_DAO::executeQuery('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/php/FourSeven.php:272
  13  CRM_Upgrade_Incremental_php_FourSeven::addGettingStartedDashlet(Object(CRM_Queue_TaskContext), '4.7.alpha1')
  unknown:unknown
  14  call_user_func_array(Array, Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Task.php:88
  15  CRM_Queue_Task-&gt;run(Object(CRM_Queue_TaskContext))
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Runner.php:214
  16  CRM_Queue_Runner-&gt;runNext(true)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php:52
  17  CRM_Queue_Page_AJAX::{closure}()
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/ErrorPolicy.php:106
  18  CRM_Queue_ErrorPolicy-&gt;call(Object(Closure))
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php:54
  19  CRM_Queue_Page_AJAX::runNext()
  unknown:unknown
  20  call_user_func(Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:278
  21  CRM_Core_Invoke::runItem(Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:86
  22  CRM_Core_Invoke::_invoke(Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:54
  23  CRM_Core_Invoke::invoke(Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm.php:116
  24  civicrm_invoke()
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm.php:40
  25  require_once('/home/famcafe/pu…')
  /home/famcafe/public_html/libraries/cms/component/helper.php:392
  26  JComponentHelper::executeComponent('/home/famcafe/pu…')
  /home/famcafe/public_html/libraries/cms/component/helper.php:372
  27  JComponentHelper::renderComponent('com_civicrm')
  /home/famcafe/public_html/libraries/cms/application/administrator.php:98
  28  JApplicationAdministrator-&gt;dispatch()
  /home/famcafe/public_html/libraries/cms/application/administrator.php:152
  29  JApplicationAdministrator-&gt;doExecute()
  /home/famcafe/public_html/libraries/cms/application/cms.php:252
  30  JApplicationCms-&gt;execute()
  /home/famcafe/public_html/administrator/index.php:47
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-02-08T15:33:49.373Z
Comments.Text: for whatever it is worth, I tried s smaller increment to 4.6.12 and the same error occurred.
Comments.UserDisplayName: Barbara Forbes-Lyons
Tags: <upgrade><database><dashlet><error-page>
Title: DB Upgrade Fails when creating Getting Started Dashlet
ThreadText: # DB Upgrade Fails when creating Getting Started Dashlet
  
  (Asked by: username_0 on 2016-02-04)
  
  CiviCRM 4.6.11 to 4.7.1 Update
  Joomla 3.4.8
  
  Error page during DB upgrade utility:
  
  ```
  [Error: Add Getting Started dashlet]
  
  Error Field
  Error Value
  Type
  DB_Error
  Code
  -3
  Message
  DB Error: constraint violation
  Mode  16
  UserInfo
  INSERT INTO `civicrm_dashboard_contact` (dashboard_id, contact_id, column_no, is_active) SELECT (SELECT MAX(id) FROM `civicrm_dashboard`), contact_id, 0, IF (SUM(is_active) > 0, 1, 0) FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`famcafe_sandbox`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
  
  DebugInfo
  
  INSERT INTO `civicrm_dashboard_contact` (dashboard_id, contact_id, column_no, is_active) SELECT (SELECT MAX(id) FROM `civicrm_dashboard`), contact_id, 0, IF (SUM(is_active) > 0, 1, 0) FROM `civicrm_dashboard_contact` WHERE 1 GROUP BY contact_id [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (`famcafe_sandbox`.`civicrm_dashboard_contact`, CONSTRAINT `FK_civicrm_dashboard_contact_contact_id` FOREIGN KEY (`contact_id`) REFERENCES `civicrm_contact` (`id`) ON DELETE CASCADE)]
  
  PEAR_Exception: DB Error: constraint violation in unknown on line unknown
  - DB_Error: DB Error: constraint violation 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/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php:931
  2 PEAR_Error->PEAR_Error('DB Error: constr…', -3, 16, Array, 'INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB.php:976
  3 DB_Error->DB_Error(-3, 16, Array, 'INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/PEAR.php:564
  4  PEAR->raiseError(null, -3, null, null, 'INSERT INTO `civ…', 'DB_Error', true)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php:1905
  5  DB_common->raiseError(-3, null, null, null, '1452 ** Cannot a…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php:895
  6  DB_mysql->mysqlRaiseError()
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/mysql.php:328
  7  DB_mysql->simpleQuery('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/common.php:1216
  8  DB_common->query('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php:2435
  9  DB_DataObject->_query('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/packages/DB/DataObject.php:1627
  10  DB_DataObject->query('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php:334
  11  CRM_Core_DAO->query('INSERT INTO `civ…', true)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/DAO.php:1267
  12  CRM_Core_DAO::executeQuery('INSERT INTO `civ…')
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Upgrade/Incremental/php/FourSeven.php:272
  13  CRM_Upgrade_Incremental_php_FourSeven::addGettingStartedDashlet(Object(CRM_Queue_TaskContext), '4.7.alpha1')
  unknown:unknown
  14  call_user_func_array(Array, Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Task.php:88
  15  CRM_Queue_Task->run(Object(CRM_Queue_TaskContext))
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Runner.php:214
  16  CRM_Queue_Runner->runNext(true)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php:52
  17  CRM_Queue_Page_AJAX::{closure}()
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/ErrorPolicy.php:106
  18  CRM_Queue_ErrorPolicy->call(Object(Closure))
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Queue/Page/AJAX.php:54
  19  CRM_Queue_Page_AJAX::runNext()
  unknown:unknown
  20  call_user_func(Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:278
  21  CRM_Core_Invoke::runItem(Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:86
  22  CRM_Core_Invoke::_invoke(Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php:54
  23  CRM_Core_Invoke::invoke(Array)
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm.php:116
  24  civicrm_invoke()
  /home/famcafe/public_html/administrator/components/com_civicrm/civicrm.php:40
  25  require_once('/home/famcafe/pu…')
  /home/famcafe/public_html/libraries/cms/component/helper.php:392
  26  JComponentHelper::executeComponent('/home/famcafe/pu…')
  /home/famcafe/public_html/libraries/cms/component/helper.php:372
  27  JComponentHelper::renderComponent('com_civicrm')
  /home/famcafe/public_html/libraries/cms/application/administrator.php:98
  28  JApplicationAdministrator->dispatch()
  /home/famcafe/public_html/libraries/cms/application/administrator.php:152
  29  JApplicationAdministrator->doExecute()
  /home/famcafe/public_html/libraries/cms/application/cms.php:252
  30  JApplicationCms->execute()
  /home/famcafe/public_html/administrator/index.php:47
  
  ```
  
  **Tags:** upgrade, database, dashlet, error-page
  
  > **Comments:**
  > **username_0**: for whatever it is worth, I tried s smaller increment to 4.6.12 and the same error occurred.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-03-18. Score: 1
  
  I just encountered this and solved it.
  
  I've opened a ticket [CRM-18264](https://issues.civicrm.org/jira/browse/CRM-18264) to address this issue, and I've submitted a pull request for both 4.6LTS and 4.7. They've been merged, so you just need to upgrade to CiviCRM 4.6.15+ or CiviCRM 4.7.5+.
  
  > **Comments:**
  > **username_0**: Thank you, Jon! I'm trying it tonight after business hours have ended for the client and I'll let you know if it worked for me. Much appreciated.  
  
  ---
  
  