Error while running trigger script

LabKey Support Forum
Error while running trigger script eva pujadas  2020-04-07 09:32
Status: Active
 

Dear LabKey support,

We have installed a new version of LabKey, 19.3.7, and are detecting a problem when running some trigger scripts attached to study datasets. The same scripts were working in the previous version.

The web interface error message is the following:
"script error: afterInsert trigger closed the connection, possibly due to constraint violation"

The error logs are attached.

The trigger JavaScript script performs some checks in a dataset and tries to insert new rows in two other datasets. The error seems to happen when trying to insert into the second dataset.

Thanks for any ideas about this error's cause.
Best regards,
Eva

 
 
kevink responded:  2020-04-07 15:06

Hi Eva,

I think you are running into Issue 40011 which should be fixed in 19.3.9 and 20.3.1. Can you upgrade to check if that resolves the issue?

Kevin

 
eva pujadas responded:  2020-04-14 01:01

Hi Kevin,

Thanks a lot for your answer.
Could you let me know where to download the 19.3.9 fix that we can upgrade?

Best regards,
Eva

 
Jon (LabKey DevOps) responded:  2020-04-14 12:31
Status: Closed
Hi Eva,

The latest 19.3 build is available here:

https://www.labkey.org/Documentation/wiki-page.view?name=prevReleases

On this page, there is a link for 19.3.10 which has the fix that Kevin mentioned where you can then download your binaries:

https://www.labkey.org/Documentation/wiki-page.view?name=prevReleasesDetails&release=19.3.10

Please download the 19.3.10 Release build of LabKey and let us know if that resolves the issue.

Regards,

Jon
 
eva pujadas responded:  2020-04-21 08:11
Hi Jon,

Thanks for the 19.3.10 fix.

We have applied it and indeed that solves the issue.

Yes, the problem was that in the afterInsert event, the record was not yet inserted (or at least not found by a "select" query).

Best regards,
Eva