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.

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