magento2: Unable to view Admin Catalog - SQL 1103 Incorrect table name ''

Created a brand new Magento 2 install and migrated data (not settings as I originally thought that was the issue) from Magento 1.7.0.2 store. When I attempt to navigate to the Admin > Products > Catalog I get the following error message:

SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '', query was: SELECT COUNT(DISTINCT main_table.attribute_id) FROM `eav_attribute` AS `main_table`
 INNER JOIN `eav_entity_type` AS `entity_type` ON main_table.entity_type_id = entity_type.entity_type_id
 INNER JOIN `eav_entity_attribute` ON main_table.attribute_id = eav_entity_attribute.attribute_id
 INNER JOIN `` AS `additional_table` ON main_table.attribute_id = additional_table.attribute_id WHERE (`entity_type_code` = 'catalog_product') AND (`additional_table`.`is_used_in_grid` = 1)

Stack Trace:

SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '', query was: SELECT COUNT(DISTINCT main_table.attribute_id) FROM `eav_attribute` AS `main_table`
 INNER JOIN `eav_entity_type` AS `entity_type` ON main_table.entity_type_id = entity_type.entity_type_id
 INNER JOIN `eav_entity_attribute` ON main_table.attribute_id = eav_entity_attribute.attribute_id
 INNER JOIN `` AS `additional_table` ON main_table.attribute_id = additional_table.attribute_id WHERE (`entity_type_code` = 'catalog_product') AND (`additional_table`.`is_used_in_grid` = 1)
