how to fix reindex error

With the reindexing I get the following error on the database:
 
Catalog Search indexer process unknown error:
SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e.media_gallery’ in ‘field list’, query was: SELECT `e`.`entity_id`, `e`.`type_id`, `e`.`has_options`, `e`.`media_gallery`, `e`.`required_options` FROM `catalog_product_entity`
Cheers ! Arthur

12 answers

Profile photo of Mall Staff 184060.00 $tone November 23, 2018
Public

Hi there,

SQLSTATE[42S22]: Column not found: 1054 Unknown column ‘e.media_gallery’ in ‘field list’, query was: SELECT `e`.`entity_id`, `e`.`type_id`, `e`.`has_options`, `e`.`media_gallery`, `e`.`required_options` FROM `catalog_product_entity`

That issue is strange, let’s provide me information about your instance:
+ Admin credentials and URL to back-end
+ SSH credentials and path to M2 folder
I will help to check further and get back you then.
Regards,
Mall.

#1
Profile photo of Arthur Venis 380.00 $tone November 23, 2018
Public

Hi Mall, I fixed the error by adding the missing column in the M2 database on the catalog_product_entity table. After adding, the reindexing went ok without errors. Question remains why the column was missing.
I should set up a new fresh install and do the migration, I suppose, before you would be able to verify. I will check today whether a staging solution would help as I do not want to stop the work on the current working version 😉
Cheers ! Arthur

#2
Profile photo of ubdev Staff 98030.00 $tone November 23, 2018
Public

Hi Arthur, 

 I fixed the error by adding the missing column in the M2 database on the catalog_product_entity table. After adding, the reindexing went ok without errors.

Actually, manual adding the missing column is not recommended. Since data migration might associates with complex scenario, please consider re-starting on a fresh Magento 2 instance to ensure data integrity. 
Regards,
Ubertheme team

#3
Profile photo of ubdev Staff 98030.00 $tone November 23, 2018
Public

Hi Arthur, 
You can provide us your site credentials via this thread. Please make sure you mark your reply private, then only you and our technical team can access. 
Or you can send over the credentials to our email info (at) ubertheme.com. 
Regards,
Ubertheme team

#5
Profile photo of Mall Staff 184060.00 $tone November 24, 2018
Public

Hi there,
I checked in your instance and I saw that issue: http://i.prntscr.com/wpSU0-P2QiCF7rvF4YVenw.png
That issue related to the settings of the attribute ‘media_gallery’ (attribute_id=90)
And here is root of that issue: http://i.prntscr.com/BMh8bmlLTDKNazASto3tPQ.png
To solve that you could run below SQL in your M2’s database to re-update for that attribute’s settings:

Update catalog_eav_attribute Set is_filterable_in_search = 0, is_used_for_promo_rules = 0 Where attribute_id = 90;

+ Once done re-check the issue and tell me know how it goes.
Regards,
Mall.
 
 

#7
Profile photo of Arthur Venis 380.00 $tone November 24, 2018
Public

Hi Mall, thanks! After updating the database, the indexer runs without errors.
Next issue is to find out why existing customers cannot login after migration. I tried the customer:hash:upgrade command, but that yields an error: 
  [Exception]                                                                  
  Notice: Undefined index: 0:1 in /data/web/magento2/vendor/magento/framework 
  /Encryption/Encryptor.php on line 170

#8
Profile photo of Arthur Venis 380.00 $tone November 24, 2018
Public

Not 100% sure now… I picked up the original password of my own account from the M1 database and assed :0 Then tried to login and, voila, I was in. Password in M2 database now changed to SHA256 (with :1 added). Could not login before, so I have no idea what changed…

#9
Profile photo of Mall Staff 184060.00 $tone November 25, 2018
Public

Hi there,

 I picked up the original password of my own account from the M1 database and assed :0 Then tried to login and, voila, I was in

You shouldn’t do that manual. 

Password in M2 database now changed to SHA256 (with :1 added).

Yes, after you did run the CLI command: customer:hash:upgrade
all customer’s password will be converted to new format in M2 (with :1 suffix)
Regards,
Mall.

#10
Profile photo of Arthur Venis 380.00 $tone November 25, 2018
Public

I know changing the database should not be the way to go, but I simply could not get in, and the CLI command did not do its job. It gives an error on the index 0:1 at line 170 of the Encryptor.php file. That’s why I did the manual change. I asked one of my colleagues to logon with their customer account, and that worked ok. After his login, the password was changed to the new format, so I assume this will be the case for all other customers as well.
So, apart from the CLI that yields the error, it seems to be ok now. 

#11
Profile photo of ubdev Staff 98030.00 $tone November 26, 2018
Public

Hi Arthur, 
Yes, please move forward with migration process at your end. Should you run across any issue, please do let us know, we will help you out. 
Regards,
Ubertheme team

#12

Please login or Register to Submit Answer

Written By

Comments