Answers.Body: <p>Yeah, I had that too. You need to do an upgrade of the database on the extensions page.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-13T15:43:30.350Z
Answers.Text: This worked to resolve the DB Error, thanks! Unfortunately, I am back to square one on the "Could not identify any recipients. Perhaps your test group is empty..." error when trying to send messages.
Answers.UserDisplayName: SunriseGV
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-14T16:06:32.353Z
Answers.Text: hmm, I had that too. Which was caused by something completely different. We might need to make this a different topic if you have the same. One of my mailing groups had a smart group as subgroup. That makes the whole mailing group a smart group. Something went wrong with calculating it, so I had to give it another parent. Then the original Mailing group worked again.
Answers.UserDisplayName: Catorghans
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-14T17:29:14.603Z
Answers.Text: Interesting - yes, I opened another question here: https://civicrm.stackexchange.com/questions/42099/civimail-error-could-not-identify-recipients-when-sending-test-mailing
  
  So far I have been able to track the error I am receiving to some sort of denied auth request in the SparkPost mailing. It sounds like this error message has been around for a while and encompasses a huge number of issues. Not sure if more specific debugging info is logged anywhere. Didn't immediately see it in the CiviCRM ConfigAndLog
Answers.UserDisplayName: SunriseGV
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-06-13T12:52:37.480Z
Answers.LastActivityDate: 2022-06-13T12:52:37.480Z
Answers.UserDisplayName: Catorghans
Body: <h1>Basic Problem</h1>
  <p>When attempting to send a basic traditional mailing (though it also occurs in Mosaico), attempting to send a test email to a single address or a group fails, showing an error that says &quot;DB error: no such table&quot;. Based on debugging info, the table it is trying to access in my WordPress mySQL DB is &quot;civicrm_search_segment&quot; which does not show up in PHPmyAdmin for my Civi DB. Why is this table missing/why is the mailing failing?</p>
  <h2>More debugging info</h2>
  <ul>
  <li>CiviCRM version: 5.50.1 (problem occurred directly after upgrading from 5.49.4, see section below)</li>
  <li>WordPress version: 6.0</li>
  <li>mySQL version: 5.7.32</li>
  <li>PHP Version: 7.40.30</li>
  <li>Specific error text (see below)</li>
  </ul>
  <h2>History of the problem:</h2>
  <p>We started on CiviCRM Spark, and were able to send mailings there through our Gmail account. We decided to switch to a full CiviCRM hosted on a new WordPress site. We migrated from Spark (on Drupal) to the new WordPress site. The migration went okay, except that I could not get the connection to our Gmail account to work. (<em>One note here: during the migration, I created a new mySQL database in PHPMyAdmin separate from my CMS' database, imported the old Spark mySQL DB, and then changed Civi's config to point to the new database</em>) I went through the process of connecting Gmail via OAuth, and was able to successfully test the account as a Mail account (Administer &gt; CiviMail &gt; Mail Accounts) for bounce processing. I also manually entered the address as our FROM address. This was all in CiviCRM Version 5.49.4 (for WordPress).</p>
  <p>When I would try to send test emails, I would get an error saying &quot;Could not identify any recipients. Perhaps the group is empty?&quot; (as mentioned in other questions, [like this one][1]). I attempted multiple fixes, from recreating the mailing, ensuring the To addresses were not marked as &quot;On Hold&quot;, checking all tokens in the email for missing brackets, recreating the OAuth connection (using GCP and the Civi OAuth extension). Nothing fixed the problem. The last solution I tried was upgrading Civi from 5.49.4 to 5.50.1, which led me to this problem.</p>
  <p>Thanks much in advance!</p>
  <h2>Specific Error from log:</h2>
  <pre><code>(
      [callback] =&gt; Array
          (
              [0] =&gt; CRM_Core_Error
              [1] =&gt; exceptionHandler
          )
  
      [code] =&gt; -18
      [message] =&gt; DB Error: no such table
      [mode] =&gt; 16
      [debug_info] =&gt; SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`.`entity_name` AS `entity_name`, `a`.`items` AS `items`
  FROM civicrm_search_segment a
  ORDER BY `label` ASC
   [nativecode=1146 ** Table '\&lt;mySQL DB ID\&gt;.civicrm_search_segment' doesn't exist]
      [type] =&gt; DB_Error
      [user_info] =&gt; SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`.`entity_name` AS `entity_name`, `a`.`items` AS `items`
  FROM civicrm_search_segment a
  ORDER BY `label` ASC
   [nativecode=1146 ** Table '\&lt;mySQL DB ID\&gt;.civicrm_search_segment' doesn't exist]
      [to_string] =&gt; [db_error: message=&quot;DB Error: no such table&quot; code=-18 mode=callback callback=CRM_Core_Error::exceptionHandler prefix=&quot;&quot; info=&quot;SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`.`entity_name` AS `entity_name`, `a`.`items` AS `items`
  FROM civicrm_search_segment a
  ORDER BY `label` ASC
   [nativecode=1146 ** Table '\&lt;mySQL DB ID\&gt;.civicrm_search_segment' doesn't exist]&quot;]
  )```
  
  
  
    [1]: https://civicrm.stackexchange.com/questions/10671/mailing-issue-could-not-identify-any-recipients-perhaps-the-group-is-empty
  </code></pre>
  
Tags: <wordpress><civimail><error><mysql><mailing>
Title: CiviMail issue - "DB Error: no such table" when sending mailing
ThreadText: # CiviMail issue - "DB Error: no such table" when sending mailing
  
  (Asked by: username_0 on 2022-06-13)
  
  Basic Problem
  When attempting to send a basic traditional mailing (though it also occurs in Mosaico), attempting to send a test email to a single address or a group fails, showing an error that says "DB error: no such table". Based on debugging info, the table it is trying to access in my WordPress mySQL DB is "civicrm_search_segment" which does not show up in PHPmyAdmin for my Civi DB. Why is this table missing/why is the mailing failing?
  More debugging info
  
  CiviCRM version: 5.50.1 (problem occurred directly after upgrading from 5.49.4, see section below)
  WordPress version: 6.0
  mySQL version: 5.7.32
  PHP Version: 7.40.30
  Specific error text (see below)
  
  History of the problem:
  We started on CiviCRM Spark, and were able to send mailings there through our Gmail account. We decided to switch to a full CiviCRM hosted on a new WordPress site. We migrated from Spark (on Drupal) to the new WordPress site. The migration went okay, except that I could not get the connection to our Gmail account to work. (One note here: during the migration, I created a new mySQL database in PHPMyAdmin separate from my CMS' database, imported the old Spark mySQL DB, and then changed Civi's config to point to the new database) I went through the process of connecting Gmail via OAuth, and was able to successfully test the account as a Mail account (Administer > CiviMail > Mail Accounts) for bounce processing. I also manually entered the address as our FROM address. This was all in CiviCRM Version 5.49.4 (for WordPress).
  When I would try to send test emails, I would get an error saying "Could not identify any recipients. Perhaps the group is empty?" (as mentioned in other questions, [like this one][1]). I attempted multiple fixes, from recreating the mailing, ensuring the To addresses were not marked as "On Hold", checking all tokens in the email for missing brackets, recreating the OAuth connection (using GCP and the Civi OAuth extension). Nothing fixed the problem. The last solution I tried was upgrading Civi from 5.49.4 to 5.50.1, which led me to this problem.
  Thanks much in advance!
  Specific Error from log:
  (
      [callback] => Array
          (
              [0] => CRM_Core_Error
              [1] => exceptionHandler
          )
  
      [code] => -18
      [message] => DB Error: no such table
      [mode] => 16
      [debug_info] => SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`.`entity_name` AS `entity_name`, `a`.`items` AS `items`
  FROM civicrm_search_segment a
  ORDER BY `label` ASC
   [nativecode=1146 ** Table '\.civicrm_search_segment' doesn't exist]
      [type] => DB_Error
      [user_info] => SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`.`entity_name` AS `entity_name`, `a`.`items` AS `items`
  FROM civicrm_search_segment a
  ORDER BY `label` ASC
   [nativecode=1146 ** Table '\.civicrm_search_segment' doesn't exist]
      [to_string] => [db_error: message="DB Error: no such table" code=-18 mode=callback callback=CRM_Core_Error::exceptionHandler prefix="" info="SELECT `a`.`id` AS `id`, `a`.`name` AS `name`, `a`.`label` AS `label`, `a`.`description` AS `description`, `a`.`entity_name` AS `entity_name`, `a`.`items` AS `items`
  FROM civicrm_search_segment a
  ORDER BY `label` ASC
   [nativecode=1146 ** Table '\.civicrm_search_segment' doesn't exist]"]
  )```
  
  
  
    [1]: https://civicrm.stackexchange.com/questions/10671/mailing-issue-could-not-identify-any-recipients-perhaps-the-group-is-empty
  
  **Tags:** wordpress, civimail, error, mysql, mailing
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-06-13. Score: 0
  
  Yeah, I had that too. You need to do an upgrade of the database on the extensions page.
  
  > **Comments:**
  > **username_0**: This worked to resolve the DB Error, thanks! Unfortunately, I am back to square one on the "Could not identify any recipients. Perhaps your test group is empty..." error when trying to send messages.  
  > **username_1**: hmm, I had that too. Which was caused by something completely different. We might need to make this a different topic if you have the same. One of my mailing groups had a smart group as subgroup. That makes the whole mailing group a smart group. Something went wrong with calculating it, so I had to give it another parent. Then the original Mailing group worked again.  
  > **username_0**: Interesting - yes, I opened another question here: https://civicrm.stackexchange.com/questions/42099/civimail-error-could-not-identify-recipients-when-sending-test-mailing  So far I have been able to track the error I am receiving to some sort of denied auth request in the SparkPost mailing. It sounds like this error message has been around for a while and encompasses a huge number of issues. Not sure if more specific debugging info is logged anywhere. Didn't immediately see it in the CiviCRM ConfigAndLog  
  
  ---
  
  