#0 /home/vagrant/magento2/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)
#1 /home/vagrant/magento2/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#2 /home/vagrant/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /home/vagrant/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT COUNT(DI...', Array)
#4 /home/vagrant/magento2/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(444): Zend_Db_Adapter_Pdo_Abstract->query('SELECT COUNT(DI...', Array)
#5 /home/vagrant/magento2/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(499): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('SELECT COUNT(DI...', Array)
#6 /home/vagrant/magento2/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(828): Magento\Framework\DB\Adapter\Pdo\Mysql->query(Object(Magento\Framework\DB\Select), Array)
#7 /home/vagrant/magento2/vendor/magento/framework/Data/Collection/AbstractDb.php(217): Zend_Db_Adapter_Abstract->fetchOne(Object(Magento\Framework\DB\Select), Array)
#8 /home/vagrant/magento2/vendor/magento/module-eav/Model/AttributeRepository.php(130): Magento\Framework\Data\Collection\AbstractDb->getSize()
#9 /home/vagrant/magento2/vendor/magento/module-catalog/Model/Product/Attribute/Repository.php(97): Magento\Eav\Model\AttributeRepository->getList('catalog_product', Object(Magento\Framework\Api\SearchCriteria))
#10 /home/vagrant/magento2/var/generation/Magento/Catalog/Model/Product/Attribute/Repository/Interceptor.php(37): Magento\Catalog\Model\Product\Attribute\Repository->getList(Object(Magento\Framework\Api\SearchCriteria))
#11 /home/vagrant/magento2/vendor/magento/module-catalog/Ui/Component/Listing/Attribute/AbstractRepository.php(42): Magento\Catalog\Model\Product\Attribute\Repository\Interceptor->getList(Object(Magento\Framework\Api\SearchCriteria))
#12 /home/vagrant/magento2/vendor/magento/module-catalog/Ui/Component/Listing/Columns.php(54): Magento\Catalog\Ui\Component\Listing\Attribute\AbstractRepository->getList()
#13 /home/vagrant/magento2/vendor/magento/framework/View/Layout/Generator/UiComponent.php(148): Magento\Catalog\Ui\Component\Listing\Columns->prepare()
#14 /home/vagrant/magento2/vendor/magento/framework/View/Layout/Generator/UiComponent.php(145): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Catalog\Ui\Component\Listing\Columns))
#15 /home/vagrant/magento2/vendor/magento/framework/View/Layout/Generator/UiComponent.php(126): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Ui\Component\Listing))
#16 /home/vagrant/magento2/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'product_listing', Array, Object(Magento\Framework\View\Layout\Interceptor))
#17 /home/vagrant/magento2/vendor/magento/framework/View/Layout/GeneratorPool.php(86): Magento\Framework\View\Layout\Generator\UiComponent->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#18 /home/vagrant/magento2/vendor/magento/framework/View/Layout.php(327): Magento\Framework\View\Layout\GeneratorPool->process(Object(Magento\Framework\View\Layout\Reader\Context), Object(Magento\Framework\View\Layout\Generator\Context))
#19 /home/vagrant/magento2/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#20 /home/vagrant/magento2/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#21 /home/vagrant/magento2/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#22 /home/vagrant/magento2/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#23 /home/vagrant/magento2/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#24 /home/vagrant/magento2/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build()
#25 /home/vagrant/magento2/var/generation/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu')
#26 /home/vagrant/magento2/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout\Interceptor->getBlock('menu')
#27 /home/vagrant/magento2/var/generation/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Catalog...')
#28 /home/vagrant/magento2/vendor/magento/module-catalog/Controller/Adminhtml/Product/Index.php(39): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Catalog...')
#29 /home/vagrant/magento2/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Index/Interceptor.php(24): Magento\Catalog\Controller\Adminhtml\Product\Index->execute()
#30 /home/vagrant/magento2/vendor/magento/framework/App/Action/Action.php(102): Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor->execute()
#31 /home/vagrant/magento2/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#32 [internal function]: Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#33 /home/vagrant/magento2/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#34 /home/vagrant/magento2/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor->___callParent('dispatch', Array)
#35 /home/vagrant/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor), Array, 'adminAuthentica...')
#36 /home/vagrant/magento2/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#37 [internal function]: Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#38 /home/vagrant/magento2/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
#39 /home/vagrant/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor), Array, 'designLoader')
#40 /home/vagrant/magento2/vendor/magento/framework/App/Action/Plugin/Design.php(39): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#41 [internal function]: Magento\Framework\App\Action\Plugin\Design->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#42 /home/vagrant/magento2/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
#43 /home/vagrant/magento2/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Catalog...', 'dispatch', Object(Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor), Array, 'adminMassaction...')
#44 /home/vagrant/magento2/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#45 [internal function]: Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#46 /home/vagrant/magento2/vendor/magento/framework/Interception/Interceptor.php(140): call_user_func_array(Array, Array)
#47 /home/vagrant/magento2/var/generation/Magento/Catalog/Controller/Adminhtml/Product/Index/Interceptor.php(39): Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#48 /home/vagrant/magento2/vendor/magento/framework/App/FrontController.php(55): Magento\Catalog\Controller\Adminhtml\Product\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#49 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#50 /home/vagrant/magento2/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
#51 /home/vagrant/magento2/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#52 /home/vagrant/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#53 /home/vagrant/magento2/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#54 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#55 /home/vagrant/magento2/vendor/magento/framework/Interception/Chain/Chain.php(67): call_user_func_array(Array, Array)
#56 /home/vagrant/magento2/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'storeCookieVali...')
#57 /home/vagrant/magento2/vendor/magento/module-store/Model/Plugin/StoreCookie.php(78): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#58 [internal function]: Magento\Store\Model\Plugin\StoreCookie->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#59 /home/vagrant/magento2/vendor/magento/framework/Interception/Interceptor.php(140): call_user_func_array(Array, Array)
#60 /home/vagrant/magento2/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#61 /home/vagrant/magento2/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#62 /home/vagrant/magento2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#63 /home/vagrant/magento2/pub/index.php(37): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#64 {main}

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 16 (5 by maintainers)

Most upvoted comments

@chrissm79 @rakeshjesadiya @toonvd Regarding “SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name ‘’” which occurs in Admin > Products > Catalog after migration. I believe hotfix is to check and fix the field additional_attribute_table of eav_entity_type table in Magento 2 DB

  1. For the record where eav_entity_type.entity_type_code with value ‘customer’ the field additional_attribute_table should contain ‘customer_eav_attribute’
  2. For the record where eav_entity_type.entity_type_code with value ‘customer_address’ the field additional_attribute_table should contain ‘customer_eav_attribute’
  3. For the record where eav_entity_type.entity_type_code with value ‘catalog_category’ the field additional_attribute_table should contain ‘catalog_eav_attribute’
  4. For the record where eav_entity_type.entity_type_code with value ‘customer_address’ the field additional_attribute_table should contain ‘catalog_eav_attribute’

See the screenshot

eav_entity_type