Answers.Body: <p>I looked at a system getting 'No database selected' from mailings.  The problem in that case was down to the hosting environment: a combination of throttling outbound mails and a short MySQL timeout caused the db connection to timeout before the status was updated, resulting in that error.  The solution there was to move to better hosting.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-18T21:06:02.630Z
Answers.Text: Thank you for the suggestion Aidan.  I will take it up with the hosting company.
Answers.UserDisplayName: The Amateur
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2024-04-18T17:15:58.110Z
Answers.LastActivityDate: 2024-04-18T17:15:58.110Z
Answers.UserDisplayName: Aidan
Body: <p>I am using CiviCRM 5.71.1 with WordPRess 6.4.3, but this issue has been going on for a long time and I am, as they say, &quot;at Witt's end&quot; (yes, that spelling :-)</p>
  <p>When I try to send a scheduled mailing, it fails to complete and I get a long error in the log which I am sorry to have to burden you with below. Note that I had to truncate the error message in order to comply with the 30K character limit here. Can anyone please tell me how to fix this issue? Thanks.</p>
  <pre><code>[error] 
  $Fatal Error Details = array:3 [
    &quot;message&quot; =&gt; &quot;DB Error: no database selected&quot;
    &quot;code&quot; =&gt; null
    &quot;exception&quot; =&gt; Civi\Core\Exception\DBQueryException {#3918
      #message: &quot;DB Error: no database selected&quot;
      #code: 0
      #file: &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php&quot;
      #line: 971
      #cause: DB_Error {#3857
        +error_message_prefix: &quot;&quot;
        +mode: 16
        +level: 1024
        +code: -14
        +message: &quot;DB Error: no database selected&quot;
        +userinfo: &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]&quot;
        +backtrace: array:30 [
          0 =&gt; array:6 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php&quot;
            &quot;line&quot; =&gt; 1001
            &quot;function&quot; =&gt; &quot;__construct&quot;
            &quot;class&quot; =&gt; &quot;PEAR_Error&quot;
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; array:5 [
              0 =&gt; &quot;DB Error: no database selected&quot;
              1 =&gt; -14
              2 =&gt; 16
              3 =&gt; array:2 [
                0 =&gt; &quot;CRM_Core_Error&quot;
                1 =&gt; &quot;exceptionHandler&quot;
              ]
              4 =&gt; &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]&quot;
            ]
          ]
          1 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php&quot;
            &quot;line&quot; =&gt; 575
            &quot;function&quot; =&gt; &quot;__construct&quot;
            &quot;class&quot; =&gt; &quot;DB_Error&quot;
            &quot;object&quot; =&gt; DB_Error {#3857}
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; array:4 [
              0 =&gt; -14
              1 =&gt; 16
              2 =&gt; array:2 [
                0 =&gt; &quot;CRM_Core_Error&quot;
                1 =&gt; &quot;exceptionHandler&quot;
              ]
              3 =&gt; &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]&quot;
            ]
          ]
          2 =&gt; array:6 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php&quot;
            &quot;line&quot; =&gt; 223
            &quot;function&quot; =&gt; &quot;_raiseError&quot;
            &quot;class&quot; =&gt; &quot;PEAR&quot;
            &quot;type&quot; =&gt; &quot;::&quot;
            &quot;args&quot; =&gt; array:8 [
              0 =&gt; DB_mysqli {#1284
                +_debug: false
                +_default_error_mode: null
                +_default_error_options: null
                +_default_error_handler: &quot;&quot;
                +_error_class: &quot;DB_Error&quot;
                +_expected_errors: []
                +fetchmode: 1
                +fetchmode_object_class: &quot;stdClass&quot;
                +was_connected: null
                +last_query: &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' ) &quot;
                +options: array:8 [
                  &quot;result_buffering&quot; =&gt; 500
                  &quot;persistent&quot; =&gt; false
                  &quot;ssl&quot; =&gt; false
                  &quot;debug&quot; =&gt; 0
                  &quot;seqname_format&quot; =&gt; &quot;%s_seq&quot;
                  &quot;autofree&quot; =&gt; false
                  &quot;portability&quot; =&gt; 0
                  &quot;optimize&quot; =&gt; &quot;performance&quot;
                ]
                +last_parameters: []
                +prepare_tokens: []
                +prepare_types: []
                +prepared_queries: []
                +_last_query_manip: true
                +_next_query_manip: false
                +phptype: &quot;mysqli&quot;
                +dbsyntax: &quot;mysqli&quot;
                +features: array:7 [
                  &quot;limit&quot; =&gt; &quot;alter&quot;
                  &quot;new_link&quot; =&gt; false
                  &quot;numrows&quot; =&gt; true
                  &quot;pconnect&quot; =&gt; false
                  &quot;prepare&quot; =&gt; false
                  &quot;ssl&quot; =&gt; true
                  &quot;transactions&quot; =&gt; true
                ]
                +errorcode_map: array:29 [
                  1004 =&gt; -15
                  1005 =&gt; -15
                  1006 =&gt; -15
                  1007 =&gt; -5
                  1008 =&gt; -17
                  1022 =&gt; -5
                  1044 =&gt; -26
                  1046 =&gt; -14
                  1048 =&gt; -3
                  1049 =&gt; -27
                  1050 =&gt; -5
                  1051 =&gt; -18
                  1054 =&gt; -19
                  1061 =&gt; -5
                  1062 =&gt; -5
                  1064 =&gt; -2
                  1091 =&gt; -4
                  1100 =&gt; -21
                  1136 =&gt; -22
                  1142 =&gt; -26
                  1146 =&gt; -18
                  1205 =&gt; -30
                  1213 =&gt; -31
                  1216 =&gt; -3
                  1217 =&gt; -3
                  1356 =&gt; &quot;-32&quot;
                  1365 =&gt; -13
                  1451 =&gt; -3
                  1452 =&gt; -3
                ]
                +connection: mysqli {#1285}
                +dsn: array:10 [
                  &quot;phptype&quot; =&gt; &quot;mysqli&quot;
                  &quot;dbsyntax&quot; =&gt; &quot;mysqli&quot;
                  &quot;username&quot; =&gt; &quot;REDACTED_REDACTED&quot;
                  &quot;password&quot; =&gt; &quot;REDACTED&quot;
                  &quot;protocol&quot; =&gt; &quot;tcp&quot;
                  &quot;hostspec&quot; =&gt; &quot;localhost&quot;
                  &quot;port&quot; =&gt; false
                  &quot;socket&quot; =&gt; false
                  &quot;database&quot; =&gt; &quot;REDACTED_REDACTED&quot;
                  &quot;new_link&quot; =&gt; &quot;true&quot;
                ]
                +autocommit: true
                +transaction_opcount: 0
                +_db: &quot;REDACTED_REDACTED&quot;
                +mysqli_flags: array:11 [
                  1 =&gt; &quot;not_null&quot;
                  2 =&gt; &quot;primary_key&quot;
                  4 =&gt; &quot;unique_key&quot;
                  8 =&gt; &quot;multiple_key&quot;
                  16 =&gt; &quot;blob&quot;
                  32 =&gt; &quot;unsigned&quot;
                  64 =&gt; &quot;zerofill&quot;
                  512 =&gt; &quot;auto_increment&quot;
                  1024 =&gt; &quot;timestamp&quot;
                  2048 =&gt; &quot;set&quot;
                  32768 =&gt; &quot;group_by&quot;
                ]
                +mysqli_types: array:25 [
                  0 =&gt; &quot;decimal&quot;
                  1 =&gt; &quot;tinyint&quot;
                  2 =&gt; &quot;int&quot;
                  3 =&gt; &quot;int&quot;
                  4 =&gt; &quot;float&quot;
                  5 =&gt; &quot;double&quot;
                  7 =&gt; &quot;timestamp&quot;
                  8 =&gt; &quot;bigint&quot;
                  9 =&gt; &quot;mediumint&quot;
                  10 =&gt; &quot;date&quot;
                  11 =&gt; &quot;time&quot;
                  12 =&gt; &quot;datetime&quot;
                  13 =&gt; &quot;year&quot;
                  14 =&gt; &quot;date&quot;
                  247 =&gt; &quot;enum&quot;
                  248 =&gt; &quot;set&quot;
                  249 =&gt; &quot;tinyblob&quot;
                  250 =&gt; &quot;mediumblob&quot;
                  251 =&gt; &quot;longblob&quot;
                  252 =&gt; &quot;blob&quot;
                  253 =&gt; &quot;varchar&quot;
                  254 =&gt; &quot;char&quot;
                  255 =&gt; &quot;geometry&quot;
                  16 =&gt; &quot;bit&quot;
                  246 =&gt; &quot;decimal&quot;
                ]
              }
              1 =&gt; null
              2 =&gt; -14
              3 =&gt; 16
              4 =&gt; array:2 [
                0 =&gt; &quot;CRM_Core_Error&quot;
                1 =&gt; &quot;exceptionHandler&quot;
              ]
              5 =&gt; &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]&quot;
              6 =&gt; &quot;DB_Error&quot;
              7 =&gt; true
            ]
          ]
          3 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php&quot;
            &quot;line&quot; =&gt; 1952
            &quot;function&quot; =&gt; &quot;__call&quot;
            &quot;class&quot; =&gt; &quot;PEAR&quot;
            &quot;object&quot; =&gt; DB_mysqli {#1284}
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; array:2 [
              0 =&gt; &quot;raiseError&quot;
              1 =&gt; array:7 [
                0 =&gt; null
                1 =&gt; -14
                2 =&gt; null
                3 =&gt; null
                4 =&gt; &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]&quot;
                5 =&gt; &quot;DB_Error&quot;
                6 =&gt; true
              ]
            ]
          ]
          4 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php&quot;
            &quot;line&quot; =&gt; 966
            &quot;function&quot; =&gt; &quot;raiseError&quot;
            &quot;class&quot; =&gt; &quot;DB_common&quot;
            &quot;object&quot; =&gt; DB_mysqli {#1284}
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; array:5 [
              0 =&gt; -14
              1 =&gt; null
              2 =&gt; null
              3 =&gt; &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]&quot;
              4 =&gt; &quot;2006 ** MySQL server has gone away&quot;
            ]
          ]
          5 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php&quot;
            &quot;line&quot; =&gt; 398
            &quot;function&quot; =&gt; &quot;mysqliRaiseError&quot;
            &quot;class&quot; =&gt; &quot;DB_mysqli&quot;
            &quot;object&quot; =&gt; DB_mysqli {#1284}
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; array:1 [
              0 =&gt; -14
            ]
          ]
          6 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php&quot;
            &quot;line&quot; =&gt; 1241
            &quot;function&quot; =&gt; &quot;simpleQuery&quot;
            &quot;class&quot; =&gt; &quot;DB_mysqli&quot;
            &quot;object&quot; =&gt; DB_mysqli {#1284}
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; array:1 [
              0 =&gt; &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' ) &quot;
            ]
          ]
          7 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php&quot;
            &quot;line&quot; =&gt; 2696
            &quot;function&quot; =&gt; &quot;query&quot;
            &quot;class&quot; =&gt; &quot;DB_common&quot;
            &quot;object&quot; =&gt; DB_mysqli {#1284}
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; array:1 [
              0 =&gt; &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' ) &quot;
            ]
          ]
          8 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php&quot;
            &quot;line&quot; =&gt; 1245
            &quot;function&quot; =&gt; &quot;_query&quot;
            &quot;class&quot; =&gt; &quot;DB_DataObject&quot;
            &quot;object&quot; =&gt; CRM_Core_DAO_JobLog {#3832
              +_DB_DataObject_version: &quot;1.11.3&quot;
              +__table: &quot;civicrm_job_log&quot;
              +N: 0
              +_database_dsn: &quot;&quot;
              +_database_dsn_md5: &quot;8b8d93655162a3012db382eebbf95622&quot;
              +_database: &quot;REDACTED_REDACTED&quot;
              +_query: array:11 [
                &quot;condition&quot; =&gt; &quot;&quot;
                &quot;group_by&quot; =&gt; &quot;&quot;
                &quot;order_by&quot; =&gt; &quot;&quot;
                &quot;having&quot; =&gt; &quot;&quot;
                &quot;useindex&quot; =&gt; &quot;&quot;
                &quot;limit_start&quot; =&gt; &quot;&quot;
                &quot;limit_count&quot; =&gt; &quot;&quot;
                &quot;data_select&quot; =&gt; &quot;*&quot;
                &quot;unions&quot; =&gt; []
                &quot;derive_table&quot; =&gt; &quot;&quot;
                &quot;derive_select&quot; =&gt; &quot;&quot;
              ]
              +_DB_resultid: null
              +_resultFields: false
              +_link_loaded: false
              +_join: &quot;&quot;
              +_lastError: false
              #resultCopies: 0
              #_options: []
              +id: null
              +domain_id: 1
              +run_time: null
              +job_id: &quot;2&quot;
              +name: &quot;Send Scheduled Mailings&quot;
              +command: &quot;Entity: Job Action: process_mailing&quot;
              +description: &quot;Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected&quot;
              +data: &quot;&quot;&quot;
                \n
                \n
                Parameters parsed (and passed to API method): \n
                a:1:{s:7:&quot;version&quot;;i:3;}\n
                \n
                Full message: \n
                Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected
                &quot;&quot;&quot;
            }
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; array:1 [
              0 =&gt; &quot;INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\&quot;version\&quot;;i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' ) &quot;
            ]
          ]
          9 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php&quot;
            &quot;line&quot; =&gt; 738
            &quot;function&quot; =&gt; &quot;insert&quot;
            &quot;class&quot; =&gt; &quot;DB_DataObject&quot;
            &quot;object&quot; =&gt; CRM_Core_DAO_JobLog {#3832}
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; []
          ]
          10 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php&quot;
            &quot;line&quot; =&gt; 247
            &quot;function&quot; =&gt; &quot;save&quot;
            &quot;class&quot; =&gt; &quot;CRM_Core_DAO&quot;
            &quot;object&quot; =&gt; CRM_Core_DAO_JobLog {#3832}
            &quot;type&quot; =&gt; &quot;-&gt;&quot;
            &quot;args&quot; =&gt; []
          ]
          11 =&gt; array:7 [
            &quot;file&quot; =&gt; &quot;/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php&quot;
            &quot;line&quot; =&gt; 132
            &quot;function&quot; =&gt; &quot;logEntry&quot;
            &quot;class&quot; =&gt; &quot;CRM_Core_JobManager&quot;
            &quot;object&quot; =&gt; CRM_Core_JobManager {#3285
              +jobs: array:27 [
                25 =&gt; CRM_Core_ScheduledJob {#3275
                  +id: &quot;25&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Hourly&quot;
                  +last_run: &quot;2024-03-31 16:00:11&quot;
                  +scheduled_run_date: null
                  +name: &quot;Call SumFields.Gendata API&quot;
                  +description: &quot;Call SumFields.Gendata API&quot;
                  +api_entity: &quot;SumFields&quot;
                  +api_action: &quot;Gendata&quot;
                  +parameters: null
                  +is_active: &quot;1&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                1 =&gt; CRM_Core_ScheduledJob {#3276
                  +id: &quot;1&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Daily&quot;
                  +last_run: &quot;2024-03-31 02:00:09&quot;
                  +scheduled_run_date: null
                  +name: &quot;CiviCRM Update Check&quot;
                  +description: &quot;Checks for CiviCRM version updates. Important for keeping the database secure. Also sends anonymous usage statistics to civicrm.org to to assist in prioritizing ongoing development efforts.&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;version_check&quot;
                  +parameters: null
                  +is_active: &quot;1&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                19 =&gt; CRM_Core_ScheduledJob {#3277
                  +id: &quot;19&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Always&quot;
                  +last_run: &quot;2024-03-31 16:00:12&quot;
                  +scheduled_run_date: null
                  +name: &quot;Civirules cron&quot;
                  +description: &quot;Trigger civirules cron triggers&quot;
                  +api_entity: &quot;Civirules&quot;
                  +api_action: &quot;Cron&quot;
                  +parameters: null
                  +is_active: &quot;1&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                13 =&gt; CRM_Core_ScheduledJob {#3278
                  +id: &quot;13&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Hourly&quot;
                  +last_run: null
                  +scheduled_run_date: null
                  +name: &quot;Clean-up Temporary Data and Files&quot;
                  +description: &quot;Removes temporary data and files, and clears old data from cache tables. Recommend running this job every hour to help prevent database and file system bloat.&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;cleanup&quot;
                  +parameters: null
                  +is_active: &quot;0&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                16 =&gt; CRM_Core_ScheduledJob {#3279
                  +id: &quot;16&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Daily&quot;
                  +last_run: null
                  +scheduled_run_date: null
                  +name: &quot;Disable expired relationships&quot;
                  +description: &quot;Disables relationships that have expired (ie. those relationships whose end date is in the past).&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;disable_expired_relationships&quot;
                  +parameters: null
                  +is_active: &quot;0&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                3 =&gt; CRM_Core_ScheduledJob {#3280
                  +id: &quot;3&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Hourly&quot;
                  +last_run: null
                  +scheduled_run_date: null
                  +name: &quot;Fetch Bounces&quot;
                  +description: &quot;Fetches bounces from mailings and writes them to mailing statistics&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;fetch_bounces&quot;
                  +parameters: null
                  +is_active: &quot;0&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                20 =&gt; CRM_Core_ScheduledJob {#3281
                  +id: &quot;20&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Daily&quot;
                  +last_run: &quot;2024-03-31 02:00:09&quot;
                  +scheduled_run_date: null
                  +name: &quot;Firewall: Cleanup&quot;
                  +description: &quot;Cleanup firewall table data&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;firewall_cleanup&quot;
                  +parameters: &quot;delete_old_ipaddress=-1 month&quot;
                  +is_active: &quot;1&quot;
                  +action: null
                  +class: null
                  +apiParams: array:2 [
                    &quot;version&quot; =&gt; 3
                    &quot;delete_old_ipaddress&quot; =&gt; &quot;-1 month&quot;
                  ]
                  +remarks: []
                }
                6 =&gt; CRM_Core_ScheduledJob {#3282
                  +id: &quot;6&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Daily&quot;
                  +last_run: null
                  +scheduled_run_date: null
                  +name: &quot;Geocode and Parse Addresses&quot;
                  +description: &quot;Retrieves geocodes (lat and long) and / or parses street addresses (populates street number, street name, etc.)&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;geocode&quot;
                  +parameters: &quot;&quot;&quot;
                    geocoding=[1 or 0] required\n
                    parse=[1 or 0] required\n
                    start=[contact ID] optional-begin with this contact ID\n
                    end=[contact ID] optional-process contacts with IDs less than this\n
                    throttle=[1 or 0] optional-1 adds five second sleep
                    &quot;&quot;&quot;
                  +is_active: &quot;0&quot;
                  +action: null
                  +class: null
                  +apiParams: array:6 [
                    &quot;version&quot; =&gt; 3
                    &quot;geocoding&quot; =&gt; &quot;[1 or 0] required&quot;
                    &quot;parse&quot; =&gt; &quot;[1 or 0] required&quot;
                    &quot;start&quot; =&gt; &quot;[contact ID] optional-begin with this contact ID&quot;
                    &quot;end&quot; =&gt; &quot;[contact ID] optional-process contacts with IDs less than this&quot;
                    &quot;throttle&quot; =&gt; &quot;[1 or 0] optional-1 adds five second sleep&quot;
                  ]
                  +remarks: []
                }
                26 =&gt; CRM_Core_ScheduledJob {#3283
                  +id: &quot;26&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Hourly&quot;
                  +last_run: &quot;2024-03-31 16:00:12&quot;
                  +scheduled_run_date: null
                  +name: &quot;iATS Payments 1stPay Query Transactions&quot;
                  +description: &quot;Call into iATS Payments 1stPay to get transactions (for auditing and verifying).&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;fapsquery&quot;
                  +parameters: null
                  +is_active: &quot;1&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                28 =&gt; CRM_Core_ScheduledJob {#3284
                  +id: &quot;28&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Hourly&quot;
                  +last_run: &quot;2024-03-31 16:00:12&quot;
                  +scheduled_run_date: null
                  +name: &quot;iATS Payments Get Legacy Transaction Journal&quot;
                  +description: &quot;Call into iATS to get transaction journals, legacy processor (for auditing and verifying).&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;iatsreport&quot;
                  +parameters: null
                  +is_active: &quot;1&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                27 =&gt; CRM_Core_ScheduledJob {#3272
                  +id: &quot;27&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Daily&quot;
                  +last_run: &quot;2024-03-30 18:00:13&quot;
                  +scheduled_run_date: null
                  +name: &quot;iATS Payments Recurring Contributions&quot;
                  +description: &quot;Trigger + Generate recurring contributions for iATS Payments&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;iatsrecurringcontributions&quot;
                  +parameters: null
                  +is_active: &quot;1&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
                }
                29 =&gt; CRM_Core_ScheduledJob {#3270
                  +id: &quot;29&quot;
                  +domain_id: &quot;1&quot;
                  +run_frequency: &quot;Hourly&quot;
                  +last_run: &quot;2024-03-31 16:00:12&quot;
                  +scheduled_run_date: null
                  +name: &quot;iATS Payments Verification&quot;
                  +description: &quot;Verify payments from the iATS journal.&quot;
                  +api_entity: &quot;Job&quot;
                  +api_action: &quot;iatsverify&quot;
                  +parameters: null
                  +is_active: &quot;1&quot;
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    &quot;version&quot; =&gt; 3
                  ]
                  +remarks: []
              
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-01T04:38:54.497Z
Comments.Text: p.s. Outbound email is set to mail and test messages work.
Comments.UserDisplayName: The Amateur
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2024-04-04T16:21:23.573Z
Comments.Text: Please, can anyone offer any insights based on the error log?
Comments.UserDisplayName: The Amateur
Tags: <wordpress><civimail><error><database><mailing>
Title: Why are my mailings failing with "DB Error: no database selected"
ThreadText: # Why are my mailings failing with "DB Error: no database selected"
  
  (Asked by: username_0 on 2024-04-01)
  
  I am using CiviCRM 5.71.1 with WordPRess 6.4.3, but this issue has been going on for a long time and I am, as they say, "at Witt's end" (yes, that spelling :-)
  When I try to send a scheduled mailing, it fails to complete and I get a long error in the log which I am sorry to have to burden you with below. Note that I had to truncate the error message in order to comply with the 30K character limit here. Can anyone please tell me how to fix this issue? Thanks.
  [error] 
  $Fatal Error Details = array:3 [
    "message" => "DB Error: no database selected"
    "code" => null
    "exception" => Civi\Core\Exception\DBQueryException {#3918
      #message: "DB Error: no database selected"
      #code: 0
      #file: "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/Error.php"
      #line: 971
      #cause: DB_Error {#3857
        +error_message_prefix: ""
        +mode: 16
        +level: 1024
        +code: -14
        +message: "DB Error: no database selected"
        +userinfo: "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]"
        +backtrace: array:30 [
          0 => array:6 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB.php"
            "line" => 1001
            "function" => "__construct"
            "class" => "PEAR_Error"
            "type" => "->"
            "args" => array:5 [
              0 => "DB Error: no database selected"
              1 => -14
              2 => 16
              3 => array:2 [
                0 => "CRM_Core_Error"
                1 => "exceptionHandler"
              ]
              4 => "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]"
            ]
          ]
          1 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php"
            "line" => 575
            "function" => "__construct"
            "class" => "DB_Error"
            "object" => DB_Error {#3857}
            "type" => "->"
            "args" => array:4 [
              0 => -14
              1 => 16
              2 => array:2 [
                0 => "CRM_Core_Error"
                1 => "exceptionHandler"
              ]
              3 => "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]"
            ]
          ]
          2 => array:6 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/pear-core-minimal/src/PEAR.php"
            "line" => 223
            "function" => "_raiseError"
            "class" => "PEAR"
            "type" => "::"
            "args" => array:8 [
              0 => DB_mysqli {#1284
                +_debug: false
                +_default_error_mode: null
                +_default_error_options: null
                +_default_error_handler: ""
                +_error_class: "DB_Error"
                +_expected_errors: []
                +fetchmode: 1
                +fetchmode_object_class: "stdClass"
                +was_connected: null
                +last_query: "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' ) "
                +options: array:8 [
                  "result_buffering" => 500
                  "persistent" => false
                  "ssl" => false
                  "debug" => 0
                  "seqname_format" => "%s_seq"
                  "autofree" => false
                  "portability" => 0
                  "optimize" => "performance"
                ]
                +last_parameters: []
                +prepare_tokens: []
                +prepare_types: []
                +prepared_queries: []
                +_last_query_manip: true
                +_next_query_manip: false
                +phptype: "mysqli"
                +dbsyntax: "mysqli"
                +features: array:7 [
                  "limit" => "alter"
                  "new_link" => false
                  "numrows" => true
                  "pconnect" => false
                  "prepare" => false
                  "ssl" => true
                  "transactions" => true
                ]
                +errorcode_map: array:29 [
                  1004 => -15
                  1005 => -15
                  1006 => -15
                  1007 => -5
                  1008 => -17
                  1022 => -5
                  1044 => -26
                  1046 => -14
                  1048 => -3
                  1049 => -27
                  1050 => -5
                  1051 => -18
                  1054 => -19
                  1061 => -5
                  1062 => -5
                  1064 => -2
                  1091 => -4
                  1100 => -21
                  1136 => -22
                  1142 => -26
                  1146 => -18
                  1205 => -30
                  1213 => -31
                  1216 => -3
                  1217 => -3
                  1356 => "-32"
                  1365 => -13
                  1451 => -3
                  1452 => -3
                ]
                +connection: mysqli {#1285}
                +dsn: array:10 [
                  "phptype" => "mysqli"
                  "dbsyntax" => "mysqli"
                  "username" => "REDACTED_REDACTED"
                  "password" => "REDACTED"
                  "protocol" => "tcp"
                  "hostspec" => "localhost"
                  "port" => false
                  "socket" => false
                  "database" => "REDACTED_REDACTED"
                  "new_link" => "true"
                ]
                +autocommit: true
                +transaction_opcount: 0
                +_db: "REDACTED_REDACTED"
                +mysqli_flags: array:11 [
                  1 => "not_null"
                  2 => "primary_key"
                  4 => "unique_key"
                  8 => "multiple_key"
                  16 => "blob"
                  32 => "unsigned"
                  64 => "zerofill"
                  512 => "auto_increment"
                  1024 => "timestamp"
                  2048 => "set"
                  32768 => "group_by"
                ]
                +mysqli_types: array:25 [
                  0 => "decimal"
                  1 => "tinyint"
                  2 => "int"
                  3 => "int"
                  4 => "float"
                  5 => "double"
                  7 => "timestamp"
                  8 => "bigint"
                  9 => "mediumint"
                  10 => "date"
                  11 => "time"
                  12 => "datetime"
                  13 => "year"
                  14 => "date"
                  247 => "enum"
                  248 => "set"
                  249 => "tinyblob"
                  250 => "mediumblob"
                  251 => "longblob"
                  252 => "blob"
                  253 => "varchar"
                  254 => "char"
                  255 => "geometry"
                  16 => "bit"
                  246 => "decimal"
                ]
              }
              1 => null
              2 => -14
              3 => 16
              4 => array:2 [
                0 => "CRM_Core_Error"
                1 => "exceptionHandler"
              ]
              5 => "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]"
              6 => "DB_Error"
              7 => true
            ]
          ]
          3 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php"
            "line" => 1952
            "function" => "__call"
            "class" => "PEAR"
            "object" => DB_mysqli {#1284}
            "type" => "->"
            "args" => array:2 [
              0 => "raiseError"
              1 => array:7 [
                0 => null
                1 => -14
                2 => null
                3 => null
                4 => "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]"
                5 => "DB_Error"
                6 => true
              ]
            ]
          ]
          4 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php"
            "line" => 966
            "function" => "raiseError"
            "class" => "DB_common"
            "object" => DB_mysqli {#1284}
            "type" => "->"
            "args" => array:5 [
              0 => -14
              1 => null
              2 => null
              3 => "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' )  [nativecode=2006 ** MySQL server has gone away]"
              4 => "2006 ** MySQL server has gone away"
            ]
          ]
          5 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/mysqli.php"
            "line" => 398
            "function" => "mysqliRaiseError"
            "class" => "DB_mysqli"
            "object" => DB_mysqli {#1284}
            "type" => "->"
            "args" => array:1 [
              0 => -14
            ]
          ]
          6 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/vendor/pear/db/DB/common.php"
            "line" => 1241
            "function" => "simpleQuery"
            "class" => "DB_mysqli"
            "object" => DB_mysqli {#1284}
            "type" => "->"
            "args" => array:1 [
              0 => "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' ) "
            ]
          ]
          7 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php"
            "line" => 2696
            "function" => "query"
            "class" => "DB_common"
            "object" => DB_mysqli {#1284}
            "type" => "->"
            "args" => array:1 [
              0 => "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' ) "
            ]
          ]
          8 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/packages/DB/DataObject.php"
            "line" => 1245
            "function" => "_query"
            "class" => "DB_DataObject"
            "object" => CRM_Core_DAO_JobLog {#3832
              +_DB_DataObject_version: "1.11.3"
              +__table: "civicrm_job_log"
              +N: 0
              +_database_dsn: ""
              +_database_dsn_md5: "8b8d93655162a3012db382eebbf95622"
              +_database: "REDACTED_REDACTED"
              +_query: array:11 [
                "condition" => ""
                "group_by" => ""
                "order_by" => ""
                "having" => ""
                "useindex" => ""
                "limit_start" => ""
                "limit_count" => ""
                "data_select" => "*"
                "unions" => []
                "derive_table" => ""
                "derive_select" => ""
              ]
              +_DB_resultid: null
              +_resultFields: false
              +_link_loaded: false
              +_join: ""
              +_lastError: false
              #resultCopies: 0
              #_options: []
              +id: null
              +domain_id: 1
              +run_time: null
              +job_id: "2"
              +name: "Send Scheduled Mailings"
              +command: "Entity: Job Action: process_mailing"
              +description: "Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected"
              +data: """
                \n
                \n
                Parameters parsed (and passed to API method): \n
                a:1:{s:7:"version";i:3;}\n
                \n
                Full message: \n
                Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected
                """
            }
            "type" => "->"
            "args" => array:1 [
              0 => "INSERT INTO `civicrm_job_log` (`domain_id` , `job_id` , `name` , `command` , `description` , `data` ) VALUES ( 1 ,  2 , 'Send Scheduled Mailings' , 'Entity: Job Action: process_mailing' , 'Finished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' , '\n\nParameters parsed (and passed to API method): \na:1:{s:7:\"version\";i:3;}\n\nFull message: \nFinished execution of Send Scheduled Mailings with result: Failure, Error message: DB Error: no database selected' ) "
            ]
          ]
          9 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/DAO.php"
            "line" => 738
            "function" => "insert"
            "class" => "DB_DataObject"
            "object" => CRM_Core_DAO_JobLog {#3832}
            "type" => "->"
            "args" => []
          ]
          10 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php"
            "line" => 247
            "function" => "save"
            "class" => "CRM_Core_DAO"
            "object" => CRM_Core_DAO_JobLog {#3832}
            "type" => "->"
            "args" => []
          ]
          11 => array:7 [
            "file" => "/home/REDACTED/public_html/wp-content/plugins/civicrm/civicrm/CRM/Core/JobManager.php"
            "line" => 132
            "function" => "logEntry"
            "class" => "CRM_Core_JobManager"
            "object" => CRM_Core_JobManager {#3285
              +jobs: array:27 [
                25 => CRM_Core_ScheduledJob {#3275
                  +id: "25"
                  +domain_id: "1"
                  +run_frequency: "Hourly"
                  +last_run: "2024-03-31 16:00:11"
                  +scheduled_run_date: null
                  +name: "Call SumFields.Gendata API"
                  +description: "Call SumFields.Gendata API"
                  +api_entity: "SumFields"
                  +api_action: "Gendata"
                  +parameters: null
                  +is_active: "1"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                1 => CRM_Core_ScheduledJob {#3276
                  +id: "1"
                  +domain_id: "1"
                  +run_frequency: "Daily"
                  +last_run: "2024-03-31 02:00:09"
                  +scheduled_run_date: null
                  +name: "CiviCRM Update Check"
                  +description: "Checks for CiviCRM version updates. Important for keeping the database secure. Also sends anonymous usage statistics to civicrm.org to to assist in prioritizing ongoing development efforts."
                  +api_entity: "Job"
                  +api_action: "version_check"
                  +parameters: null
                  +is_active: "1"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                19 => CRM_Core_ScheduledJob {#3277
                  +id: "19"
                  +domain_id: "1"
                  +run_frequency: "Always"
                  +last_run: "2024-03-31 16:00:12"
                  +scheduled_run_date: null
                  +name: "Civirules cron"
                  +description: "Trigger civirules cron triggers"
                  +api_entity: "Civirules"
                  +api_action: "Cron"
                  +parameters: null
                  +is_active: "1"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                13 => CRM_Core_ScheduledJob {#3278
                  +id: "13"
                  +domain_id: "1"
                  +run_frequency: "Hourly"
                  +last_run: null
                  +scheduled_run_date: null
                  +name: "Clean-up Temporary Data and Files"
                  +description: "Removes temporary data and files, and clears old data from cache tables. Recommend running this job every hour to help prevent database and file system bloat."
                  +api_entity: "Job"
                  +api_action: "cleanup"
                  +parameters: null
                  +is_active: "0"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                16 => CRM_Core_ScheduledJob {#3279
                  +id: "16"
                  +domain_id: "1"
                  +run_frequency: "Daily"
                  +last_run: null
                  +scheduled_run_date: null
                  +name: "Disable expired relationships"
                  +description: "Disables relationships that have expired (ie. those relationships whose end date is in the past)."
                  +api_entity: "Job"
                  +api_action: "disable_expired_relationships"
                  +parameters: null
                  +is_active: "0"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                3 => CRM_Core_ScheduledJob {#3280
                  +id: "3"
                  +domain_id: "1"
                  +run_frequency: "Hourly"
                  +last_run: null
                  +scheduled_run_date: null
                  +name: "Fetch Bounces"
                  +description: "Fetches bounces from mailings and writes them to mailing statistics"
                  +api_entity: "Job"
                  +api_action: "fetch_bounces"
                  +parameters: null
                  +is_active: "0"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                20 => CRM_Core_ScheduledJob {#3281
                  +id: "20"
                  +domain_id: "1"
                  +run_frequency: "Daily"
                  +last_run: "2024-03-31 02:00:09"
                  +scheduled_run_date: null
                  +name: "Firewall: Cleanup"
                  +description: "Cleanup firewall table data"
                  +api_entity: "Job"
                  +api_action: "firewall_cleanup"
                  +parameters: "delete_old_ipaddress=-1 month"
                  +is_active: "1"
                  +action: null
                  +class: null
                  +apiParams: array:2 [
                    "version" => 3
                    "delete_old_ipaddress" => "-1 month"
                  ]
                  +remarks: []
                }
                6 => CRM_Core_ScheduledJob {#3282
                  +id: "6"
                  +domain_id: "1"
                  +run_frequency: "Daily"
                  +last_run: null
                  +scheduled_run_date: null
                  +name: "Geocode and Parse Addresses"
                  +description: "Retrieves geocodes (lat and long) and / or parses street addresses (populates street number, street name, etc.)"
                  +api_entity: "Job"
                  +api_action: "geocode"
                  +parameters: """
                    geocoding=[1 or 0] required\n
                    parse=[1 or 0] required\n
                    start=[contact ID] optional-begin with this contact ID\n
                    end=[contact ID] optional-process contacts with IDs less than this\n
                    throttle=[1 or 0] optional-1 adds five second sleep
                    """
                  +is_active: "0"
                  +action: null
                  +class: null
                  +apiParams: array:6 [
                    "version" => 3
                    "geocoding" => "[1 or 0] required"
                    "parse" => "[1 or 0] required"
                    "start" => "[contact ID] optional-begin with this contact ID"
                    "end" => "[contact ID] optional-process contacts with IDs less than this"
                    "throttle" => "[1 or 0] optional-1 adds five second sleep"
                  ]
                  +remarks: []
                }
                26 => CRM_Core_ScheduledJob {#3283
                  +id: "26"
                  +domain_id: "1"
                  +run_frequency: "Hourly"
                  +last_run: "2024-03-31 16:00:12"
                  +scheduled_run_date: null
                  +name: "iATS Payments 1stPay Query Transactions"
                  +description: "Call into iATS Payments 1stPay to get transactions (for auditing and verifying)."
                  +api_entity: "Job"
                  +api_action: "fapsquery"
                  +parameters: null
                  +is_active: "1"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                28 => CRM_Core_ScheduledJob {#3284
                  +id: "28"
                  +domain_id: "1"
                  +run_frequency: "Hourly"
                  +last_run: "2024-03-31 16:00:12"
                  +scheduled_run_date: null
                  +name: "iATS Payments Get Legacy Transaction Journal"
                  +description: "Call into iATS to get transaction journals, legacy processor (for auditing and verifying)."
                  +api_entity: "Job"
                  +api_action: "iatsreport"
                  +parameters: null
                  +is_active: "1"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                27 => CRM_Core_ScheduledJob {#3272
                  +id: "27"
                  +domain_id: "1"
                  +run_frequency: "Daily"
                  +last_run: "2024-03-30 18:00:13"
                  +scheduled_run_date: null
                  +name: "iATS Payments Recurring Contributions"
                  +description: "Trigger + Generate recurring contributions for iATS Payments"
                  +api_entity: "Job"
                  +api_action: "iatsrecurringcontributions"
                  +parameters: null
                  +is_active: "1"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
                }
                29 => CRM_Core_ScheduledJob {#3270
                  +id: "29"
                  +domain_id: "1"
                  +run_frequency: "Hourly"
                  +last_run: "2024-03-31 16:00:12"
                  +scheduled_run_date: null
                  +name: "iATS Payments Verification"
                  +description: "Verify payments from the iATS journal."
                  +api_entity: "Job"
                  +api_action: "iatsverify"
                  +parameters: null
                  +is_active: "1"
                  +action: null
                  +class: null
                  +apiParams: array:1 [
                    "version" => 3
                  ]
                  +remarks: []
  
  **Tags:** wordpress, civimail, error, database, mailing
  
  > **Comments:**
  > **username_0**: p.s. Outbound email is set to mail and test messages work.  
  > **username_0**: Please, can anyone offer any insights based on the error log?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2024-04-18. Score: 1
  
  I looked at a system getting 'No database selected' from mailings. The problem in that case was down to the hosting environment: a combination of throttling outbound mails and a short MySQL timeout caused the db connection to timeout before the status was updated, resulting in that error. The solution there was to move to better hosting.
  
  > **Comments:**
  > **username_0**: Thank you for the suggestion username_1.  I will take it up with the hosting company.  
  
  ---
  
  