Magento – Invalid entity_type specified Magento2

configurable-producteav-attributesmagento-2.0magento-2.1

I have Create Configurable Product, Then I open Configurable Product category

Its throw:

Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid entity_type specified:

I have created 30 custom attribute using via programmatically, this attributes have text, select, multiselect and yes/no types.

I have used following fields via creating custom attribute.

Text

  $eavSetup->addAttribute(
                \Magento\Catalog\Model\Product::ENTITY,
                'test_number',
                [
                    'group' => 'Product Details',/* Group name in which you want to display your custom attribute */
                    'attribute_set' =>  'Default',
                    'type' => 'text',  /* Data type in which formate your value save in database*/
                    'backend' => '',
                    'frontend' => '',
                    'label' => 'TEST NO',
                    'input' => 'text',
                    'class' => '',
                    'source' => '',
                    'global' => 1,
                    'visible' => true,
                    'required' => false,
                    'user_defined' => true,
                    'searchable' => false,
                    'filterable' => false,
                    'comparable' => false,
                    'visible_on_front' => false,
                    'used_in_product_listing' => false,
                    'unique' => false,
                    'apply_to' => '',
                    'system' => 1,
                    'visible_in_advanced_search' => false,
                    'filterable_in_search' => false,
                ]
            );

Select:

   $eavSetup->addAttribute(
                    \Magento\Catalog\Model\Product::ENTITY,
                    'product_size',
                    [
                        'group' => 'General',/* Group name in which you want to display your custom attribute */
                        'attribute_set' =>  'Default',
                        'type' => 'text', /* Data type in which formate your value save in database*/
                        'backend' => '',
                        'frontend' => '',
                        'label' => 'Size',
                        'input' => 'select',
                        'class' => '',
                        'source' => '',
                        'global' => 1,
                        'visible' => true,
                        'required' => false,
                        'user_defined' => true,
                        'searchable' => false,
                        'filterable' => false,
                        'comparable' => false,
                        'visible_on_front' => true,
                        'used_in_product_listing' => false,
                        'visible_in_advanced_search' => false,
                        'filterable_in_search' => false,
                        'unique' => false,
                        'apply_to' => '',
                        'system' => 1,
                        'option' => array('values' => array("0" ,"1" ,"2" ,"3" ,"4" ,"5" ,"6" ,"7" ,"8" ,"9" ,"10" ,"11" ,"12" ,"13" ,"14" ,"15" ,"16" ,"17" ,"18" ,"19" ,"20" ,"21" ,"22" ,"23" ,"24" ,"25" ,"26" ,"27" ,"28" ,"29" ,"30" ,"31" ,"32" ,"33" ,"34" ,"35" ,"36" ,"37" ,"38" ,"39" ,"40" ,"41" ,"42" ,"43" ,"44" ,"45" ,"46" ,"47" ,"48" ,"49" ,"50" ,"51" ,"S" ,"M" ,"L" ,"XL" ,"XXL" ,"XXXL" ,"XXXXL" , "52" , "53" , "54" , "55" , "56" , "57" , "58" , "59" , "60" , "61" , "62" , "63" , "64" , "65" , "66" , "67" , "68" , "69" , "70" , "71" , "72" , "73" , "74" , "75" , "76" , "77" , "78" , "79" , "80" , "81" , "82" , "83" , "84" , "85" , "86" , "87" , "88" , "89" , "90" , "91" , "92" , "93" , "94" , "95" , "96" , "97" , "98" , "99" , "100" , "101" , "X" , "XS" , "FS" , "F.S" , "M-INV" , "22.5" , "23.5" , "3-Feb"))
                    ]
                );

MultiSelect:

        $eavSetup->addAttribute(
                    \Magento\Catalog\Model\Product::ENTITY,
                    'multiselect_test',
                    [
                        'group' => 'Product Details',/* Group name in which you want to display your custom attribute */
                        'attribute_set' =>  'Default',
                        'type' => 'text',/* Data type in which formate your value save in database*/
                        'backend' => '',
                        'frontend' => '',
                        'label' => 'Multiselect Test',
                        'input' => 'multiselect',
                        'class' => '',
                        'source' => '',
                        'global' => 1,
                        'visible' => true,
                        'required' => false,
                        'user_defined' => true,
                        'searchable' => false,
                        'filterable' => false,
                        'comparable' => false,
                        'visible_on_front' => true,
                        'used_in_product_listing' => false,
                        'unique' => false,
                        'apply_to' => '',
                        'system' => 1,
                        'visible_in_advanced_search' => false,
                        'filterable_in_search' => false,
                        'option' => array('values' => array("Arangaetram Collection" ,"Casual Wear" ,"Christmas"))
                    ]
        );

