Contacts (only) error: "an error occurred while retrieving records"

Contacts appear to work, however, this error is appearing during most Contact operations.

The error does not appear in any other module e.g. Leads.

Upon opening the Contact, I also see scrolling dots, although the Contact is visible and can be edited i.e. the actual error message does not immediately appear, and sometimes does not appear i.e. dots only.

I also notice the if I then try to logout that the process appears to hang indefinitely, with the SuiteCRM box logo in the center of a darkened background. If however I have only been in Leads or Targets etc, logout is instantaneous.

I have tried the SugarBean.php edits suggested in: Database failure. Please refer to suitecrm.log for details. with no change.

As soon as I access an individual Contact record, this block of issues appears in /var/www/html/suitecrm/logs/prod/prod.log :

[2023-06-11 22:31:17] php.INFO: User Deprecated: Since api-platform/core 2.7: Use "ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface" instead of "ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface". {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since api-platform/core 2.7: Use \"ApiPlatform\\Metadata\\Resource\\Factory\\ResourceMetadataCollectionFactoryInterface\" instead of \"ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface\". at /var/www/html/suitecrm/vendor/api-platform/core/src/Serializer/AbstractItemNormalizer.php:130)"} []
[2023-06-11 22:31:17] php.INFO: User Deprecated: Since api-platform/core 2.7: Use an implementation of "ApiPlatform\Api\IriConverterInterface" instead of "ApiPlatform\Core\Api\IriConverterInterface". {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since api-platform/core 2.7: Use an implementation of \"ApiPlatform\\Api\\IriConverterInterface\" instead of \"ApiPlatform\\Core\\Api\\IriConverterInterface\". at /var/www/html/suitecrm/vendor/api-platform/core/src/Hydra/Serializer/CollectionNormalizer.php:62)"} []
[2023-06-11 22:31:17] php.INFO: User Deprecated: Since api-platform/core 2.7: Use "ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface" instead of "ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface". {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since api-platform/core 2.7: Use \"ApiPlatform\\Metadata\\Resource\\Factory\\ResourceMetadataCollectionFactoryInterface\" instead of \"ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface\". at /var/www/html/suitecrm/vendor/api-platform/core/src/Hydra/Serializer/PartialCollectionViewNormalizer.php:50)"} []
[2023-06-11 22:31:17] php.INFO: User Deprecated: Since api-platform/core 2.7: Use "ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface" instead of "ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface". {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since api-platform/core 2.7: Use \"ApiPlatform\\Metadata\\Resource\\Factory\\ResourceMetadataCollectionFactoryInterface\" instead of \"ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface\". at /var/www/html/suitecrm/vendor/api-platform/core/src/Hydra/Serializer/CollectionFiltersNormalizer.php:53)"} []
[2023-06-11 22:31:17] php.INFO: User Deprecated: Since api-platform/core 2.7: Use an implementation of "ApiPlatform\Api\IriConverterInterface" instead of "ApiPlatform\Core\Api\IriConverterInterface". {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since api-platform/core 2.7: Use an implementation of \"ApiPlatform\\Api\\IriConverterInterface\" instead of \"ApiPlatform\\Core\\Api\\IriConverterInterface\". at /var/www/html/suitecrm/vendor/api-platform/core/src/JsonLd/Serializer/ObjectNormalizer.php:44)"} []
[2023-06-11 22:31:17] php.INFO: User Deprecated: Since api-platform/core 2.7: Use "ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface" instead of "ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface". {"exception":"[object] (ErrorException(code: 0): User Deprecated: Since api-platform/core 2.7: Use \"ApiPlatform\\Metadata\\Resource\\Factory\\ResourceMetadataCollectionFactoryInterface\" instead of \"ApiPlatform\\Core\\Metadata\\Resource\\Factory\\ResourceMetadataFactoryInterface\". at /var/www/html/suitecrm/vendor/api-platform/core/src/Symfony/EventListener/DeserializeListener.php:63)"} []
[2023-06-11 22:31:17] php.INFO: User Deprecated: Not injecting ApiPlatform\Metadata\Property\Factory\PropertyMetadataFactoryInterface in the TypeConverter is deprecated since 2.7 and will not be supported in 3.0. {"exception":"[object] (ErrorException(code: 0): User Deprecated: Not injecting ApiPlatform\\Metadata\\Property\\Factory\\PropertyMetadataFactoryInterface in the TypeConverter is deprecated since 2.7 and will not be supported in 3.0. at /var/www/html/suitecrm/vendor/api-platform/core/src/Core/GraphQl/Type/TypeConverter.php:55)"} []
[2023-06-11 22:31:17] php.WARNING: Notice: Undefined offset: 2 {"exception":"[object] (ErrorException(code: 0): Notice: Undefined offset: 2 at /var/www/html/suitecrm/core/modules/Contacts/Statistics/ContactLastTouchPoint.php:121)"} []
[2023-06-11 22:31:17] app.ERROR: Database failure. Please refer to suitecrm.log for details. {"exception":"[object] (Exception(code: 1): Database failure. Please refer to suitecrm.log for details. at /var/www/html/suitecrm/public/legacy/include/utils.php:2109)"} []
[2023-06-11 22:31:17] security.DEBUG: Stored the security token in the session. {"key":"_security_main"} []

