What is the cause of 'Unable to find relationship emails_email_templates'?

Every time I access the email module, I am seeing tons of these errors in the suitecrm.log.

Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates
Sat Jun 10 20:30:30 2023 [2488][1][ERROR] Unable to find relationship emails_email_templates

Not sure if it is related, but when I do Repair > Sync of Inbound, I see the following message:

0 record updated
IMAP errors detected

What is causing this? How can this be resolved?

I’ve had tons of these too. Watching if anyone has ideas.

I tried to troubleshoot once (If my memory serves me correctly) and searched the DB for the ID that was referenced in the error. It referenced a specific email. I deleted the email and the error went away. That’s as far as I got. I still get them, not sure the root cause.

I did this mod initially on v8.3.0 but not as a custom change. It got wiped in V8.3.1 so I am doing the same mod as a custom change. This seems to work for now.

I did a grep search on the files to see where the relationship exists. The relationship definition exists but is missing from the main catalog of relationships so I am adding it here as a custom file.

The missing relationship exists in this file. My server is ubuntu 20.04 LTS, php 8.0, mariadb 10.x

[suitecrm root]/public/legacy/metadata/emails_email_templatesMetaData.php

The relationship catalog appears to be stored in this file and is missing the relationship.

[suitecrm root]/public/legacy/modules/TableDictionary.php

However, at the bottom of that file is a catch-all for custom relationships:

if (file_exists('custom/application/Ext/TableDictionary/tabledictionary.ext.php')) {
    include('custom/application/Ext/TableDictionary/tabledictionary.ext.php');
}

So, I simply copied the contents of

emails_email_templatesMetaData.php

into a new directory

custom/application/Ext/TableDictionary/tabledictionary.ext.php

then did repairs for general and relationships, checked the logs and the error stopped. I don’t know if the catalog isn’t being built properly but this seems to be a temp fix an error that fills the logs.

2 Likes

@pjdm This solution does not work for version 7. Is there a similar solution for version 7.x?

have the same issue, thought the fix worked, but its reappeared :frowning:

That’s because the fix should go under custom/Extension/application etc, and the QR&R would then take care of moving it to custom/application etc.

In your case, the QR&R is simply over-writing your fix.

… If I’m not mistaken

thanks pgr, you were right.

however i new get

Warning: Multiple links found for relationship emails_email_templates within module Emails

:upside_down_face:

Try Admin / Repairs / Repair Relationships

If that doesn’t work, you have some double-definition of that relationship somwhere, you probably need to clean-up something from your previous attempts…

I ran repairs and emptied cache etc, but still have the duplicate warnings (along with other relationships too), but i cant find them.

If i run grep, i get the following output:

>  grep -R "'emails_email_templates' =>"

> cache/Relationships/relationships.cache.php:  'emails_email_templates' =>
> cache/Relationships/relationships.cache.php:      'emails_email_templates' =>
> cache/modules/Emails/Emailvardefs.php:    'emails_email_templates' =>
> custom/application/Ext/TableDictionary/tabledictionary.ext.php:    'emails_email_templates' =>
> custom/Extension/application/Ext/TableDictionary/emails_email_templatesMetaData.php:  emails_email_templates' =>

so i can see there are two definitions, but the second is created by the QR&R?

I don’t know much about this error, so I am not sure how to help you.

You might want to also look in the fields_metadata table in the DB. Just be careful what you change there, make sure you can revert your changes if necessary.

Fogive for this dumb question , but what is QR&R ? Quick Repair and Rebuild ?

Yes that is what it means

1 Like