Merge into household on Export Contact throws db error
Run a contact search. Select all contacts> Export contacts use Primary Fields Export Select "Merge Household Members into their Households" option. DB Error message appears
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. DB Error: unknown error Return to home page.
Just replicated this on the dmaster.demo site
Error message (generated from client site, not dmaster)
/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php(190): CRM_Core_Error::backtrace()
#1 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(921): CRM_Core_Error::handle(Object(DB_Error))
#2 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/DB.php(985): PEAR_Error->__construct("DB Error: no such field", -19, 16, (Array:2), "UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...")
#3 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(575): DB_Error->__construct(-19, 16, (Array:2), "UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...")
#4 /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/PEAR.php(223): PEAR->_raiseError(Object(DB_mysqli), NULL, -19, 16, (Array:2), "UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...", "DB_Error", TRUE)
#5 /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1907): PEAR->__call("raiseError", (Array:7))
#6 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(933): DB_common->raiseError(-19, NULL, NULL, "UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...", "1054 ** Unknown column '8_a_b_phone_type' in 'field list'")
#7 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/DB/mysqli.php(403): DB_mysqli->mysqliRaiseError()
#8 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/DB/common.php(1216): DB_mysqli->simpleQuery("UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...")
#9 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(2415): DB_common->query("UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...")
#10 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php(1607): DB_DataObject->_query("UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...")
#11 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(438): DB_DataObject->query("UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...")
#12 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php(1411): CRM_Core_DAO->query("UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...", TRUE)
#13 /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php(1193): CRM_Core_DAO::executeQuery("UPDATE civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294 SET civicrm_prim...")
#14 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Export/BAO/Export.php(598): CRM_Export_BAO_Export::mergeSameHousehold("civicrm_tmp_d_export_0ccdfcf5be23358219aae26db7a3f294", (Array:167), "8_a_b")
#15 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Export/Form/Select.php(427): CRM_Export_BAO_Export::exportComponents(TRUE, (Array:4215), (Array:4), "sort_name
asc, contact_a.id", NULL, NULL, 1, " contact_a.id IN ( 16766,12499,12391,8420,3592,6157,10798,5706,8326,3913,4173...", NULL, 0, 1, (Array:11), "AND")
#16 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Form.php(489): CRM_Export_Form_Select->postProcess()
#17 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/StateMachine.php(160): CRM_Core_Form->mainProcess()
#18 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/QuickForm/Action/Next.php(61): CRM_Core_StateMachine->perform(Object(CRM_Export_Form_Select), "next", "Next")
#19 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Controller.php(203): CRM_Core_QuickForm_Action_Next->perform(Object(CRM_Export_Form_Select), "next")
#20 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/packages/HTML/QuickForm/Page.php(103): HTML_QuickForm_Controller->handle(Object(CRM_Export_Form_Select), "next")
#21 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Controller.php(351): HTML_QuickForm_Page->handle("next")
#22 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(309): CRM_Core_Controller->run((Array:4), (Array:0))
#23 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(84): CRM_Core_Invoke::runItem((Array:13))
#24 /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm/CRM/Core/Invoke.php(52): CRM_Core_Invoke::_invoke((Array:4))
#25 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-content/plugins/civicrm/civicrm.php(1248): CRM_Core_Invoke::invoke((Array:4))
#26 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-includes/class-wp-hook.php(286): CiviCRM_For_WordPress->invoke("")
#27 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters("", (Array:1))
#28 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-includes/plugin.php(453): WP_Hook->do_action((Array:1))
#29 (closed) /home/orchestraofthesw/staging.orchestraoftheswan.org/wp-admin/admin.php(224): do_action("toplevel_page_CiviCRM")
#30 (closed) {main}
Have been able to run the export using Household merge, by using select fields/ field mapping options, rather than export primary fields.
Client site recently upgraded from 4.7.21 to 5.6.1