/var/www/html/suitecrm/public/legacy/suitecrm.log contains;

Sun Jun 11 22:31:17 2023 [10839][7c998955-e340-4492-1d0a-648417b37319][FATAL] Mysqli_query failed.
Sun Jun 11 22:31:17 2023 [10839][7c998955-e340-4492-1d0a-648417b37319][FATAL] SubpanelCustomQueryPort: Error executing custom query Query Failed: SELECT meetings.`date_end` AS `meetings_date_end`     ORDER BY `meetings_date_end` DESC LIMIT 1: MySQL error 1109: Unknown table 'meetings' in field list
Sun Jun 11 22:31:18 2023 [10834][7c998955-e340-4492-1d0a-648417b37319][FATAL] Subpanel definition should be an aSubPanel
Sun Jun 11 22:31:18 2023 [10834][7c998955-e340-4492-1d0a-648417b37319][FATAL] Mysqli_query failed.
Sun Jun 11 22:31:18 2023 [10834][7c998955-e340-4492-1d0a-648417b37319][FATAL] SubpanelCustomQueryPort: Error executing custom query Query Failed: (SELECT emails.id ,  emails.name ,  emails.status ,  emails.date_modified  as date_end ,  emails.date_entered ,  emails.assigned_user_id  ,  'emails' panel_name  FROM emails  INNER JOIN  emails_beans ON emails.id=emails_beans.email_id AND emails_beans.bean_id='c65fdf98-41ee-07e9-36c1-6486442022e2' AND emails_beans.deleted=0
 AND emails_beans.bean_module = 'Contacts'
  where emails.deleted=0) UNION ALL ( SELECT emails.id ,  emails.name ,  emails.status ,  emails.date_modified  as date_end ,  emails.date_entered ,  emails.assigned_user_id  ,  'linkedemails' panel_name  FROM emails  JOIN (select DISTINCT email_id from emails_email_addr_rel eear

	join email_addr_bean_rel eabr on eabr.bean_id ='c65fdf98-41ee-07e9-36c1-6486442022e2' and eabr.bean_module = 'Contacts' and
	eabr.email_address_id = eear.email_address_id and eabr.deleted=0
	where eear.deleted=0 and eear.email_id not in
	(select eb.email_id from emails_beans eb where eb.bean_module ='Contacts' and eb.bean_id = 'c65fdf98-41ee-07e9-36c1-6486442022e2')
	) derivedemails on derivedemails.email_id = emails.id  where emails.deleted=0 ) UNION ALL  UNION ALL (SELECT max(id),
        GROUP_CONCAT(field_name) as name,
        GROUP_CONCAT(after_value_string) as status,
        max(audit.date_created) AS date_modified,
        max(audit.date_created) AS date_entered,
        max(audit.date_created) AS date_end,
        audit.created_by AS assigned_user_id,
        'audit' panel_name   FROM contacts_audit as audit  WHERE parent_id = 'c65fdf98-41ee-07e9-36c1-6486442022e2'  GROUP BY audit.date_created, audit.created_by  ) ORDER BY date_end DESC Limit 0, 10: MySQL error 1064: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'UNION ALL (SELECT max(id),
        GROUP_CONCAT(field_name) as name,
        ...' at line 9

That looks like a bug, and you seem to have good information collected there to open a thorough Issue on Github for this :+1:

The error is reproducible on the DEMO v8.3.1. site by selecting CONTACTS and leaving the page alone. It will fail with the error.

OK, new info. Also occurs in the EMAIL tab. This is a live v8.3.1 server php8.0 and I left the page for a few hours and the error occurs. You can clear it by refreshing the browser and still works.

Sutecrm 8.4.0 PHP 8.2 We also get a lot of this errors in prod.log:
php.INFO: User Deprecated: Since api-platform/core 2.7: Use “ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface” instead of “ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface”. {“exception”:“[object] (ErrorException(code: 0): User Deprecated: Since api-platform/core 2.7: Use "ApiPlatform\Metadata\Resource\Factory\ResourceMetadataCollectionFactoryInterface" instead of "ApiPlatform\Core\Metadata\Resource\Factory\ResourceMetadataFactoryInterface". at /home/…/public_html/SuiteCRM8/vendor/api-platform/core/src/Symfony/EventListener/DeserializeListener.php:63)”} []

I have php error level E_ALL & ~E_DEPRECATED & ~E_STRICT
Suitecrm log level is: Error

How to get rid of this messages?

Updating the above error message while retrieving records. In v8.5 the logouts are now working and the error above is not occurring. In other words, I’ve been online for days and not logged out and I’ve never had the above error occur.

Bravo to the team for those fixes. Therefore, I was hesitant to suggest v8.5 because it will overwrite any of your previous fixes not yet in the core code. However, the logout and error problems now fixed makes the update really worthwhile.

If we can get @pgr diagnostic pull from some time ago implemented, or githib’s codespace and debug setup for users implemented by the team, the other bugs would disappear quickly.

You’re correct. Hope, maintainers will fix all known errors in the next update. :crossed_fingers:

1 Like