veda-consulting-company / uk.co.vedaconsulting.mosaico

Other
39 stars 75 forks source link

"DB Error: no such field" when sending or viewing old Mosaico mail following Civi Upgrade #503

Closed pizzatopping closed 1 year ago

pizzatopping commented 2 years ago

We're seeing the error: "DB Error: no such field" when trying to send email from Mosaico. This happens regardless of whether the email is a test, or going out to the intended recipients. The error appears immediately upon submitting the mailing.

We're also unable to view old mailings submitted via Mosico, with the same error appearing but as a webpage rather than a pop-up.

This started happening after we upgraded CiviCRM from 5.39.0 to 5.46.0.

"Traditional" mails are working fine (sending and viewing)

I've done a few basic things to fix the problem with no success:

The error that appears while sending the mailing doesn't leave anything in the error log. I do get the following when viewing old mailings though:

Mar 11 16:35:20  [error] 
$Fatal Error Details = array:3 [
  "message" => "DB Error: no such field"
  "code" => null
  "exception" => CiviCRM_API3_Exception {#3486
    -extraParams: array:4 [
      "error_code" => "no such field"
      "tip" => "add debug=1 to your API call to have more info about the error"
      "is_error" => 1
      "error_message" => "DB Error: no such field"
    ]
    #message: "DB Error: no such field"
    #code: 0
    #file: ".../sites/all/modules/civicrm/api/api.php"
    #line: 134
    trace: {
      /.../sites/all/modules/civicrm/api/api.php:134 {
        › if (is_array($result) && !empty($result['is_error'])) {
        ›   throw new CiviCRM_API3_Exception($result['error_message'], CRM_Utils_Array::value('error_code', $result, 'undefined'), $result);
        › }
      }
      /.../sites/all/modules/civicrm/CRM/Mailing/Page/View.php:148 { …}
      /.../sites/all/modules/civicrm/CRM/Core/Invoke.php:319 { …}
      /.../sites/all/modules/civicrm/CRM/Core/Invoke.php:69 { …}
      /.../sites/all/modules/civicrm/CRM/Core/Invoke.php:36 { …}
      /.../sites/all/modules/civicrm/drupal/civicrm.module:471 { …}
      /.../domains/secure/htdocs/includes/menu.inc:527 { …}
      /.../domains/secure/htdocs/index.php:21 { …}
    }
  }
]

Mar 11 16:35:20  [debug] $backTrace = #0 /.../domains/secure/htdocs/sites/all/modules/civicrm/CRM/Core/Error.php(433): CRM_Core_Error::backtrace("backTrace", TRUE)
#1 /.../domains/secure/htdocs/sites/all/modules/civicrm/CRM/Core/Invoke.php(39): CRM_Core_Error::handleUnhandledException(Object(CiviCRM_API3_Exception))
#2 /.../domains/secure/htdocs/sites/all/modules/civicrm/drupal/civicrm.module(471): CRM_Core_Invoke::invoke((Array:3))
#3 /.../domains/secure/htdocs/includes/menu.inc(527): civicrm_invoke("mailing", "view")
#4 /.../domains/secure/htdocs/index.php(21): menu_execute_active_handler()
#5 {main}

Environment: Debian 10 (64 bit) MariaDB 10.3 PHP 7.3 Drupal 7.88 CiviCRM 5.47.0 Mosaico 2.9

MarcMichalsky commented 2 years ago

I recently ran into that "DB Error: no such field" error elsewhere. After an upgrade that added two more columns to the civicrm_relationship table I got the same error when I tried to add new relationships. The reason was that logging was enabled and the log_civicrm_relationship table did not have the new columns yet but the update and insert triggers always tried to apply all changes on the civicrm_relationship table also on the log_civicrm_relationship table. You could try to disable and enable logging again.

colemanw commented 2 years ago

@GreysonStalcup what you posted is not the same error as the OP. Yours is a "Could not find valid value for id" error which usually results from a bad redirect to a form, or clicking refresh on a form with validation errors.

rbaugh commented 2 years ago

Are you using any other Mosaico extensions? I just ran into something similar to this. I had a 2.9.xxxxx version of Mosaico and pulled from the master as I was getting a weird local error on an install. When I disabled Mosaico and other extensions that depended on Mosaico, I found I was getting this same error. When I had enabled Mosaico, I had done it through CV and didn't run the extension DB upgrades. Once the Mosaico DB upgrades were run, I was able to enable the other extensions that were dependent on Mosaico.

mattwire commented 1 year ago

Don't think this is related to mosaico but a general upgrade issue