What is 'INVALID_REPLICATION_DATE: startDate must be at least one minute greater than endDate' error in Heroku Connect?

Issue

The INVALID_REPLICATION_DATE error is returned by the getDeleted() Salesforce API call under certain conditions. This error can occur in various scenarios, as described in the API documentation for getDeleted().

Generally, deleted records are included in results from the queryAll() API endpoint, which Heroku Connect uses initially when polling Salesforce. Additionally, Heroku Connect also attempts to retrieve deleted records as a secondary precautionary measure using the getDeleted() API endpoint. This is when Heroku Connect can encounter this error.

Resolution

1. Empty the Recycle Bin of your Salesforce Org

Empty Org Recycle Bin or manually select the affected records and delete them from the Recycle Bin. Records cleared from the Recycle Bin are marked for permanent deletion by the Salesforce automated process. Once the records are permanently deleted (called physical delete), the number of records the getDeleted() call needs to process will be reduced. To understand how records get deleted in Salesforce, see Delete unwanted data in an organization.

2. Reload the Mapping Object in Connect

A secondary solution, which may not be a practical option in all situations, is to reload the mapping. This process will remove all data from your database and load the current data from Salesforce. Note that reloading will not load any data that was soft deleted or updated. This process can take a while if the object has a large number of rows.

3. Monitor and Wait

If the issue is temporary and expected to resolve itself, monitoring and waiting can be an option. Deleted records are only retained for up to 15 days, after which they are automatically purged. Once the records are purged, the getDeleted() calls for that timeframe will start to work again.

Ask on Stack Overflow

Engage with a community of passionate experts to get the answers you need

Ask on Stack Overflow

Heroku Support

Create a support ticket and our support experts will get back to you

Contact Heroku Support