fuzionnz / nz.co.fuzion.transactional

Track delivery, open, click, and bounce for transactional email.
Other
12 stars 16 forks source link

Fatal error: DB Constraint violation likely because of this extension #52

Closed herbdool closed 1 month ago

herbdool commented 3 years ago

Getting a DB constraint violation fatal error when submitting an event which also sends out an email notification. Using version 1.0.1 of this extension with CiviCRM 5.37.2, PHP 7.3, MySQL 5.5.30 and getting this error:

INSERT INTO civicrm_mailing_event_delivered (time_stamp ) VALUES ( 20210811120358 ) [nativecode=1452 ** Cannot add or update a child row: a foreign key constraint fails (pantheon.civicrm_mailing_event_delivered, CONSTRAINT FK_civicrm_mailing_event_delivered_event_queue_id FOREIGN KEY (event_queue_id) REFERENCES civicrm_mailing_event_queue (id) ON D)]

When I disable the extension the event goes through fine.

I haven't tried this with a clean site yet.

stesi561 commented 3 years ago

Thanks for the report. Just to clarify and to help us try and replicate, and keen to here if you are able to duplicate on a clean site.

Can you please expand a bit on what you mean by "submitting an event which also sends out an email notification"

are you referring to a CiviCRM Event and creating a new one? Or do you mean event in a more technical sense? Do you have any other extensions on the site and are they involved in the workflow you are using that generates this error (for example are you using CiviRules to generate the email notification?)

herbdool commented 3 years ago

Sorry, I meant registered for an event. A client has users who reported this error and I replicated it. The registration sends an email notification.

I'll try to replicate it on a clean site.

herbdool commented 3 years ago

I haven't been able to replicate on a fresh site.

The original site also had Sparkpost extension so I'm not sure if that also needs to be taken into account. They had tested a regular mass mailing and didn't get the fatal error. So I'm still not sure the source of the error, but leaving this here in case anyone else comes across this.

stesi561 commented 3 years ago

Thanks for the update @herbdool Can you confirm you are referring to this sparkpost extension -> https://github.com/cividesk/com.cividesk.email.sparkpost? Were you running the master version of the code (if so which commit?) or a released version (if so what version) ?

scoobird commented 2 years ago

Hello, I am also getting this exact error. It happens when filling out the form to opt-out of an email, before getting to the opt-out confirmation screen. (The opt-out goes through, and the confirmation email sends) The error does not occur when I disable this extension.

joseltorres commented 2 years ago

I was having same issue as @scoobird, I also had sparkpost extension on site like @stesi561 - it was however disabled. I uninstalled sparkpost, still ha the issue. When i disabled the Transactional Mail extension it worked.

I get here

Screen Shot 2022-02-16 at 1 28 45 PM

The I get this

Screen Shot 2022-02-16 at 1 29 04 PM
adixon commented 2 years ago

Also getting this in the same context, i.e. a visitor trying to unsubscribe themselves.

I'm a bit behind in my versions, I'll try updating the extension first.

adixon commented 2 years ago

I can confirm that updating to v1.0.5 (from about a Mar 13 2020 version, it said 15 commits behind) fixed the issue. Still on an oldish 5.35.x civicrm version.

GreysonStalcup commented 2 years ago

Updating from v1.0.3 -> v1.0.5 also fixed the DB Constraint error on unsubscribing for me as well.
Civi: 5.40.1

stesi561 commented 1 month ago

Marking as closed given the above.