Answers.Body: <p>I removed the following tables from from 'civicrm_custom_group' table and everything is working as expected:</p>
  <ul>
  <li><p>civicrm_value_civivolunteer_...</p>
  </li>
  <li><p>civicrm_value_volunteer_com_...</p>
  </li>
  </ul>
  <p>This was the only remaining civivolunteer trigger reference that we found.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-09-03T15:30:59.630Z
Answers.LastActivityDate: 2021-09-03T15:30:59.630Z
Answers.UserDisplayName: Andy Burns
Body: <p>I uninstalled civivolunteer. We've opted to instead use an activity type with a couple custom fields tracking role and time spent. Anyway, when uninstalling it did not delete the 2 volunteer and volunteer commendation activity type data but does delete the volunteer custom field data :/</p>
  <p>So, we restored the tables:</p>
  <ul>
  <li>civicrm_custom_group</li>
  <li>civicrm_custom_field</li>
  <li>civicrm_option_value</li>
  <li>civicrm_uf_field</li>
  <li>civicrm_uf_group</li>
  <li>civicrm_uf_join</li>
  </ul>
  <p>and manually cleaned up what civilvolunteer adds. However, a trigger remains. Each time we upgrade extensions a civivolunteer trigger is trying to run, see error below when upgrading another extension)</p>
  <p>Key line:</p>
  <p><em>#2 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error-&gt;__construct(&quot;DB Error: no such table&quot;, -18, 16, (Array:2), &quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;)</em></p>
  <pre><code>Aug 25 09:46:49  [debug] $backTrace = #0 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(942): CRM_Core_Error::backtrace(&quot;backTrace&quot;, TRUE)
  #1 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error-&gt;__construct(&quot;DB Error: no such table&quot;, -18, 16, (Array:2), &quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;)
  #3 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error-&gt;__construct(-18, 16, (Array:2), &quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;)
  #4 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -18, 16, (Array:2), &quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;, &quot;DB_Error&quot;, TRUE)
  #5 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR-&gt;__call(&quot;raiseError&quot;, (Array:7))
  #6 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common-&gt;raiseError(-18, NULL, NULL, &quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;, &quot;1146 ** Table 'example_civicrm.civicrm_value_civivolunteer_20' doesn't exist&quot;)
  #7 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli-&gt;mysqliRaiseError()
  #8 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli-&gt;simpleQuery(&quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;)
  #9 /var/www/example/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common-&gt;query(&quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;)
  #10 /var/www/example/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject-&gt;_query(&quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;)
  #11 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(454): DB_DataObject-&gt;query(&quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;)
  #12 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1565): CRM_Core_DAO-&gt;query(&quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;, FALSE)
  #13 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/Core/SqlTriggers.php(209): CRM_Core_DAO::executeQuery(&quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;, (Array:0), TRUE, NULL, FALSE, FALSE)
  #14 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/Core/SqlTriggers.php(155): Civi\Core\SqlTriggers-&gt;enqueueQuery(&quot;CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...&quot;)
  #15 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/Core/SqlTriggers.php(54): Civi\Core\SqlTriggers-&gt;createTriggers((Array:19), NULL)
  #16 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(2335): Civi\Core\SqlTriggers-&gt;rebuild(NULL, FALSE)
  #17 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(395): CRM_Core_DAO::triggerRebuild()
  #18 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager.php(228): CRM_Core_Invoke::rebuildMenuAndCaches(TRUE)
  #19 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Extension/Downloader.php(126): CRM_Extension_Manager-&gt;replace(&quot;/tmp/tmp-SHLdHt//stripe-6.6.1&quot;)
  #20 /var/www/example/wp-content/plugins/civicrm/civicrm/api/v3/Extension.php(239): CRM_Extension_Downloader-&gt;download(&quot;com.drastikbydesign.stripe&quot;, &quot;https://lab.civicrm.org/extensions/stripe/-/archive/6.6.1/stripe-6.6.1.zip&quot;)
  #21 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_extension_download((Array:4))
  #22 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:8))
  #23 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel-&gt;runRequest((Array:8))
  #24 /var/www/example/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel-&gt;runSafe(&quot;Extension&quot;, &quot;download&quot;, (Array:2))
  #25 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Extensions.php(190): civicrm_api(&quot;Extension&quot;, &quot;download&quot;, (Array:2))
  #26 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(513): CRM_Admin_Form_Extensions-&gt;postProcess()
  #27 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form-&gt;mainProcess()
  #28 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine-&gt;perform(Object(CRM_Admin_Form_Extensions), &quot;next&quot;, &quot;Next&quot;)
  #29 /var/www/example/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next-&gt;perform(Object(CRM_Admin_Form_Extensions), &quot;next&quot;)
  #30 /var/www/example/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller-&gt;handle(Object(CRM_Admin_Form_Extensions), &quot;next&quot;)
  #31 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(347): HTML_QuickForm_Page-&gt;handle(&quot;next&quot;)
  #32 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(395): CRM_Core_Controller-&gt;run()
  #33 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(140): CRM_Core_Page_Basic-&gt;edit(2, NULL)
  #34 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Extensions.php(105): CRM_Core_Page_Basic-&gt;run()
  #35 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Admin_Page_Extensions-&gt;run((Array:3), NULL)
  #36 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:15))
  #37 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
  #38 /var/www/example/wp-content/plugins/civicrm/civicrm.php(1172): CRM_Core_Invoke::invoke((Array:3))
  #39 /var/www/example/wp-includes/class-wp-hook.php(292): CiviCRM_For_WordPress-&gt;invoke(&quot;&quot;)
  #40 /var/www/example/wp-includes/class-wp-hook.php(316): WP_Hook-&gt;apply_filters(&quot;&quot;, (Array:1))
  #41 /var/www/example/wp-includes/plugin.php(484): WP_Hook-&gt;do_action((Array:1))
  #42 /var/www/example/wp-admin/admin.php(259): do_action(&quot;toplevel_page_CiviCRM&quot;)
  #43 {main}
  </code></pre>
  <p>I've tried to run the rebuild database triggers and it did not resolve. Without re-installing and uninstalling and going thru that nightmare again how can we remove this trigger?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-25T17:26:30.463Z
