Answers.Body: <p>Looks like you had already installed the extension on your instance (and removed it without properly uninstalling it*). The table 'civicrm_iats_customer_codes' already exists in your database. You can delete the table from if it doesn't have any data in it or change the sql statement in extension code to use 'CREATE IF NOT EXISTS'</p>
  
  <p>HTH</p>
  
  <p>Pradeep</p>
  
  <p>KarinG: *if you properly uninstall the iATS Extension - the uninstall process will copy your civicrm_iats_customer_codes to a backup table for safe keeping before deleting that table;</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-20T12:28:46.250Z
Answers.Text: Thanks! after deleting iats tables I was able to reinstall.
Answers.UserDisplayName: Tapash
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-06-20T11:51:01.197Z
Answers.LastActivityDate: 2019-06-20T14:39:20.457Z
Answers.LastEditDate: 2019-06-20T14:39:20.457Z
Answers.UserDisplayName: Pradeep Nayak
Body: <p>What am I doing wrong? Keep receiving an error message whenever I try to install iATS extension. Can anyone suggest please? Thanks</p>
  
  <pre><code>https://pastebin.com/4BkQErA8
  </code></pre>
  
  <p>Backtrace:</p>
  
  <pre><code>&gt;      [info] $backTrace = #0 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Error.php(952):
  &gt; CRM_Core_Error::backtrace("backTrace", TRUE)
  &gt; #1 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922):
  &gt; CRM_Core_Error::exceptionHandler(Object(DB_Error))
  &gt; #2 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB.php(985):
  &gt; PEAR_Error-&gt;__construct("DB Error: already exists", -5, 16, (Array:2),
  &gt; "CREATE TABLE `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT
  &gt; NULL AU...")
  &gt; #3 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575):
  &gt; DB_Error-&gt;__construct(-5, 16, (Array:2), "CREATE TABLE
  &gt; `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL AU...")
  &gt; #4 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223):
  &gt; PEAR-&gt;_raiseError(Object(DB_mysqli), NULL, -5, 16, (Array:2), "CREATE
  &gt; TABLE `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL
  &gt; AU...", "DB_Error", TRUE)
  &gt; #5 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/common.php(1907):
  &gt; PEAR-&gt;__call("raiseError", (Array:7))
  &gt; #6 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/mysqli.php(933):
  &gt; DB_common-&gt;raiseError(-5, NULL, NULL, "CREATE TABLE
  &gt; `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL AU...",
  &gt; "1050 ** Table 'civicrm_iats_customer_codes' already exists")
  &gt; #7 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/mysqli.php(403):
  &gt; DB_mysqli-&gt;mysqliRaiseError()
  &gt; #8 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/common.php(1216):
  &gt; DB_mysqli-&gt;simpleQuery("CREATE TABLE `civicrm_iats_customer_codes` (\n
  &gt; `id` int unsigned NOT NULL AU...")
  &gt; #9 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Utils/File.php(366):
  &gt; DB_common-&gt;query("CREATE TABLE `civicrm_iats_customer_codes` (\n  `id`
  &gt; int unsigned NOT NULL AU...")
  &gt; #10 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Utils/File.php(326):
  &gt; CRM_Utils_File::runSqlQuery("mysql://webadmin_uatusr:GouraNga08@localhost:3306/webadmin_uat_crm?new_link=true",
  &gt; "-- install sql for iATS Services extension, create a table to hold
  &gt; custom cod...", NULL, TRUE)
  &gt; #11 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader/Base.php(119):
  &gt; CRM_Utils_File::sourceSQLFile("mysql://webadmin_uatusr:GouraNga08@localhost:3306/webadmin_uat_crm?new_link=true",
  &gt; "/home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments...")
  &gt; #12 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader.php(28):
  &gt; CRM_iATS_Upgrader_Base-&gt;executeSqlFile("sql/install.sql")
  &gt; #13 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader/Base.php(264):
  &gt; CRM_iATS_Upgrader-&gt;install()
  &gt; #14 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/iats.civix.php(50):
  &gt; CRM_iATS_Upgrader_Base-&gt;onInstall()
  &gt; #15 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/iats.php(48): _iats_civix_civicrm_install()
  &gt; #16 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(76):
  &gt; iats_civicrm_install()
  &gt; #17 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(48):
  &gt; CRM_Extension_Manager_Module-&gt;callHook(Object(CRM_Extension_Info),
  &gt; "install")
  &gt; #18 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager.php(237):
  &gt; CRM_Extension_Manager_Module-&gt;onPreInstall(Object(CRM_Extension_Info))
  &gt; #19 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/api/v3/Extension.php(58):
  &gt; CRM_Extension_Manager-&gt;install((Array:1))
  &gt; #20 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(101):
  &gt; civicrm_api3_extension_install((Array:2))
  &gt; #21 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Kernel.php(168):
  &gt; Civi\API\Provider\MagicFunctionProvider-&gt;invoke((Array:9))
  &gt; #22 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Kernel.php(99):
  &gt; Civi\API\Kernel-&gt;runRequest((Array:9))
  &gt; #23 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/api/api.php(43):
  &gt; Civi\API\Kernel-&gt;runSafe("Extension", "install", (Array:2))
  &gt; #24 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Admin/Form/Extensions.php(189):
  &gt; civicrm_api3("Extension", "install", (Array:2))
  &gt; #25 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Form.php(490):
  &gt; CRM_Admin_Form_Extensions-&gt;postProcess()
  &gt; #26 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160):
  &gt; CRM_Core_Form-&gt;mainProcess()
  &gt; #27 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine-&gt;perform(Object(CRM_Admin_Form_Extensions),
  &gt; "next", "Next")
  &gt; #28 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203):
  &gt; CRM_Core_QuickForm_Action_Next-&gt;perform(Object(CRM_Admin_Form_Extensions),
  &gt; "next")
  &gt; #29 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103):
  &gt; HTML_QuickForm_Controller-&gt;handle(Object(CRM_Admin_Form_Extensions),
  &gt; "next")
  &gt; #30 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Controller.php(349):
  &gt; HTML_QuickForm_Page-&gt;handle("next")
  &gt; #31 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(411):
  &gt; CRM_Core_Controller-&gt;run()
  &gt; #32 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(156):
  &gt; CRM_Core_Page_Basic-&gt;edit(1, NULL)
  &gt; #33 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Admin/Page/Extensions.php(121):
  &gt; CRM_Core_Page_Basic-&gt;run()
  &gt; #34 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(311):
  &gt; CRM_Admin_Page_Extensions-&gt;run((Array:3), NULL)
  &gt; #35 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(85):
  &gt; CRM_Core_Invoke::runItem((Array:16))
  &gt; #36 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(52):
  &gt; CRM_Core_Invoke::_invoke((Array:3))
  &gt; #37 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/drupal/civicrm.module(444):
  &gt; CRM_Core_Invoke::invoke((Array:3))
  &gt; #38 /home/webadmin/public_html/cmm-uat/includes/menu.inc(527): civicrm_invoke("admin", "extensions")
  &gt; #39 /home/webadmin/public_html/cmm-uat/index.php(21): menu_execute_active_handler()
  </code></pre>
  
Tags: <error><iats>
Title: Cannot install iATS extension
ThreadText: # Cannot install iATS extension
  
  (Asked by: username_0 on 2019-06-20)
  
  What am I doing wrong? Keep receiving an error message whenever I try to install iATS extension. Can anyone suggest please? Thanks
  
  ```
  https://pastebin.com/4BkQErA8
  
  ```
  
  Backtrace:
  
  ```
  >      [info] $backTrace = #0 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Error.php(952):
  > CRM_Core_Error::backtrace("backTrace", TRUE)
  > #1 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(922):
  > CRM_Core_Error::exceptionHandler(Object(DB_Error))
  > #2 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB.php(985):
  > PEAR_Error->__construct("DB Error: already exists", -5, 16, (Array:2),
  > "CREATE TABLE `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT
  > NULL AU...")
  > #3 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(575):
  > DB_Error->__construct(-5, 16, (Array:2), "CREATE TABLE
  > `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL AU...")
  > #4 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php(223):
  > PEAR->_raiseError(Object(DB_mysqli), NULL, -5, 16, (Array:2), "CREATE
  > TABLE `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL
  > AU...", "DB_Error", TRUE)
  > #5 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/common.php(1907):
  > PEAR->__call("raiseError", (Array:7))
  > #6 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/mysqli.php(933):
  > DB_common->raiseError(-5, NULL, NULL, "CREATE TABLE
  > `civicrm_iats_customer_codes` (\n  `id` int unsigned NOT NULL AU...",
  > "1050 ** Table 'civicrm_iats_customer_codes' already exists")
  > #7 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/mysqli.php(403):
  > DB_mysqli->mysqliRaiseError()
  > #8 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/DB/common.php(1216):
  > DB_mysqli->simpleQuery("CREATE TABLE `civicrm_iats_customer_codes` (\n
  > `id` int unsigned NOT NULL AU...")
  > #9 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Utils/File.php(366):
  > DB_common->query("CREATE TABLE `civicrm_iats_customer_codes` (\n  `id`
  > int unsigned NOT NULL AU...")
  > #10 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Utils/File.php(326):
  > CRM_Utils_File::runSqlQuery("mysql://webadmin_uatusr:GouraNga08@localhost:3306/webadmin_uat_crm?new_link=true",
  > "-- install sql for iATS Services extension, create a table to hold
  > custom cod...", NULL, TRUE)
  > #11 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader/Base.php(119):
  > CRM_Utils_File::sourceSQLFile("mysql://webadmin_uatusr:GouraNga08@localhost:3306/webadmin_uat_crm?new_link=true",
  > "/home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments...")
  > #12 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader.php(28):
  > CRM_iATS_Upgrader_Base->executeSqlFile("sql/install.sql")
  > #13 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/CRM/iATS/Upgrader/Base.php(264):
  > CRM_iATS_Upgrader->install()
  > #14 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/iats.civix.php(50):
  > CRM_iATS_Upgrader_Base->onInstall()
  > #15 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/ext/iatspayments/iats.php(48): _iats_civix_civicrm_install()
  > #16 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(76):
  > iats_civicrm_install()
  > #17 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager/Module.php(48):
  > CRM_Extension_Manager_Module->callHook(Object(CRM_Extension_Info),
  > "install")
  > #18 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Extension/Manager.php(237):
  > CRM_Extension_Manager_Module->onPreInstall(Object(CRM_Extension_Info))
  > #19 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/api/v3/Extension.php(58):
  > CRM_Extension_Manager->install((Array:1))
  > #20 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Provider/MagicFunctionProvider.php(101):
  > civicrm_api3_extension_install((Array:2))
  > #21 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Kernel.php(168):
  > Civi\API\Provider\MagicFunctionProvider->invoke((Array:9))
  > #22 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/Civi/API/Kernel.php(99):
  > Civi\API\Kernel->runRequest((Array:9))
  > #23 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/api/api.php(43):
  > Civi\API\Kernel->runSafe("Extension", "install", (Array:2))
  > #24 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Admin/Form/Extensions.php(189):
  > civicrm_api3("Extension", "install", (Array:2))
  > #25 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Form.php(490):
  > CRM_Admin_Form_Extensions->postProcess()
  > #26 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/StateMachine.php(160):
  > CRM_Core_Form->mainProcess()
  > #27 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Admin_Form_Extensions),
  > "next", "Next")
  > #28 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/HTML/QuickForm/Controller.php(203):
  > CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Admin_Form_Extensions),
  > "next")
  > #29 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/packages/HTML/QuickForm/Page.php(103):
  > HTML_QuickForm_Controller->handle(Object(CRM_Admin_Form_Extensions),
  > "next")
  > #30 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Controller.php(349):
  > HTML_QuickForm_Page->handle("next")
  > #31 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(411):
  > CRM_Core_Controller->run()
  > #32 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Page/Basic.php(156):
  > CRM_Core_Page_Basic->edit(1, NULL)
  > #33 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Admin/Page/Extensions.php(121):
  > CRM_Core_Page_Basic->run()
  > #34 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(311):
  > CRM_Admin_Page_Extensions->run((Array:3), NULL)
  > #35 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(85):
  > CRM_Core_Invoke::runItem((Array:16))
  > #36 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/CRM/Core/Invoke.php(52):
  > CRM_Core_Invoke::_invoke((Array:3))
  > #37 /home/webadmin/public_html/cmm-uat/sites/all/modules/civicrm/drupal/civicrm.module(444):
  > CRM_Core_Invoke::invoke((Array:3))
  > #38 /home/webadmin/public_html/cmm-uat/includes/menu.inc(527): civicrm_invoke("admin", "extensions")
  > #39 /home/webadmin/public_html/cmm-uat/index.php(21): menu_execute_active_handler()
  
  ```
  
  **Tags:** error, iats
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2019-06-20. Score: 5 | Accepted answer
  
  Looks like you had already installed the extension on your instance (and removed it without properly uninstalling it\*). The table 'civicrm\_iats\_customer\_codes' already exists in your database. You can delete the table from if it doesn't have any data in it or change the sql statement in extension code to use 'CREATE IF NOT EXISTS'
  
  HTH
  
  username_1
  
  KarinG: \*if you properly uninstall the iATS Extension - the uninstall process will copy your civicrm\_iats\_customer\_codes to a backup table for safe keeping before deleting that table;
  
  > **Comments:**
  > **username_0**: Thanks! after deleting iats tables I was able to reinstall.  
  
  ---
  
  