As a result of frequent execution of pim:completeness:calculate command, we can face the next exception:
An exception occurred while executing ' INSERT INTO pim_catalog_completeness (locale_id, channel_id, product_id, missing_count, required_count) VALUES (?, ?, ?, ?, ?),(?, ?, ?, ?, ?),(?, ?, ?, ?, ?)' with params ["58", "1", 52597, 0, 21, "58", "1", 52599, 0, 21, "58", "1", 52598, 1, 21]: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '2147483647' for key 'pim_catalog_completeness.PRIMARY'
Having in mind that 2147483647 is MAX_INT, we understand that table reached the primary key boundary (as constantly removing and then adding fresh completeness records increased the primary key to MAX_INT).
To fix an issue in this particular case - we have to truncate the table. It is safe as
pim_catalog_completenesstable has only generated information that can be regenerated after truncate.To not have this issue in the future - we can add the next cron command (paths valid for bitnami akeneo default installation):
After truncating - IDs starts from 1 again & exception gone: