M2EPro 1.1.2 / M2.1.1 / Magento orders not created

Recommended Posts

M2EPro 1.1.2

Magento 2.1.1


Amazon FBA orders are brought in but Magento orders are not created. If I attempt to manually create the Magento order a http 500 error is generated

Please see error tracing and the hosting providers comments below

Here is the associated error:

[25-Sep-2016 20:14:58 UTC] PHP Fatal error:  Uncaught TypeError: Argument 20 passed to Magento\Customer\Model\Customer::__construct() must be of the type array, object given, called in /home/pos1/pos1_us/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /home/pos1/pos1_us/vendor/magento/module-customer/Model/Customer.php:234

Stack trace:
#0 /home/pos1/pos1_us/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Magento\Customer\Model\Customer->__construct(Object(Magento\Framework\Model\Context), Object(Magento\Framework\Registry), Object(Magento\Store\Model\StoreManager), Object(Magento\Eav\Model\Config), Object(Magento\Framework\App\Config), Object(Magento\Customer\Model\ResourceModel\Customer\Interceptor), Object(Magento\Customer\Model\Config\Share\Interceptor), Object(Magento\Customer\Model\AddressFactory), Object(Magento\Customer\Model\ResourceModel\Address\CollectionFactory), Object(Magento\Framework\Mail\Template\TransportBuilder), Object(Magento\Customer\Model\ResourceModel\GroupReposi in /home/pos1/pos1_us/vendor/magento/module-customer/Model/Customer.php on line 234

The array comes from /home/pos1/pos1_us/vendor/magento/module-customer/Model/Customer.php:234 and is below:

 234     public function __construct(
    235         \Magento\Framework\Model\Context $context,
    236         \Magento\Framework\Registry $registry,
    237         \Magento\Store\Model\StoreManagerInterface $storeManager,
    238         \Magento\Eav\Model\Config $config,
    239         \Magento\Framework\App\Config\ScopeConfigInterface $scopeConfig,
    240         \Magento\Customer\Model\ResourceModel\Customer $resource,
    241         \Magento\Customer\Model\Config\Share $configShare,
    242         \Magento\Customer\Model\AddressFactory $addressFactory,
    243         \Magento\Customer\Model\ResourceModel\Address\CollectionFactory $addressesFactory,
    244         \Magento\Framework\Mail\Template\TransportBuilder $transportBuilder,
    245         GroupRepositoryInterface $groupRepository,
    246         \Magento\Framework\Encryption\EncryptorInterface $encryptor,
    247         \Magento\Framework\Stdlib\DateTime $dateTime,
    248         CustomerInterfaceFactory $customerDataFactory,
    249         DataObjectProcessor $dataObjectProcessor,
    250         \Magento\Framework\Api\DataObjectHelper $dataObjectHelper,
    251         \Magento\Customer\Api\CustomerMetadataInterface $metadataService,
    252         \Magento\Framework\Indexer\IndexerRegistry $indexerRegistry,
    253         \Magento\Framework\Data\Collection\AbstractDb $resourceCollection = null,
    254         array $data = []
    255     )

The call for the array comes from /home/pos1/pos1_us/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93:

91     protected function createObject($type, $args)
     92     {
     93         return new $type(...array_values($args));
     94     }

You can try clearing out caches, and running the following:

php70 bin/magento setup:upgrade
php70 bin/magento setup:static-content:deploy
php70 bin/magento setup:di:compile

If that doesn't resolve the issue, you'll need to identify what object is being passed through to Magento\Customer\Model\Customer::__construct(); wherever the object comes from, it needs to be an array instead.


Share this post

Link to post
Share on other sites

Here is an update from the hosting provider in attempting to track down the cause of this error


Sep 26, 8:47 PM EDT

Hello Michael,

Although M2ePro development team has denied this to be their issue, I have narrowed it down to when \Ess\M2ePro\Model\Magento\Customer is called is when this error occurs. I don't think they really looked into it. Also, everytime I try to log the $args for the customer creation, it errors, so I can't even get what is being passed to cause this error, however I am pretty certain it is in fact an issue with M2ePro

Phone - +1 (866) 291-0125
Fax - +1 (412) 592-0348
Magento Hosting by Magento Experts

Share this post

Link to post
Share on other sites

Thanks for your comments

Magemojo has re-installed both M2.1.1 and M2E Pro 1.1.2 following documentation exactly.

No orders or 3rd party listings are being brought into M2E Pro

The logs are blank so I can't see where the failure is occurring.

I appreciate any help that can be provided.

Share this post

Link to post
Share on other sites

The problem is related to the compilation. The errors you have referred appear when command 'magento setup:di:compile' was not applied or was not performed successfully.  Try to run the command again and check the issue.

Share this post

Link to post
Share on other sites

Hello Victoria,


You are incorrect in your assertion, even in developer mode when compilation is bypassed and is done on the fly does it not work.


The issue resides in M2ePro/Model/Magento/Customer.php when passing $customerData to factory it is an object not an array, when converting to array, customer creation does actually work, then it errors on Address creation go figure.


Please have one of your developers look into function buildCustomer(), it is incorrect, and please stop with the incorrect answers.

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.