0

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.

1 Answer 1

0

Am having the same/similar problem, the reindex creates all these catalogrule tables - absolute pain to delete - am clueless - have you had any success finding the problem? I have located the problem to the reindex cron job but that is it.

If I reindex all through the ssh shell () indexer:reindexhen I do not get multiple tables - exception log also shows "URI is not valid and cannot be converted into a string"

Any help appreciated

T

3
  • So far no success. But it seems my issue is related to my provider's config. When I trigger the cron script manually from the provider's backend panel all is fine. The problem only occurs when it is triggered via cron itself. Will keep you updated.
    – omsta
    Commented Jul 16, 2018 at 13:31
  • I seemed to have stopped the temp tables being created. I used the Cron Job Manager plugin and in Job Configuration I disabled the catalogrule_apply_all cronjob. Not really a good answer but it works. Can also be tweaked or overridden from here: /vendor/magento/module-catalog-rule/etc/crontab.xml
    – trev
    Commented Jul 26, 2018 at 13:44
  • My original issue is resolved (magento.stackexchange.com/questions/233294/…) so a separate index cron is obsolete for me.
    – omsta
    Commented Nov 6, 2018 at 13:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.