yes/no:

          $eavSetup->addAttribute(
                    \Magento\Catalog\Model\Product::ENTITY,
                    'new_arrival',
                    [
                        'group' => 'Product Details',/* Group name in which you want to display your custom attribute */
                        'attribute_set' =>  'Default',
                        'type' => 'int',
                        'backend' => '',
                        'frontend' => '',
                        'label' => 'New Arrival',
                        'input' => 'boolean',
                        'class' => '',
                        'source' => '',
                        'global' => 1,
                        'visible' => true,
                        'required' => false,
                        'user_defined' => true,
                        'searchable' => false,
                        'filterable' => false,
                        'comparable' => false,
                        'visible_on_front' => false,
                        'used_in_product_listing' => false,
                        'unique' => false,
                        'apply_to' => '',
                        'system' => 1,
                        'visible_in_advanced_search' => false,
                        'filterable_in_search' => false
                    ]
        );

All attributes are created, After import products, then simple products are works fine, but configurable product throw Invalid entity_type specified

I have only used product_size select attribute in configurable product.

Suggest me, why its throw error, its there any issue in my custom attribute creation.

Note: each attribute have 2000+ values.

Full Error:

1 exception(s):
    Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid entity_type specified: 

    Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid entity_type specified: 
    #0 /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/AbstractAttribute.php(446): Magento\Eav\Model\Config->getEntityType(NULL)
    #1 /var/www/html/var/generation/Magento/Catalog/Model/ResourceModel/Eav/Attribute/Interceptor.php(1051): Magento\Eav\Model\Entity\Attribute\AbstractAttribute->getEntityType()
    #2 /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/AbstractAttribute.php(679): Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor->getEntityType()
    #3 /var/www/html/var/generation/Magento/Catalog/Model/ResourceModel/Eav/Attribute/Interceptor.php(1220): Magento\Eav\Model\Entity\Attribute\AbstractAttribute->getBackendTable()
    #4 /var/www/html/vendor/magento/module-configurable-product/Model/ResourceModel/Product/Type/Configurable.php(245): Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor->getBackendTable()
    #5 /var/www/html/vendor/magento/module-configurable-product/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php(266): Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable->getAttributeOptions(Object(Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor), '49180')
    #6 /var/www/html/vendor/magento/module-configurable-product/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php(170): Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection->loadOptions()
    #7 /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php(586): Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection->_afterLoad()
    #8 /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php(557): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false)
    #9 /var/www/html/vendor/magento/module-configurable-product/Model/Product/Type/Configurable.php(467): Magento\Framework\Data\Collection\AbstractDb->load()
    #10 /var/www/html/var/generation/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Interceptor.php(128): Magento\ConfigurableProduct\Model\Product\Type\Configurable->getConfigurableAttributes(Object(Magento\Catalog\Model\Product\Interceptor))
    #11 /var/www/html/vendor/magento/module-swatches/Model/SwatchAttributesProvider.php(56): Magento\ConfigurableProduct\Model\Product\Type\Configurable\Interceptor->getConfigurableAttributes(Object(Magento\Catalog\Model\Product\Interceptor))
    #12 /var/www/html/vendor/magento/module-swatches/Block/Product/Renderer/Configurable.php(233): Magento\Swatches\Model\SwatchAttributesProvider->provide(Object(Magento\Catalog\Model\Product\Interceptor))
    #13 /var/www/html/vendor/magento/module-swatches/Block/Product/Renderer/Listing/Configurable.php(32): Magento\Swatches\Block\Product\Renderer\Configurable->isProductHasSwatchAttribute()
    #14 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Swatches\Block\Product\Renderer\Listing\Configurable->_toHtml()
    #15 /var/www/html/var/generation/Magento/Swatches/Block/Product/Renderer/Listing/Configurable/Interceptor.php(882): Magento\Framework\View\Element\AbstractBlock->toHtml()
    #16 /var/www/html/vendor/magento/module-catalog/Block/Product/AbstractProduct.php(461): Magento\Swatches\Block\Product\Renderer\Listing\Configurable\Interceptor->toHtml()
    #17 /var/www/html/var/generation/Magento/Catalog/Block/Product/ListProduct/Interceptor.php(440): Magento\Catalog\Block\Product\AbstractProduct->getProductDetailsHtml(Object(Magento\Catalog\Model\Product\Interceptor))
    #18 /var/www/html/app/design/frontend/Meigee/underlinen/Magento_Catalog/templates/product/list.phtml(276): Magento\Catalog\Block\Product\ListProduct\Interceptor->getProductDetailsHtml(Object(Magento\Catalog\Model\Product\Interceptor))
    #19 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/a...')
    #20 /var/www/html/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Product\ListProduct\Interceptor), '/var/www/html/a...', Array)
    #21 /var/www/html/var/generation/Magento/Catalog/Block/Product/ListProduct/Interceptor.php(557): Magento\Framework\View\Element\Template->fetchView('/var/www/html/a...')
    #22 /var/www/html/vendor/magento/framework/View/Element/Template.php(279): Magento\Catalog\Block\Product\ListProduct\Interceptor->fetchView('/var/www/html/a...')
    #23 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
    #24 /var/www/html/var/generation/Magento/Catalog/Block/Product/ListProduct/Interceptor.php(882): Magento\Framework\View\Element\AbstractBlock->toHtml()
    #25 /var/www/html/vendor/magento/framework/View/Layout.php(542): Magento\Catalog\Block\Product\ListProduct\Interceptor->toHtml()
    #26 /var/www/html/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('category.produc...')
    #27 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('category.produc...')
    #28 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('category.produc...')
    #29 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('category.produc...', true)
    #30 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(499): Magento\Framework\View\Layout\Interceptor->renderElement('category.produc...', true)
    #31 /var/www/html/vendor/magento/module-catalog/Block/Category/View.php(98): Magento\Framework\View\Element\AbstractBlock->getChildHtml('product_list')
    #32 /var/www/html/app/design/frontend/Meigee/underlinen/Magento_Catalog/templates/category/products.phtml(18): Magento\Catalog\Block\Category\View->getProductListHtml()
    #33 /var/www/html/vendor/magento/framework/View/TemplateEngine/Php.php(59): include('/var/www/html/a...')
    #34 /var/www/html/vendor/magento/framework/View/Element/Template.php(255): Magento\Framework\View\TemplateEngine\Php->render(Object(Magento\Catalog\Block\Category\View), '/var/www/html/a...', Array)
    #35 /var/www/html/vendor/magento/framework/View/Element/Template.php(279): Magento\Framework\View\Element\Template->fetchView('/var/www/html/a...')
    #36 /var/www/html/vendor/magento/framework/View/Element/AbstractBlock.php(659): Magento\Framework\View\Element\Template->_toHtml()
    #37 /var/www/html/vendor/magento/framework/View/Layout.php(542): Magento\Framework\View\Element\AbstractBlock->toHtml()
    #38 /var/www/html/vendor/magento/framework/View/Layout.php(518): Magento\Framework\View\Layout->_renderBlock('category.produc...')
    #39 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('category.produc...')
    #40 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('category.produc...')
    #41 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('category.produc...', true)
    #42 /var/www/html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('category.produc...')
    #43 /var/www/html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('content')
    #44 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('content')
    #45 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('content')
    #46 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('content', true)
    #47 /var/www/html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('content')
    #48 /var/www/html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('main')
    #49 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('main')
    #50 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main')
    #51 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('main', true)
    #52 /var/www/html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('main')
    #53 /var/www/html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('columns.inner')
    #54 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('columns.inner')
    #55 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('columns.inner')
    #56 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('columns.inner', true)
    #57 /var/www/html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('columns.inner')
    #58 /var/www/html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('columns')
    #59 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('columns')
    #60 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('columns')
    #61 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('columns', true)
    #62 /var/www/html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('columns')
    #63 /var/www/html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('main.content')
    #64 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('main.content')
    #65 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('main.content')
    #66 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('main.content', true)
    #67 /var/www/html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('main.content')
    #68 /var/www/html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('page.wrapper')
    #69 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('page.wrapper')
    #70 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('page.wrapper')
    #71 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('page.wrapper', true)
    #72 /var/www/html/vendor/magento/framework/View/Layout.php(569): Magento\Framework\View\Layout\Interceptor->renderElement('page.wrapper')
    #73 /var/www/html/vendor/magento/framework/View/Layout.php(520): Magento\Framework\View\Layout->_renderContainer('root')
    #74 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(206): Magento\Framework\View\Layout->renderNonCachedElement('root')
    #75 /var/www/html/vendor/magento/framework/View/Layout.php(472): Magento\Framework\View\Layout\Interceptor->renderNonCachedElement('root')
    #76 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(193): Magento\Framework\View\Layout->renderElement('root', true)
    #77 /var/www/html/vendor/magento/framework/View/Layout.php(938): Magento\Framework\View\Layout\Interceptor->renderElement('root')
    #78 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(146): Magento\Framework\View\Layout->getOutput()
    #79 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(494): Magento\Framework\View\Layout\Interceptor->___callPlugins('getOutput', Array, Array)
    #80 /var/www/html/vendor/magento/framework/View/Result/Page.php(243): Magento\Framework\View\Layout\Interceptor->getOutput()
    #81 /var/www/html/vendor/magento/framework/View/Result/Layout.php(164): Magento\Framework\View\Result\Page->render(Object(Magento\Framework\App\Response\Http\Interceptor))
    #82 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\View\Result\Layout->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
    #83 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\View\Result\Page\Interceptor->___callParent('renderResult', Array)
    #84 /var/www/html/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-...')
    #85 /var/www/html/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))
    #86 /var/www/html/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))
    #87 /var/www/html/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-...')
    #88 /var/www/html/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))
    #89 /var/www/html/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))
    #90 /var/www/html/var/generation/Magento/Framework/View/Result/Page/Interceptor.php(130): Magento\Framework\View\Result\Page\Interceptor->___callPlugins('renderResult', Array, Array)
    #91 /var/www/html/vendor/magento/framework/App/Http.php(139): Magento\Framework\View\Result\Page\Interceptor->renderResult(Object(Magento\Framework\App\Response\Http\Interceptor))
    #92 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
    #93 /var/www/html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
    #94 {main}

