Question

Package Installation Error

Hello community,

 

I have data binded Email templates using the Object 'EmailTemplate' .When I install the Package in another instance, I'm getting the error "insert or update on table "EmailTemplate" violates foreign key constraint "FKJKkd7aSxQdiN6pbsi1lGVzF9qw" ---> Npgsql.PostgresException: 23503: insert or update on table "EmailTemplate" violates foreign key constraint "FKJKkd7aSxQdiN6pbsi1lGVzF9qw"".



Any inputs on resolving this error would be helpful.



Regards,

Sivaranjani

Like 1

Like

6 comments

Hello,



Since you have already contacted support on this issue, the answer to your question will be provided in your opened case SR-01226463.

I have the same issue, some ideas?

 

Julio Falcon (Cibernética),

Hello,

 

Please contact us directly at support@creatio.com and provide details of your issue so we can investigate it thoroughly.

 

Best regards,

Yuliya

I've encountered the same error. I went into the Application Hub and viewed the Package settyings. There, the status column has a red X with a similiar message, but it also includes the message "Needs to be installed in database". So, I clicked the menu at the end of the row and chose "Install". It said "Operation was successful," and I can now see my email template (well, message template). Not sure what the underlying issue is but choosing "Install" seemed to fix it.

Jeff Ballard,

You can see what the constraint violation is by running this query for the constraint mentioned in the error (you can use Clio explorer to run the query)

As for email templates, when a template is saved, it creates a thumbnail image of the template. This image is saved in SysImage and is referenced by the EmailTemplate record. So, to bind a template, you need to see what the Id of the related image is and bind that from SysImage also.

Not sure why clicking "Install" a second time allowed it to be installed the second time, maybe it attempts to create the SysImage record (or removes the reference) with a db trigger or something the first time, but the timing ins't fast enough?

Ryan

As always, thanks Ryan. Last night I actually found a query similar to yours that returned the constraint in question. It was indeed SysImages. My next question became "how do I know which image(s) to include?"(besides guessing based on date/time).

I discovered that when binding data in the package, the name field from the SysImages data actually includes the ID of the EmailTemplate. I included all the images referenced in that template (which worked), but it sounds like I only need to include the thumbnail image.

Show all comments