Question

enter image description here

When i'm trying to view my all migrated customers then getting following error.

1 exception(s):
 Exception #0 (BadMethodCallException): Missing required argument $options    of Magento\Eav\Model\Entity\Attribute\Source\Config.

Exception #0 (BadMethodCallException): Missing required argument $options of Magento\Eav\Model\Entity\Attribute\Source\Config.
#0 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php(82): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\\Eav\\Mod...', Array, Array)
#1 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\\Eav\\Mod...', Array)
#2 /var/www/html/vendor/magento/framework/Validator/UniversalFactory.php(36): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Eav\\Mod...', Array)
#3 /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/AbstractAttribute.php(537): Magento\Framework\Validator\UniversalFactory->create('Magento\\Eav\\Mod...')
#4 /var/www/html/vendor/magento/module-customer/Model/AttributeMetadataConverter.php(66): Magento\Eav\Model\Entity\Attribute\AbstractAttribute->getSource()
#5 /var/www/html/vendor/magento/module-customer/Model/Metadata/CustomerMetadata.php(77): Magento\Customer\Model\AttributeMetadataConverter->createMetadataAttribute(Object(Magento\Customer\Model\Attribute))
#6 /var/www/html/vendor/magento/module-customer/Model/Metadata/CustomerMetadata.php(109): Magento\Customer\Model\Metadata\CustomerMetadata->getAttributeMetadata('assigned_sales_...')
#7 /var/www/html/vendor/magento/module-customer/Model/Metadata/CachedMetadata.php(82): Magento\Customer\Model\Metadata\CustomerMetadata->getAllAttributesMetadata()
#8 /var/www/html/vendor/magento/module-customer/Ui/Component/Listing/AttributeRepository.php(66): Magento\Customer\Model\Metadata\CachedMetadata->getAllAttributesMetadata()
#9 /var/www/html/vendor/magento/module-customer/Ui/Component/Listing/Columns.php(96): Magento\Customer\Ui\Component\Listing\AttributeRepository->getList()
#10 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(148): Magento\Customer\Ui\Component\Listing\Columns->prepare()
#11 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(145): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Customer\Ui\Component\Listing\Columns))
#12 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(126): Magento\Framework\View\Layout\Generator\UiComponent->prepareComponent(Object(Magento\Ui\Component\Listing))
#13 /var/www/html/vendor/magento/framework/View/Layout/Generator/UiComponent.php(93): Magento\Framework\View\Layout\Generator\UiComponent->generateComponent(Object(Magento\Framework\View\Layout\Data\Structure), 'customer_listin...', Array, Object(Magento\Framework\View\Layout\Interceptor))
#14 /var/www/html/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))
#15 /var/www/html/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))
#16 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(89): Magento\Framework\View\Layout->generateElements()
#17 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(129): Magento\Framework\View\Layout\Interceptor->generateElements()
#18 /var/www/html/vendor/magento/framework/View/Page/Builder.php(55): Magento\Framework\View\Layout\Builder->generateLayoutBlocks()
#19 /var/www/html/vendor/magento/framework/View/Layout/Builder.php(65): Magento\Framework\View\Page\Builder->generateLayoutBlocks()
#20 /var/www/html/vendor/magento/framework/View/Layout.php(244): Magento\Framework\View\Layout\Builder->build()
#21 /var/www/html/vendor/magento/framework/View/Layout.php(859): Magento\Framework\View\Layout->build()
#22 /var/www/html/var/generation/Magento/Framework/View/Layout/Interceptor.php(414): Magento\Framework\View\Layout->getBlock('menu')
#23 /var/www/html/vendor/magento/module-backend/Model/View/Result/Page.php(59): Magento\Framework\View\Layout\Interceptor->getBlock('menu')
#24 /var/www/html/var/generation/Magento/Backend/Model/View/Result/Page/Interceptor.php(24): Magento\Backend\Model\View\Result\Page->setActiveMenu('Magento_Custome...')
#25 /var/www/html/vendor/magento/module-customer/Controller/Adminhtml/Index/Index.php(26): Magento\Backend\Model\View\Result\Page\Interceptor->setActiveMenu('Magento_Custome...')
#26 /var/www/html/var/generation/Magento/Customer/Controller/Adminhtml/Index/Index/Interceptor.php(24): Magento\Customer\Controller\Adminhtml\Index\Index->execute()
#27 /var/www/html/vendor/magento/framework/App/Action/Action.php(102): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->execute()
#28 /var/www/html/vendor/magento/module-backend/App/AbstractAction.php(226): Magento\Framework\App\Action\Action->dispatch(Object(Magento\Framework\App\Request\Http))
#29 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
#30 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->___callParent('dispatch', Array)
#31 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Custome...', 'dispatch', Object(Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor), Array, 'adminAuthentica...')
#32 /var/www/html/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))
#33 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#34 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Custome...', 'dispatch', Object(Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor), Array, 'adminMassaction...')
#35 /var/www/html/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#36 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#37 /var/www/html/var/generation/Magento/Customer/Controller/Adminhtml/Index/Index/Interceptor.php(39): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)
#38 /var/www/html/vendor/magento/framework/App/FrontController.php(55): Magento\Customer\Controller\Adminhtml\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#39 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#40 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#41 /var/www/html/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')
#42 /var/www/html/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#43 /var/www/html/vendor/magento/framework/Interception/Chain/Chain.php(67): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#44 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'infortis_cgen_m...')
#45 /var/www/html/app/code/Infortis/Cgen/Plugin/Magento/Framework/App/FrontController.php(32): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#46 /var/www/html/vendor/magento/framework/Interception/Interceptor.php(142): Infortis\Cgen\Plugin\Magento\Framework\App\FrontController->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#47 /var/www/html/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#48 /var/www/html/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#49 /var/www/html/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#50 /var/www/html/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#51 {main}