Suggest me, how to fix this.

Note: I am using Magento 2.1.7

Best Answer

Well, if we go through the stack trace, it is clear that the program control searches for some configuration related to Model...

 #0 /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/AbstractAttribute.php(446): Magento\Eav\**Model**\Config->getEntityType(NULL)
#1 /var/www/html/var/generation/Magento/Catalog/Model/**ResourceModel**/Eav/Attribute/Interceptor.php(1051): Magento\Eav\Model\Entity\Attribute\AbstractAttribute->getEntityType()
#2 /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/AbstractAttribute.php(679): Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor->getEntityType()
#3 /var/www/html/var/generation/Magento/Catalog/Model/ResourceModel/Eav/Attribute/Interceptor.php(1220): Magento\Eav\Model\Entity\Attribute\AbstractAttribute->**getBackendTable()**
#4 /var/www/html/vendor/magento/module-configurable-product/Model/ResourceModel/Product/Type/Configurable.php(245): Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor->getBackendTable()
#5 /var/www/html/vendor/magento/module-configurable-product/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php(266): Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable->getAttributeOptions(Object(Magento\Catalog\Model\ResourceModel\Eav\Attribute\Interceptor), '49180')
#6 /var/www/html/vendor/magento/module-configurable-product/Model/ResourceModel/Product/Type/Configurable/Attribute/Collection.php(170): Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection->loadOptions()
#7 /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php(586): Magento\ConfigurableProduct\Model\ResourceModel\Product\Type\Configurable\Attribute\Collection->_afterLoad()
#8 /var/www/html/vendor/magento/framework/Data/Collection/AbstractDb.php(557): Magento\Framework\Data\Collection\AbstractDb->loadWithFilter(false, false)
#9 /var/www/html/vendor/magento/module-configurable-product/Model/Product/Type/Configurable.php(467): Magento\Framework\Data\Collection\AbstractDb->load()
#10 /var/www/html/var/generation/Magento/ConfigurableProduct/Model/Product/Type/Configurable/Interceptor.php(128): Magento\ConfigurableProduct\Model\Product\Type\Configurable->getConfigurableAttributes(Object(Magento\Catalog\Model\Product\Interceptor))
#11 /var/www/html/vendor/magento/module-swatches/Model/SwatchAttributesProvider.php(56): Magento\ConfigurableProduct\Model\Product\Type\Configurable\Interceptor->getConfigurableAttributes(Object(Magento\Catalog\Model\Product\Interceptor))

I suggest you to have a look into your config.xml file where we setup resources. To be clear, in the config.xml file,

<global>
    <models>
        <namespace_modulename>
            <class>namespace_modulename_Model</class>
            <resourceModel>some_resource</resourceModel>
        </namespace_modulename>
        <some_resource>
            <class>namespace_modulename_Model_Resource</class>
            <entities>
                # I think this is where you have to configure which tables
                # you are going to interact with in this "Model" 
                # so you have to map your table names(entities) here ....
                # please follow the link I have provided below.... 
            </entities>
        </some_resource>
    </models>
</global>

you can find detailed explanations here in alanstorm's website

I hope this would be of some help to you! :)

Related Topic