Fixing Magento 2 catalogrule prices that suddenly disappear

The problem

If you catalogrule promotion prices have 'suddenly' disappeared from your shop in the morning, chances are that the catalogrule index cron has not run properly at night.

The cause

The index stores a special price for all products that are affected by one or more catalogrules in table catalogrule_product_price, like so: rule_date | customer_group_id | product_id | rule_price | website_id.

If the catalogrule_product index has not run at night, the prices are not updated for the correct date. As a result, Magento cannot find the promotion price for products for today.

Troubleshoot

You can check if catalogrule prices have been indexed for today by running the following query:

SELECT rule_date FROM catalogrule_product_price GROUP BY rule_date;

This query will list all days for which product prices have been indexed. If the index has run correctly, there are adjusted prices in this table for today and tomorrow.

The solution

Run the index, so prices are indexed for today. To run the index, run the following command:

php bin/magento indexer:reindex catalogrule_product

On a 100.000 products shop, this should take some 30 second to run.