cancel
Showing results for 
Search instead for 
Did you mean: 

Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

SOLVED

Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

Dear all,

I tried to run setup:upgrade to upgrade database schema but uncountered an error :

bin/magento setup:upgrade
Cache cleared successfully
File system cleanup:
/var/www/html/EBA/public_html/generated/code/Composer
/var/www/html/EBA/public_html/generated/code/Dotdigitalgroup
/var/www/html/EBA/public_html/generated/code/MSP
/var/www/html/EBA/public_html/generated/code/Magento
/var/www/html/EBA/public_html/generated/code/Symfony
/var/www/html/EBA/public_html/generated/code/Yotpo
Updating modules:
Schema creation/updates:
Notice: Undefined index: gp_media_gallery_asset in /var/www/html/magento/public_html/vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php on line 152

How can I change the code to have more detailed information.

This index does not exist but I want to know on which table this index is supposed to be.

Thanks for your support

1 ACCEPTED SOLUTION

Accepted Solutions

Re: Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

Hi @eric_bangerter

 

There is a foreign key in one table which leads to another unexisting table. To find where it is, you should access the file: siteurl/public/vendor/magento/framework/Setup/Declaration/Schema/Db.

 

Before the line 152, fix the code following this image

 

Please let me know if you need further assistance. Hope it helps!

_____________

If issue solved, Click Kudos & Accept as Solution.

Marcus | LitExtension Expert
Shopping Cart Migration Service

View solution in original post

7 REPLIES 7

Re: Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

@eric_bangerter 

 

Do you have any custom module related to this? If yes then check db_schema.xml file for this module, something wrong in that.

Manish Mittal
https://www.manishmittal.com/

Re: Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

Dear Manish,
thank for your quick answer and support.
I have performed find . -name db_schema.xml -exec grep gp_customer_group {} \; to found the issue in all db_schema.xml file, but not found.
Any other idea ?
Thanks

Re: Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

@eric_bangerter 

 

Can you find out this in DB, find out that index key in database.

 

you can debug by open this file

vendor/magento/framework/Setup/Declaration/Schema/Db/SchemaBuilder.php

and add some debug messages, to see where the problem is. The script stops on FK dependencies on flat tables.

 

So my solution is to delete them.

 

After this bin/magento setup:upgrade will run without error!

Manish Mittal
https://www.manishmittal.com/

Re: Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

Hi @eric_bangerter

 

There is a foreign key in one table which leads to another unexisting table. To find where it is, you should access the file: siteurl/public/vendor/magento/framework/Setup/Declaration/Schema/Db.

 

Before the line 152, fix the code following this image

 

Please let me know if you need further assistance. Hope it helps!

_____________

If issue solved, Click Kudos & Accept as Solution.

Marcus | LitExtension Expert
Shopping Cart Migration Service

Re: Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

Hello,

thank you for the contribution, i think i'm facing the same problem when i try to upgrade from 2.2.7 to 2.3.0 

Can you please put the fixed code on the comment the screen shott was removed

 

Thank you

Re: Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

Thanks, i have setuo your way and successful.

Website: https://xsmb99.me/du-doan-xsmb.html

Re: Magento 2.3.5p1 setup:upgrade Undefined index: gp_media_gallery_asset

the image is now removed, answers should have a description of the image too because they can always be removed later