Update After compile and removed generation folder:

Fatal error: Uncaught TypeError: Argument 1 passed to Magento\Eav\Model\Entity\Attribute\Source\Config::__construct() must be of the type array, null given, called in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php:26 
Stack trace: #0 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Magento\Eav\Model\Entity\Attribute\Source\Config->__construct(NULL) 
#1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Magento\\Eav\\Mod...', Array) 
#2 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Compiled->create('Magento\\Eav\\Mod...', Array) 
#3 /var/www/html/vendor/magento/framework/Validator/UniversalFactory.php(36): Magento\Framework\ObjectManager\ObjectManager->create('Magento\\Eav\\Mod...', Arr in /var/www/html/vendor/magento/module-eav/Model/Entity/Attribute/Source/Config.php on line 26
Was it helpful?

Solution

Go to file var/www/html/vendor/magento/module-customer/Model/Config.php

Change to line 26 it will give detail description about error public function __construct(array $options) to public function __construct($options)

Detail error description

    Exception #0 (Magento\Framework\Exception\LocalizedException): No options found.
    #0 /var/www/html/vendor/magento/module-customer/Model/AttributeMetadataConverter.php(66): Magento\Eav\Model\Entity\Attribute\Source\Config->getAllOptions()
    #1 /var/www/html/vendor/magento/module-customer/Model/Metadata/CustomerMetadata.php(77): Magento\Customer\Model\AttributeMetadataConverter->createMetadataAttribute(Object(Magento\Customer\Model\Attribute))
    #2 /var/www/html/vendor/magento/module-customer/Model/Metadata/CustomerMetadata.php(109): Magento\Customer\Model\Metadata\CustomerMetadata->getAttributeMetadata('assigned_sales_...')
    .
    .
    etc

Then from that description take

#0 /var/www/html/vendor/magento/module-customer/Model/AttributeMetadataConverter.php(66):

Go to above file enter following code before line 66

echo '<pre>';
print_r($attribute->getData());

Then I get list of attribute_ids and see after which attribute_id error is comming take that one.

So I get attribute_id 150 who doesn't getting options.

So I'm not using that attribute_id so i have remove it..

Now my problem is solved and I can see my all migrated customers.

Please revert back all changes made in core files.

OTHER TIPS

I used this solution to solve the problem

  • open phpmyadmin
  • open 'customer_eav_attribute' table
  • find out what attributes are imported looking at rows id

enter image description here

as you can see from id 40 there is a large gap before next id

  • export a table backup ( so you can rollback if needed )
  • delete attributes that are imported but not well applied

in my specific case deleting rows with id 146,285,286,+ has solved the problem

for me I deleted only rows with the following conditions

  • High ids that didn't run in sequence
  • that is not system attribute
  • that had 0 or null fields

In my case the problem was a custom select attribute that was missing source_model.

Steps to debug and fix:

  1. xdebug - place a breakpoint vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php#L261 (throw new \BadMethodCallException)
  2. go down through callstack and find the attribute_code
  3. On db run the query to get attribute data "select * from eav_attribute where attribute_id = [YOUR_ATTRIBUTE_ID] \G"
  4. Update source model of attribute (IF EMPTY) "update eav_attribute set source_model = 'Magento\Eav\Model\Entity\Attribute\Source\Table' where attribute_id = [YOUR_ATTRIBUTE_ID];"

I solved in this way:

  1. clean generated/code/ folder
  2. php bin/magento setup:di:compile

So, I have a new error type:

Uncaught TypeError: Argument 1 passed to Magento\Eav\Model\Entity\Attribute\Source\Config::__construct() must be of the type array, null given ..

  1. go to eav_attribute table, filtering for entity_type_id = 1 (Customer entity) and look for the custom source model in source_model column
  2. create the source model for Magento 2 (//Model/Attribute/
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top