Answers.Body: <p>Are you using CiviCase and do you have a different language than English for you CiviCRM? If so, you might suffer from a bug that has to do with the relationships for the cases. The easiest fix then is to disable the "standard" case types that are shipped with core?</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-03T13:56:45.257Z
Answers.Text: That was fixed in 5.20. But worth checking.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-03T14:43:27.610Z
Answers.Text: Cool, that should be fine then....but indeed worth checking :-)
Answers.UserDisplayName: ErikH - CiviCooP
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-03T22:47:21.873Z
Answers.Text: No, CiviCase is not enabled, nor is there any language apart form English installed.
Answers.UserDisplayName: Bryan
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-04T04:05:16.063Z
Answers.Text: Then it seems probably like Luke said, except you guessed the extension table but it's probably the civicrm_option_group/civicrm_option_value table.
Answers.UserDisplayName: Demerit
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-02-03T07:49:53.260Z
Answers.LastActivityDate: 2020-02-03T07:49:53.260Z
Answers.UserDisplayName: ErikH - CiviCooP
Body: <p>When I enable or disable an extension I get the error that follows. Enabling or disabling still happens. Advice on resolving this would be gratefully received. This site is running 5.21.2 on Joomla.</p>
  
  <pre><code>&gt; CiviCRM_API3_Exception: "API error: Value already exists in the
  &gt; database"
  &gt; 
  &gt; #0 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Admin/Form/Extensions.php(178):
  &gt; civicrm_api3("Extension", "enable", (Array:2))
  &gt; #1 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php(479):
  &gt; CRM_Admin_Form_Extensions-&gt;postProcess()
  &gt; #2 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php(144):
  &gt; CRM_Core_Form-&gt;mainProcess()
  &gt; #3 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(45):
  &gt; CRM_Core_StateMachine-&gt;perform(Object(CRM_Admin_Form_Extensions),
  &gt; "next", "Next")
  &gt; #4 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203):
  &gt; CRM_Core_QuickForm_Action_Next-&gt;perform(Object(CRM_Admin_Form_Extensions),
  &gt; "next")
  &gt; #5 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php(103):
  &gt; HTML_QuickForm_Controller-&gt;handle(Object(CRM_Admin_Form_Extensions),
  &gt; "next")
  &gt; #6 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php(335):
  &gt; HTML_QuickForm_Page-&gt;handle("next")
  &gt; #7 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Page/Basic.php(395):
  &gt; CRM_Core_Controller-&gt;run()
  &gt; #8 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Page/Basic.php(140):
  &gt; CRM_Core_Page_Basic-&gt;edit(32, NULL)
  &gt; #9 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Admin/Page/Extensions.php(105):
  &gt; CRM_Core_Page_Basic-&gt;run()
  &gt; #10 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(268):
  &gt; CRM_Admin_Page_Extensions-&gt;run((Array:3), NULL)
  &gt; #11 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(68):
  &gt; CRM_Core_Invoke::runItem((Array:16))
  &gt; #12 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(36):
  &gt; CRM_Core_Invoke::_invoke((Array:3))
  &gt; #13 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm.php(121):
  &gt; CRM_Core_Invoke::invoke((Array:3))
  &gt; #14 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm.php(40):
  &gt; civicrm_invoke()
  &gt; #15 /var/www/clients/client3/web4/web/libraries/src/Component/ComponentHelper.php(402):
  &gt; require_once("/var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicr...")
  &gt; #16 /var/www/clients/client3/web4/web/libraries/src/Component/ComponentHelper.php(377):
  &gt; Joomla\CMS\Component\ComponentHelper::executeComponent("/var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicr...")
  &gt; #17 /var/www/clients/client3/web4/web/libraries/src/Application/AdministratorApplication.php(101):
  &gt; Joomla\CMS\Component\ComponentHelper::renderComponent("com_civicrm")
  &gt; #18 /var/www/clients/client3/web4/web/libraries/src/Application/AdministratorApplication.php(159):
  &gt; Joomla\CMS\Application\AdministratorApplication-&gt;dispatch()
  &gt; #19 /var/www/clients/client3/web4/web/libraries/src/Application/CMSApplication.php(196):
  &gt; Joomla\CMS\Application\AdministratorApplication-&gt;doExecute()
  &gt; #20 /var/www/clients/client3/web4/web/administrator/index.php(51): Joomla\CMS\Application\CMSApplication-&gt;execute()
  &gt; #21 {main}  Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or
  &gt; service provider with more details about what action you were
  &gt; performing when this occurred. API error: Value already exists in the
  &gt; database Return to home page.
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-02T19:57:32.020Z
Comments.Text: Is this a publically available extension? The problem is most likely the extension was not uninstalled cleanly - this could be due to the extension itself not doing the uninstall work required, or there might have been an error during the uninstall process.
Comments.UserDisplayName: Luke Stewart
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2020-02-03T00:03:48.067Z
Comments.Text: Yes, these are pretty standard extensions, like Stripe, Mosaico & Fleximailer. I presume the issue is with the civicrm_extension table, but nothing there is obvious enough for me to see a problem.
Comments.UserDisplayName: Bryan
Tags: <extension><error><database>
Title: CiviCRM_API3_Exception
ThreadText: # CiviCRM_API3_Exception
  
  (Asked by: username_0 on 2020-01-31)
  
  When I enable or disable an extension I get the error that follows. Enabling or disabling still happens. Advice on resolving this would be gratefully received. This site is running 5.21.2 on Joomla.
  
  ```
  > CiviCRM_API3_Exception: "API error: Value already exists in the
  > database"
  > 
  > #0 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Admin/Form/Extensions.php(178):
  > civicrm_api3("Extension", "enable", (Array:2))
  > #1 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Form.php(479):
  > CRM_Admin_Form_Extensions->postProcess()
  > #2 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/StateMachine.php(144):
  > CRM_Core_Form->mainProcess()
  > #3 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(45):
  > CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions),
  > "next", "Next")
  > #4 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203):
  > CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions),
  > "next")
  > #5 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/packages/HTML/QuickForm/Page.php(103):
  > HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions),
  > "next")
  > #6 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Controller.php(335):
  > HTML_QuickForm_Page->handle("next")
  > #7 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Page/Basic.php(395):
  > CRM_Core_Controller->run()
  > #8 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Page/Basic.php(140):
  > CRM_Core_Page_Basic->edit(32, NULL)
  > #9 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Admin/Page/Extensions.php(105):
  > CRM_Core_Page_Basic->run()
  > #10 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(268):
  > CRM_Admin_Page_Extensions->run((Array:3), NULL)
  > #11 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(68):
  > CRM_Core_Invoke::runItem((Array:16))
  > #12 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm/CRM/Core/Invoke.php(36):
  > CRM_Core_Invoke::_invoke((Array:3))
  > #13 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm.php(121):
  > CRM_Core_Invoke::invoke((Array:3))
  > #14 /var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicrm.php(40):
  > civicrm_invoke()
  > #15 /var/www/clients/client3/web4/web/libraries/src/Component/ComponentHelper.php(402):
  > require_once("/var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicr...")
  > #16 /var/www/clients/client3/web4/web/libraries/src/Component/ComponentHelper.php(377):
  > Joomla\CMS\Component\ComponentHelper::executeComponent("/var/www/clients/client3/web4/web/administrator/components/com_civicrm/civicr...")
  > #17 /var/www/clients/client3/web4/web/libraries/src/Application/AdministratorApplication.php(101):
  > Joomla\CMS\Component\ComponentHelper::renderComponent("com_civicrm")
  > #18 /var/www/clients/client3/web4/web/libraries/src/Application/AdministratorApplication.php(159):
  > Joomla\CMS\Application\AdministratorApplication->dispatch()
  > #19 /var/www/clients/client3/web4/web/libraries/src/Application/CMSApplication.php(196):
  > Joomla\CMS\Application\AdministratorApplication->doExecute()
  > #20 /var/www/clients/client3/web4/web/administrator/index.php(51): Joomla\CMS\Application\CMSApplication->execute()
  > #21 {main}  Sorry, due to an error, we are unable to fulfill your request at the moment. You may want to contact your administrator or
  > service provider with more details about what action you were
  > performing when this occurred. API error: Value already exists in the
  > database Return to home page.
  
  ```
  
  **Tags:** extension, error, database
  
  > **Comments:**
  > **username_1**: Is this a publically available extension? The problem is most likely the extension was not uninstalled cleanly - this could be due to the extension itself not doing the uninstall work required, or there might have been an error during the uninstall process.  
  > **username_0**: Yes, these are pretty standard extensions, like Stripe, Mosaico & Fleximailer. I presume the issue is with the civicrm_extension table, but nothing there is obvious enough for me to see a problem.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2020-02-03. Score: 0
  
  Are you using CiviCase and do you have a different language than English for you CiviCRM? If so, you might suffer from a bug that has to do with the relationships for the cases. The easiest fix then is to disable the "standard" case types that are shipped with core?
  
  > **Comments:**
  > **username_3**: That was fixed in 5.20. But worth checking.  
  > **username_2**: Cool, that should be fine then....but indeed worth checking :-)  
  > **username_0**: No, CiviCase is not enabled, nor is there any language apart form English installed.  
  > **username_3**: Then it seems probably like username_1 said, except you guessed the extension table but it's probably the civicrm_option_group/civicrm_option_value table.  
  
  ---
  
  