Comments.Text: If you `select * from civicrm_managed` is there still something stuck in there for civivolunteer?
Comments.UserDisplayName: Demerit
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-25T17:37:47.620Z
Comments.Text: Not seeing anything there. We think it is safe to remove from 'civicrm_custom_group' 'CiviVolunteer' which has a table_name of 'civicrm_value_civivolunteer_20' which no longer exists and for which the trigger is trying to reference.
Comments.UserDisplayName: Andy Burns
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2021-08-25T17:38:52.983Z
Comments.Text: Yes that makes sense to remove.
Comments.UserDisplayName: Demerit
Tags: <extension><civivolunteer><trigger>
Title: Uninstalling civivolunteer - trigger remains
ThreadText: # Uninstalling civivolunteer - trigger remains
  
  (Asked by: username_0 on 2021-08-25)
  
  I uninstalled civivolunteer. We've opted to instead use an activity type with a couple custom fields tracking role and time spent. Anyway, when uninstalling it did not delete the 2 volunteer and volunteer commendation activity type data but does delete the volunteer custom field data :/
  So, we restored the tables:
  
  civicrm_custom_group
  civicrm_custom_field
  civicrm_option_value
  civicrm_uf_field
  civicrm_uf_group
  civicrm_uf_join
  
  and manually cleaned up what civilvolunteer adds. However, a trigger remains. Each time we upgrade extensions a civivolunteer trigger is trying to run, see error below when upgrading another extension)
  Key line:
  #2 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: no such table", -18, 16, (Array:2), "CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...")
  Aug 25 09:46:49  [debug] $backTrace = #0 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(942): CRM_Core_Error::backtrace("backTrace", TRUE)
  #1 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922): CRM_Core_Error::exceptionHandler(Object(DB_Error))
  #2 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php(997): PEAR_Error->__construct("DB Error: no such table", -18, 16, (Array:2), "CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...")
  #3 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575): DB_Error->__construct(-18, 16, (Array:2), "CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...")
  #4 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -18, 16, (Array:2), "CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...", "DB_Error", TRUE)
  #5 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1928): PEAR->__call("raiseError", (Array:7))
  #6 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(936): DB_common->raiseError(-18, NULL, NULL, "CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...", "1146 ** Table 'example_civicrm.civicrm_value_civivolunteer_20' doesn't exist")
  #7 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php(406): DB_mysqli->mysqliRaiseError()
  #8 /var/www/example/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php(1234): DB_mysqli->simpleQuery("CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...")
  #9 /var/www/example/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2696): DB_common->query("CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...")
  #10 /var/www/example/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1829): DB_DataObject->_query("CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...")
  #11 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(454): DB_DataObject->query("CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...")
  #12 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1565): CRM_Core_DAO->query("CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...", FALSE)
  #13 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/Core/SqlTriggers.php(209): CRM_Core_DAO::executeQuery("CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...", (Array:0), TRUE, NULL, FALSE, FALSE)
  #14 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/Core/SqlTriggers.php(155): Civi\Core\SqlTriggers->enqueueQuery("CREATE TRIGGER civicrm_value_civivolunteer_20_after_insert after insert ON ci...")
  #15 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/Core/SqlTriggers.php(54): Civi\Core\SqlTriggers->createTriggers((Array:19), NULL)
  #16 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(2335): Civi\Core\SqlTriggers->rebuild(NULL, FALSE)
  #17 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(395): CRM_Core_DAO::triggerRebuild()
  #18 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Extension/Manager.php(228): CRM_Core_Invoke::rebuildMenuAndCaches(TRUE)
  #19 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Extension/Downloader.php(126): CRM_Extension_Manager->replace("/tmp/tmp-SHLdHt//stripe-6.6.1")
  #20 /var/www/example/wp-content/plugins/civicrm/civicrm/api/v3/Extension.php(239): CRM_Extension_Downloader->download("com.drastikbydesign.stripe", "https://lab.civicrm.org/extensions/stripe/-/archive/6.6.1/stripe-6.6.1.zip")
  #21 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/API/Provider/MagicFunctionProvider.php(89): civicrm_api3_extension_download((Array:4))
  #22 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(149): Civi\API\Provider\MagicFunctionProvider->invoke((Array:8))
  #23 /var/www/example/wp-content/plugins/civicrm/civicrm/Civi/API/Kernel.php(81): Civi\API\Kernel->runRequest((Array:8))
  #24 /var/www/example/wp-content/plugins/civicrm/civicrm/api/api.php(22): Civi\API\Kernel->runSafe("Extension", "download", (Array:2))
  #25 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Admin/Form/Extensions.php(190): civicrm_api("Extension", "download", (Array:2))
  #26 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(513): CRM_Admin_Form_Extensions->postProcess()
  #27 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(144): CRM_Core_Form->mainProcess()
  #28 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(43): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions), "next", "Next")
  #29 /var/www/example/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions), "next")
  #30 /var/www/example/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions), "next")
  #31 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(347): HTML_QuickForm_Page->handle("next")
  #32 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(395): CRM_Core_Controller->run()
  #33 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Page/Basic.php(140): CRM_Core_Page_Basic->edit(2, NULL)
  #34 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Admin/Page/Extensions.php(105): CRM_Core_Page_Basic->run()
  #35 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(312): CRM_Admin_Page_Extensions->run((Array:3), NULL)
  #36 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(68): CRM_Core_Invoke::runItem((Array:15))
  #37 /var/www/example/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(36): CRM_Core_Invoke::_invoke((Array:3))
  #38 /var/www/example/wp-content/plugins/civicrm/civicrm.php(1172): CRM_Core_Invoke::invoke((Array:3))
  #39 /var/www/example/wp-includes/class-wp-hook.php(292): CiviCRM_For_WordPress->invoke("")
  #40 /var/www/example/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters("", (Array:1))
  #41 /var/www/example/wp-includes/plugin.php(484): WP_Hook->do_action((Array:1))
  #42 /var/www/example/wp-admin/admin.php(259): do_action("toplevel_page_CiviCRM")
  #43 {main}
  
  I've tried to run the rebuild database triggers and it did not resolve. Without re-installing and uninstalling and going thru that nightmare again how can we remove this trigger?
  
  **Tags:** extension, civivolunteer, trigger
  
  > **Comments:**
  > **username_1**: If you `select * from civicrm_managed` is there still something stuck in there for civivolunteer?  
  > **username_0**: Not seeing anything there. We think it is safe to remove from 'civicrm_custom_group' 'CiviVolunteer' which has a table_name of 'civicrm_value_civivolunteer_20' which no longer exists and for which the trigger is trying to reference.  
  > **username_1**: Yes that makes sense to remove.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2021-09-03. Score: 1 | Accepted answer
  
  I removed the following tables from from 'civicrm\_custom\_group' table and everything is working as expected:
  
  * civicrm\_value\_civivolunteer\_...
  * civicrm\_value\_volunteer\_com\_...
  
  This was the only remaining civivolunteer trigger reference that we found.
  
  
  ---
  
  