Answers.Body: <p>I fixed this particular problem.  I haven't been able to recreate the problem so I can't state the source, but the following steps allowed me to install the extension.</p>
  
  <p>1) remove all other extensions from the extensions folder (including ones which were not installed).
  2) truncating the civicrm_extension  table
  3) truncating the civicrm cache tables</p>
  
  <p>Note that just trying v1.92 of the extension was not effective, nor was deleting the Stripe extension record in the civicrm_extension table.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-23T05:32:12.800Z
Answers.LastActivityDate: 2015-09-23T05:32:12.800Z
Answers.UserDisplayName: Eliot Mason
Answers.Body: <p>My understanding is that you should use the <a href="https://github.com/drastik/com.drastikbydesign.stripe/tree/4.6-dev" rel="nofollow">4.6.dev branch</a> for CiviCRM 4.6. The README does state there will be releases/tags for each version...</p>
  
  <blockquote>
    <p>There will no longer be branches for each version. The branches will be:</p>
    
    <p>Civi's major.minor-dev, and we will create releases (tags) for each new release version.</p>
    
    <p>Example: 4.6-dev.</p>
  </blockquote>
  
  <p>...but the only release showing is 1.9.1 and there has been a lot of change (21 commits) since that was released in January. I'd recommend trying 4.6.dev and seeing if that solves this issue.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-02T22:42:26.443Z
Answers.Text: Thank you. I tried to install the 4.6 dev branch with the same results. I was able to install this extension on another site – so it must be something about this site's particular database … just can't figure out from the error message where to start looking. IOW, in plain language, to where is the error message pointing me?
Answers.UserDisplayName: Justin Young
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-02T22:47:14.190Z
Answers.Text: Another data point: when I tried to enable a Drupal module, I get the following error now: "Exception: API error: DB Error: constraint violation in CRM_Core_ManagedEntities->onApiError() (line 453 of /home/mysitename/www/www/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php)."
Answers.UserDisplayName: Justin Young
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-03T01:52:18.533Z
Answers.Text: Do you have any other Civi extensions enabled? Maybe try disabling one by one if so.
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-03T12:27:28.907Z
Answers.Text: Thank you. Yes, I have other extensions, but when I disabled one of the other extensions, I get the same error as above.
Answers.UserDisplayName: Justin Young
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-04T00:10:55.927Z
Answers.Text: If this is a dev server, perhaps try deleting the extensions code base one by one?
Answers.UserDisplayName: Laryn
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-09-02T19:21:19.467Z
Answers.LastActivityDate: 2015-09-02T19:21:19.467Z
Answers.UserDisplayName: Laryn
Body: <p>With debugging and back tracing turned on, I receive the following error on our Drupal 7.38 and CiviCRM 4.6.8 site when trying to install the <a href="https://github.com/drastik/com.drastikbydesign.stripe/releases/tag/1.9.1" rel="nofollow">CiviCRM Strip 1.9.1 extension</a>:</p>
  
  <pre><code>Exception: "API error: DB Error: constraint violation"
  
  #0 …civicrm/CRM/Core/ManagedEntities.php(265): CRM_Core_ManagedEntities-&gt;onApiError("Dashboard", "create", (Array:6), (Array:4))
  #1 …civicrm/CRM/Core/ManagedEntities.php(168): CRM_Core_ManagedEntities-&gt;updateExistingEntity(Object(CRM_Core_DAO_Managed), (Array:4))
  #2 …civicrm/CRM/Core/ManagedEntities.php(141): CRM_Core_ManagedEntities-&gt;reconcileEnabledModule(Object(CRM_Core_Module), (Array:3))
  #3 …civicrm/CRM/Core/ManagedEntities.php(122): CRM_Core_ManagedEntities-&gt;reconcileEnabledModules()
  #4 …civicrm/CRM/Core/Invoke.php(403): CRM_Core_ManagedEntities-&gt;reconcile()
  #5 …civicrm/CRM/Extension/Manager.php(246): CRM_Core_Invoke::rebuildMenuAndCaches(TRUE)
  #6 …civicrm/CRM/Admin/Form/Extensions.php(195): CRM_Extension_Manager-&gt;install((Array:1))
  #7 …civicrm/CRM/Core/Form.php(345): CRM_Admin_Form_Extensions-&gt;postProcess()
  #8 …civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form-&gt;mainProcess()
  #9 …civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine-&gt;perform(Object(CRM_Admin_Form_Extensions), "next", "Next")
  #10 …civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next-&gt;perform(Object(CRM_Admin_Form_Extensions), "next")
  #11 …civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller-&gt;handle(Object(CRM_Admin_Form_Extensions), "next")
  #12 …civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page-&gt;handle("next")
  #13 …civicrm/CRM/Core/Page/Basic.php(395): CRM_Core_Controller-&gt;run()
  #14 …civicrm/CRM/Core/Page/Basic.php(174): CRM_Core_Page_Basic-&gt;edit(1, NULL)
  #15 …civicrm/CRM/Admin/Page/Extensions.php(125): CRM_Core_Page_Basic-&gt;run()
  #16 …civicrm/CRM/Core/Invoke.php(312): CRM_Admin_Page_Extensions-&gt;run((Array:3), NULL)
  #17 …civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
  #18 …civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
  #19 …civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
  #20 [internal function](): civicrm_invoke("admin", "extensions")
  #21 /home/oursitename/www/www/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2))
  #22 /home/oursitename/www/www/index.php(21): menu_execute_active_handler()
  #23 {main}
  </code></pre>
  
  <p>On the extension page, it appears as if the CiviCRM Strip extension has installed, but Stripe is not available as a payment processor.</p>
  
  <p>Is anyone able to give guidance on next steps to troubleshoot?</p>
  
Tags: <drupal><extension><stripe>
Title: "API error: DB Error: constraint violation" when installing Stripe extension
ThreadText: # "API error: DB Error: constraint violation" when installing Stripe extension
  
  (Asked by: username_0 on 2015-09-02)
  
  With debugging and back tracing turned on, I receive the following error on our Drupal 7.38 and CiviCRM 4.6.8 site when trying to install the [CiviCRM Strip 1.9.1 extension](https://github.com/drastik/com.drastikbydesign.stripe/releases/tag/1.9.1):
  
  ```
  Exception: "API error: DB Error: constraint violation"
  
  #0 …civicrm/CRM/Core/ManagedEntities.php(265): CRM_Core_ManagedEntities->onApiError("Dashboard", "create", (Array:6), (Array:4))
  #1 …civicrm/CRM/Core/ManagedEntities.php(168): CRM_Core_ManagedEntities->updateExistingEntity(Object(CRM_Core_DAO_Managed), (Array:4))
  #2 …civicrm/CRM/Core/ManagedEntities.php(141): CRM_Core_ManagedEntities->reconcileEnabledModule(Object(CRM_Core_Module), (Array:3))
  #3 …civicrm/CRM/Core/ManagedEntities.php(122): CRM_Core_ManagedEntities->reconcileEnabledModules()
  #4 …civicrm/CRM/Core/Invoke.php(403): CRM_Core_ManagedEntities->reconcile()
  #5 …civicrm/CRM/Extension/Manager.php(246): CRM_Core_Invoke::rebuildMenuAndCaches(TRUE)
  #6 …civicrm/CRM/Admin/Form/Extensions.php(195): CRM_Extension_Manager->install((Array:1))
  #7 …civicrm/CRM/Core/Form.php(345): CRM_Admin_Form_Extensions->postProcess()
  #8 …civicrm/CRM/Core/StateMachine.php(164): CRM_Core_Form->mainProcess()
  #9 …civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions), "next", "Next")
  #10 …civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions), "next")
  #11 …civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions), "next")
  #12 …civicrm/CRM/Core/Controller.php(353): HTML_QuickForm_Page->handle("next")
  #13 …civicrm/CRM/Core/Page/Basic.php(395): CRM_Core_Controller->run()
  #14 …civicrm/CRM/Core/Page/Basic.php(174): CRM_Core_Page_Basic->edit(1, NULL)
  #15 …civicrm/CRM/Admin/Page/Extensions.php(125): CRM_Core_Page_Basic->run()
  #16 …civicrm/CRM/Core/Invoke.php(312): CRM_Admin_Page_Extensions->run((Array:3), NULL)
  #17 …civicrm/CRM/Core/Invoke.php(86): CRM_Core_Invoke::runItem((Array:13))
  #18 …civicrm/CRM/Core/Invoke.php(54): CRM_Core_Invoke::_invoke((Array:3))
  #19 …civicrm/drupal/civicrm.module(489): CRM_Core_Invoke::invoke((Array:3))
  #20 [internal function](): civicrm_invoke("admin", "extensions")
  #21 /home/oursitename/www/www/includes/menu.inc(519): call_user_func_array("civicrm_invoke", (Array:2))
  #22 /home/oursitename/www/www/index.php(21): menu_execute_active_handler()
  #23 {main}
  
  ```
  
  On the extension page, it appears as if the CiviCRM Strip extension has installed, but Stripe is not available as a payment processor.
  
  Is anyone able to give guidance on next steps to troubleshoot?
  
  **Tags:** drupal, extension, stripe
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_1 on 2015-09-23. Score: 1 | Accepted answer
  
  I fixed this particular problem. I haven't been able to recreate the problem so I can't state the source, but the following steps allowed me to install the extension.
  
  1) remove all other extensions from the extensions folder (including ones which were not installed).
  2) truncating the civicrm\_extension table
  3) truncating the civicrm cache tables
  
  Note that just trying v1.92 of the extension was not effective, nor was deleting the Stripe extension record in the civicrm\_extension table.
  
  
  ---
  
  ### Answer by username_2 on 2015-09-02. Score: 0
  
  My understanding is that you should use the [4.6.dev branch](https://github.com/drastik/com.drastikbydesign.stripe/tree/4.6-dev) for CiviCRM 4.6. The README does state there will be releases/tags for each version...
  
  > There will no longer be branches for each version. The branches will be:
  >
  > Civi's major.minor-dev, and we will create releases (tags) for each new release version.
  >
  > Example: 4.6-dev.
  
  ...but the only release showing is 1.9.1 and there has been a lot of change (21 commits) since that was released in January. I'd recommend trying 4.6.dev and seeing if that solves this issue.
  
  > **Comments:**
  > **username_0**: Thank you. I tried to install the 4.6 dev branch with the same results. I was able to install this extension on another site – so it must be something about this site's particular database … just can't figure out from the error message where to start looking. IOW, in plain language, to where is the error message pointing me?  
  > **username_0**: Another data point: when I tried to enable a Drupal module, I get the following error now: "Exception: API error: DB Error: constraint violation in CRM_Core_ManagedEntities->onApiError() (line 453 of /home/mysitename/www/www/sites/all/modules/civicrm/CRM/Core/ManagedEntities.php)."  
  > **username_2**: Do you have any other Civi extensions enabled? Maybe try disabling one by one if so.  
  > **username_0**: Thank you. Yes, I have other extensions, but when I disabled one of the other extensions, I get the same error as above.  
  > **username_2**: If this is a dev server, perhaps try deleting the extensions code base one by one?  
  
  ---
  
  