I updated from CiviCRM v5.70.2 to v5.73 (running Drupal 10.2.6, PHP 8.1 and MySQL 8). During general upgrade testing, we run into an error with creating a test mailing in CiviMail. This issue affects both Mosaico and Traditional mailings. We get the following database error displayed:

DB Error: unknown database

I could find nothing in any of the usual logs (Drupal, CiviCRM, MySQL or Apache) and eventually took a look at the console:

Possibly unhandled rejection: {"error_code":-1,"sql":"ROLLBACK TO SAVEPOINT civi_0","debug_info":"ROLLBACK TO SAVEPOINT civi_0 [nativecode=1305 ** SAVEPOINT civi_0 does not exist]","entity":"Attachment","action":"get","is_error":1,"error_message":"DB Error: unknown error","debug_information":"ROLLBACK TO SAVEPOINT civi_0"}


Possibly unhandled rejection: {"error_code":0,"entity":"Mailing","action":"create","is_error":1,"error_message":"Mailing has not been saved, Content maybe out of date, please refresh the page and try again"}

The issue seems to be to do with the temporary saving of the mailing. We see a brief 'saving' message in the top right hand corner and then the DB Error: Unknown database box appears. Any changes to the mailing that elicit a background save seems to cause this error.

I had no idea what issue I was dealing with here - this seems to be to do with an Ajax request and Angular...

1 Answer 1


After a week of no luck, I was just about to ask this question, when I got a tip on the Town Square CiviCRM Matter Most forum (thank you @seamuslee)

The entire problem was to do with Composer patches. I did some more searching and found the answer here:

CiviMail "DB error": suspected core bug relating to attachment replace api

@Samuele.Masetto's answer of applying patches with the following line:

composer config extra.enable-patching true

A number of patches were added and the problem has gone away. I hope this helps others as the issue seems to be intermittent.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.