Ok, true desparation here. Since the reindex via default cron simply does not want to work (Reindex gets scheduled by cron but never executed) I decided to create a separate cron just to trigger the reindex:
#!/bin/bash
PHP_BIN=`which php7-71STABLE-CLI`;
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
BIN="$DIR/bin/magento"
INI="$DIR/php.ini"
$PHP_BIN -d max_execution_time=180 -d memory_limit=756M -c $INI -f $BIN indexer:reindex
This works fine when I start this script manually on the command line. But if scheduled via cron I get these errors:
Design Config Grid indexer process unknown error:
URI is not valid and cannot be converted into a string
Customer Grid indexer process unknown error:
URI is not valid and cannot be converted into a string
URI is not valid and cannot be converted into a string
Category Flat Data indexer process unknown error:
URI is not valid and cannot be converted into a string
Category Products indexer process unknown error:
URI is not valid and cannot be converted into a string
Product Categories indexer process unknown error:
URI is not valid and cannot be converted into a string
URI is not valid and cannot be converted into a string
URI is not valid and cannot be converted into a string
Catalog rule indexing failed. See details in exception log.
Catalog rule indexing failed. See details in exception log.
URI is not valid and cannot be converted into a string
Catalog Search indexer process unknown error:
URI is not valid and cannot be converted into a string
... I have no words.
Things got even worse:
In the exception.log I found this:
[2018-07-12 13:25:06] main.CRITICAL: URI is not valid and cannot be converted into a string {"exception":"[object] (Zend\\Uri\\Exception\\InvalidUriException(code: 0): URI is not valid and cannot be converted into a string at /www/vendor/zendframework/zend-uri/src/Uri.php:357)"} []
[2018-07-12 13:25:06] main.CRITICAL: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db274388_83.catalogrule_product__tempfccd824a' doesn't exist, query was: SELECT `rp`.*, IFNULL(pp1.value, pp_default.value) AS `default_price` FROM `catalogrule_product__tempfccd824a` AS `rp`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = rp.product_id
INNER JOIN `catalog_product_entity_decimal` AS `pp_default` ON pp_default.entity_id=e.entity_id AND (pp_default.attribute_id=77) and pp_default.store_id=0
INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id=rp.product_id AND product_website.website_id = rp.website_id AND product_website.website_id=1
LEFT JOIN `catalog_product_entity_decimal` AS `pp1` ON pp1.entity_id=e.entity_id AND (pp1.attribute_id=77) and pp1.store_id=1 ORDER BY `rp`.`website_id` ASC, `rp`.`customer_group_id` ASC, `rp`.`product_id` ASC, `rp`.`sort_order` ASC, `rp`.`rule_id` ASC
{"exception":"[object] (Zend_Db_Statement_Exception(code: 42): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db274388_83.catalogrule_product__tempfccd824a' doesn't exist, query was: SELECT `rp`.*, IFNULL(pp1.value, pp_default.value) AS `default_price` FROM `catalogrule_product__tempfccd824a` AS `rp`
INNER JOIN `catalog_product_entity` AS `e` ON e.entity_id = rp.product_id
INNER JOIN `catalog_product_entity_decimal` AS `pp_default` ON pp_default.entity_id=e.entity_id AND (pp_default.attribute_id=77) and pp_default.store_id=0
INNER JOIN `catalog_product_website` AS `product_website` ON product_website.product_id=rp.product_id AND product_website.website_id = rp.website_id AND product_website.website_id=1
LEFT JOIN `catalog_product_entity_decimal` AS `pp1` ON pp1.entity_id=e.entity_id AND (pp1.attribute_id=77) and pp1.store_id=1 ORDER BY `rp`.`website_id` ASC, `rp`.`customer_group_id` ASC, `rp`.`product_id` ASC, `rp`.`sort_order` ASC, `rp`.`rule_id` ASC
at /www/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:235, PDOException(code: 42S02): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db274388_83.catalogrule_product__tempfccd824a' doesn't exist at /www/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php:228)"} []
Magento is complaining about missing tables (catalogrule_product__tempfccd824a
). So I checked the database and found a whole lot of weird tables that weren't there in the first place:
catalogrule_product7b329f37
catalogrule_product_price94df8523
catalogrule_group_website30a92cf9
...while the original tables were still in place. With each run of my reindex script I got more and more of these tables.