0

Ive tried to add my custom category eav attribute but after setup:upgrade and setup:di:compile I get the following error:

2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.catalog_category_entity_varchar(' doesn't exist, query was: (SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_varchar` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_int` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_text` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_datetime` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_decimal` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_varchar(` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)
Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.catalog_category_entity_varchar(' doesn't exist

Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.catalog_category_entity_varchar(' doesn't exist, query was: (SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_varchar` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_int` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_text` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_datetime` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_decimal` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)UNION ALL(SELECT `t`.`value`, `t`.`attribute_id` FROM `catalog_category_entity_varchar(` AS `t` WHERE (entity_id = '3') AND (`store_id` IN (1, 0)) ORDER BY `t`.`store_id` DESC
)
#0 /path/to/magento/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)
#1 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#2 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#3 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('(SELECT `t`.`va...', Array)
#4 /path/to/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(465): Zend_Db_Adapter_Pdo_Abstract->query('(SELECT `t`.`va...', Array)
#5 /path/to/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(520): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('(SELECT `t`.`va...', Array)
#6 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(737): Magento\Framework\DB\Adapter\Pdo\Mysql->query(Object(Magento\Framework\DB\Sql\UnionExpression), Array)
#7 /path/to/magento/vendor/magento/module-eav/Model/ResourceModel/ReadHandler.php(184): Zend_Db_Adapter_Abstract->fetchAll(Object(Magento\Framework\DB\Sql\UnionExpression))
#8 /path/to/magento/vendor/magento/framework/EntityManager/Operation/Read/ReadAttributes.php(59): Magento\Eav\Model\ResourceModel\ReadHandler->execute('Magento\\Catalog...', Array, Array)
#9 /path/to/magento/vendor/magento/framework/EntityManager/Operation/Read.php(116): Magento\Framework\EntityManager\Operation\Read\ReadAttributes->execute(Object(Magento\Catalog\Model\Category\Interceptor), Array)
#10 /path/to/magento/vendor/magento/framework/EntityManager/EntityManager.php(61): Magento\Framework\EntityManager\Operation\Read->execute(Object(Magento\Catalog\Model\Category\Interceptor), 3, Array)
#11 /path/to/magento/vendor/magento/module-catalog/Model/ResourceModel/Category.php(1012): Magento\Framework\EntityManager\EntityManager->load(Object(Magento\Catalog\Model\Category\Interceptor), 3)
#12 /path/to/magento/vendor/magento/framework/Model/AbstractModel.php(531): Magento\Catalog\Model\ResourceModel\Category->load(Object(Magento\Catalog\Model\Category\Interceptor), 3, NULL)
#13 /path/to/magento/vendor/magento/module-catalog/Model/CategoryRepository.php(139): Magento\Framework\Model\AbstractModel->load(3)
#14 /path/to/magento/app/code/Borntocreate/Common/Block/CategoryNavigation.php(82): Magento\Catalog\Model\CategoryRepository->get(3)
#15 /path/to/magento/app/code/Borntocreate/Common/view/frontend/templates/category-navigation.phtml(7): Borntocreate\Common\Block\CategoryNavigation->getCategory(3)
#16 /path/to/magento/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/d...')
#17 /path/to/magento/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Borntocreate\Common\Block\CategoryNavigation), '/var/www/html/d...', Array)
#18 /path/to/magento/vendor/magento/framework/View/Element/Template.php(279): Magento\Framework\View\Element\Template->fetchView('/var/www/html/d...')
#19 /path/to/magento/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
#20 /path/to/magento/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml()
#21 /path/to/magento/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('maruhn-category...')
#22 /path/to/magento/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout->renderNonCachedElement('maruhn-category...')
#23 /path/to/magento/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout->renderElement('maruhn-category...')
#24 /path/to/magento/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('root')
#25 /path/to/magento/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout->renderNonCachedElement('root')
#26 /path/to/magento/vendor/magento/framework/View/Layout.php(938): Magento\Framework\View\Layout->renderElement('root')
#27 /path/to/magento/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Framework\View\Layout->getOutput()
#28 /path/to/magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(39): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
#29 /path/to/magento/vendor/magento/framework/View/Result/Page.php(243): Magento\Framework\View\Layout\Interceptor->getOutput()
#30 /path/to/magento/vendor/magento/framework/View/Result/Layout.php(164): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#31 /path/to/magento/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#32 /path/to/magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#33 /path/to/magento/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'renderResult', Object(Magento\Framework\View\Result\Page\Interceptor), Array, 'result-varnish-...')
#34 /path/to/magento/vendor/magento/module-page-cache/Model/Controller/Result/VarnishPlugin.php(74): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#35 /path/to/magento/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\Controller\Result\VarnishPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#36 /path/to/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'renderResult', Object(Magento\Framework\View\Result\Page\Interceptor), Array, 'result-builtin-...')
#37 /path/to/magento/vendor/magento/module-page-cache/Model/Controller/Result/BuiltinPlugin.php(67): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#38 /path/to/magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\Controller\Result\BuiltinPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#39 /path/to/magento/var/generation/Magento/Framework/View/Result/Page/Interceptor.php(26): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#40 /path/to/magento/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#41 /path/to/magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#42 /path/to/magento/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#43 {main}

Exception #1 (PDOException): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'databasename.catalog_category_entity_varchar(' doesn't exist
#0 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /path/to/magento/vendor/magento/framework/DB/Statement/Pdo/Mysql.php(95): Zend_Db_Statement_Pdo->_execute(Array)
#2 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Statement.php(303): Magento\Framework\DB\Statement\Pdo\Mysql->_execute(Array)
#3 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(480): Zend_Db_Statement->execute(Array)
#4 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('(SELECT `t`.`va...', Array)
#5 /path/to/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(465): Zend_Db_Adapter_Pdo_Abstract->query('(SELECT `t`.`va...', Array)
#6 /path/to/magento/vendor/magento/framework/DB/Adapter/Pdo/Mysql.php(520): Magento\Framework\DB\Adapter\Pdo\Mysql->_query('(SELECT `t`.`va...', Array)
#7 /path/to/magento/vendor/magento/zendframework1/library/Zend/Db/Adapter/Abstract.php(737): Magento\Framework\DB\Adapter\Pdo\Mysql->query(Object(Magento\Framework\DB\Sql\UnionExpression), Array)
#8 /path/to/magento/vendor/magento/module-eav/Model/ResourceModel/ReadHandler.php(184): Zend_Db_Adapter_Abstract->fetchAll(Object(Magento\Framework\DB\Sql\UnionExpression))
#9 /path/to/magento/vendor/magento/framework/EntityManager/Operation/Read/ReadAttributes.php(59): Magento\Eav\Model\ResourceModel\ReadHandler->execute('Magento\\Catalog...', Array, Array)
#10 /path/to/magento/vendor/magento/framework/EntityManager/Operation/Read.php(116): Magento\Framework\EntityManager\Operation\Read\ReadAttributes->execute(Object(Magento\Catalog\Model\Category\Interceptor), Array)
#11 /path/to/magento/vendor/magento/framework/EntityManager/EntityManager.php(61): Magento\Framework\EntityManager\Operation\Read->execute(Object(Magento\Catalog\Model\Category\Interceptor), 3, Array)
#12 /path/to/magento/vendor/magento/module-catalog/Model/ResourceModel/Category.php(1012): Magento\Framework\EntityManager\EntityManager->load(Object(Magento\Catalog\Model\Category\Interceptor), 3)
#13 /path/to/magento/vendor/magento/framework/Model/AbstractModel.php(531): Magento\Catalog\Model\ResourceModel\Category->load(Object(Magento\Catalog\Model\Category\Interceptor), 3, NULL)
#14 /path/to/magento/vendor/magento/module-catalog/Model/CategoryRepository.php(139): Magento\Framework\Model\AbstractModel->load(3)
#15 /path/to/magento/app/code/Borntocreate/Common/Block/CategoryNavigation.php(82): Magento\Catalog\Model\CategoryRepository->get(3)
#16 /path/to/magento/app/code/Borntocreate/Common/view/frontend/templates/category-navigation.phtml(7): Borntocreate\Common\Block\CategoryNavigation->getCategory(3)
#17 /path/to/magento/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/d...')
#18 /path/to/magento/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Borntocreate\Common\Block\CategoryNavigation), '/var/www/html/d...', Array)
#19 /path/to/magento/vendor/magento/framework/View/Element/Template.php(279): Magento\Framework\View\Element\Template->fetchView('/var/www/html/d...')
#20 /path/to/magento/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
#21 /path/to/magento/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml()
#22 /path/to/magento/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('maruhn-category...')
#23 /path/to/magento/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout->renderNonCachedElement('maruhn-category...')
#24 /path/to/magento/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout->renderElement('maruhn-category...')
#25 /path/to/magento/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('root')
#26 /path/to/magento/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout->renderNonCachedElement('root')
#27 /path/to/magento/vendor/magento/framework/View/Layout.php(938): Magento\Framework\View\Layout->renderElement('root')
#28 /path/to/magento/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Framework\View\Layout->getOutput()
#29 /path/to/magento/var/generation/Magento/Framework/View/Layout/Interceptor.php(39): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
#30 /path/to/magento/vendor/magento/framework/View/Result/Page.php(243): Magento\Framework\View\Layout\Interceptor->getOutput()
#31 /path/to/magento/vendor/magento/framework/View/Result/Layout.php(164): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
#32 /path/to/magento/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#33 /path/to/magento/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
#34 /path/to/magento/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'renderResult', Object(Magento\Framework\View\Result\Page\Interceptor), Array, 'result-varnish-...')
#35 /path/to/magento/vendor/magento/module-page-cache/Model/Controller/Result/VarnishPlugin.php(74): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#36 /path/to/magento/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\Controller\Result\VarnishPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#37 /path/to/magento/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'renderResult', Object(Magento\Framework\View\Result\Page\Interceptor), Array, 'result-builtin-...')
#38 /path/to/magento/vendor/magento/module-page-cache/Model/Controller/Result/BuiltinPlugin.php(67): Magento\Framework\View\Result\Page\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Response\Http\Interceptor))
#39 /path/to/magento/vendor/magento/framework/Interception/Interceptor.php(142): Magento\PageCache\Model\Controller\Result\BuiltinPlugin->aroundRenderResult(Object(Magento\Framework\View\Result\Page\Interceptor), Object(Closure), Object(Magento\Framework\App\Response\Http\Interceptor))
#40 /path/to/magento/var/generation/Magento/Framework/View/Result/Page/Interceptor.php(26): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
#41 /path/to/magento/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
#42 /path/to/magento/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#43 /path/to/magento/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#44 {main}

But the required table exists and everything was working before fine.

Ive disabled my module and run setup:upgrade again, cleared the caches etc. but it still doesnt solve the error.

0

Ive found the error, I had an 'type' => 'varchar(6)' in my setup script wich was inserted as varchar( in table eav_attribute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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