1

Steps to reproduce when I do reindex as below, I get the following error. Everything else works except customer is not getting re-indexed. So the in admin I cannot see any customers either although customers are there.

In addition , i cant upgrade Magento 2.1.2 to Magento 2.1.5

php -f bin/magento indexer:reindex
Design Config Grid index has been rebuilt successfully in 00:00:00
SELECT e., e.entity_id, TRIM(CONCAT_WS(' ', IF(e.prefix <> '', e.prefix, NULL), IF(e.firstname <> '', e.firstname, NULL), IF(e.middlename <> '', e.middlename, NULL), IF(e.lastname <> '', e.lastname, NULL), IF(e.suffix <> '', e.suffix, NULL))) AS name, e.email, e.group_id, e.created_at, e.website_id, e.confirmation, e.created_in, e.dob, e.gender, e.taxvat, e.lock_expires, TRIM(CONCAT_WS(' ', IF(shipping.street <> '', shipping.street, NULL), IF(shipping.city <> '', shipping.city, NULL), IF(shipping.region <> '', shipping.region, NULL), IF(shipping.postcode <> '', shipping.postcode, NULL))) AS shipping_full, TRIM(CONCAT_WS(' ', IF(billing.street <> '', billing.street, NULL), IF(billing.city <> '', billing.city, NULL), IF(billing.region <> '', billing.region, NULL), IF(billing.postcode <> '', billing.postcode, NULL))) AS billing_full, billing.firstname AS billing_firstname, billing.lastname AS billing_lastname, billing.telephone AS billing_telephone, billing.postcode AS billing_postcode, billing.country_id AS billing_country_id, billing.region AS billing_region, billing.street AS billing_street, billing.city AS billing_city, billing.fax AS billing_fax, billing.vat_id AS billing_vat_id, billing.company AS billing_company FROM customer_entity AS e
LEFT JOIN customer_address_entity AS shipping ON shipping.entity_id=e.default_shipping
LEFT JOIN customer_address_entity AS billing ON billing.entity_id=e.default_billingCustomer Grid indexer process unknown error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'e.lock_expires' in 'field list', query was: SELECT e., e.entity_id, TRIM(CONCAT_WS(' ', IF(e.prefix <> '', e.prefix, NULL), IF(e.firstname <> '', e.firstname, NULL), IF(e.middlename <> '', e.middlename, NULL), IF(e.lastname <> '', e.lastname, NULL), IF(e.suffix <> '', e.suffix, NULL))) AS name, e.email, e.group_id, e.created_at, e.website_id, e.confirmation, e.created_in, e.dob, e.gender, e.taxvat, e.lock_expires, TRIM(CONCAT_WS(' ', IF(shipping.street <> '', shipping.street, NULL), IF(shipping.city <> '', shipping.city, NULL), IF(shipping.region <> '', shipping.region, NULL), IF(shipping.postcode <> '', shipping.postcode, NULL))) AS shipping_full, TRIM(CONCAT_WS(' ', IF(billing.street <> '', billing.street, NULL), IF(billing.city <> '', billing.city, NULL), IF(billing.region <> '', billing.region, NULL), IF(billing.postcode <> '', billing.postcode, NULL))) AS billing_full, billing.firstname AS billing_firstname, billing.lastname AS billing_lastname, billing.telephone AS billing_telephone, billing.postcode AS billing_postcode, billing.country_id AS billing_country_id, billing.region AS billing_region, billing.street AS billing_street, billing.city AS billing_city, billing.fax AS billing_fax, billing.vat_id AS billing_vat_id, billing.company AS billing_company FROM customer_entity AS e
5
  • Try this in you cmd promt php bin/magento indexer:reindex
    – Magento 2
    Commented Mar 30, 2017 at 5:53
  • i get the same log without -f
    – Goldy
    Commented Mar 30, 2017 at 6:02
  • 1
    I think it's not about reindex problem might be table structure is wrong
    – Magento 2
    Commented Mar 30, 2017 at 6:03
  • i think you right but how i can fix it? for now , i cant upgrade magento 2.1.2 to magento 2.1.5
    – Goldy
    Commented Mar 30, 2017 at 6:07
  • In indexer_state table all have status = 'valid'? If not what other status u have like 'invalid'?
    – Jackson
    Commented Mar 30, 2017 at 6:42

1 Answer 1

0

Run below query

SET SQL_SAFE_UPDATES = 0;
update indexer_state set status = 'invalid' where status != 'valid';

Then run

php bin/mangento indexer:reindex
9
  • i get SET SQL_SAFE_UPDATES =0;# MySQL returned an empty result set (i.e. zero rows). UPDATE indexer_state SET STATUS = 'invalid' WHERE STATUS != 'valid';# MySQL returned an empty result set (i.e. zero rows).
    – Goldy
    Commented Mar 30, 2017 at 7:06
  • i change it manually and after runing the reindex again i get customer_grid invalid on status
    – Goldy
    Commented Mar 30, 2017 at 7:08
  • Run update indexer_state set status = 'invalid' then do reindex it should work
    – Jackson
    Commented Mar 30, 2017 at 7:16
  • i still get this error. the error related to the table structure on customer module
    – Goldy
    Commented Mar 30, 2017 at 7:20
  • Go to customer_entity table check in the end u have column lock_expires ? It's after first_failure field
    – Jackson
    Commented Mar 30, 2017 at 7:24

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.