Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uncaught TypeError in MigrateSettingsCommand #64

Closed
jknipper opened this issue Feb 24, 2016 · 18 comments
Closed

Uncaught TypeError in MigrateSettingsCommand #64

jknipper opened this issue Feb 24, 2016 · 18 comments
Assignees

Comments

@jknipper
Copy link

I've got an error after installing data-migration-tool with composer when I run bin/magento from command line. I'm using version 2.0.2 on PHP 7.

`Fatal error: Uncaught TypeError: Argument 1 passed to Migration\Console\MigrateSettingsCommand::__construct() must be an instance of Migration\Config, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /src/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 97 and defined in /src/vendor/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php:24
Stack trace:
#0 /src/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(97): Migration\Console\MigrateSettingsCommand->__construct(Object(Magento\Framework\ObjectManager\ObjectManager))
#1 /src/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Migration\Conso...', Array)
#2 /src/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Compiled->create('Migration\Conso...')
#3 /src/vendor/magento/data-migration-tool/src/Migration/Console/CommandList.php(52): Magento\Fr in /src/vendor/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php on line 24

`

Any help would be appreciated.

@nfletton
Copy link

I can confirm the same experience on 2.0.2 with PHP 7. It wasn't happening a few weeks ago when I first set up the development site and performed the initial migration. This makes me think it started occurring after a dot release of PHP 7.0 as I've seen a couple come in recently.

I use the following repository on Ubuntu 14.04:
https://launchpad.net/~ondrej/+archive/ubuntu/php

@nfletton
Copy link

Decided to switch to PHP 5.6 and this cleared the problem. 7.0 and Magento 2 is a too fragile for me at this time.

@svewap
Copy link

svewap commented Apr 16, 2016

I'm using PHP 5.6 and this error appers after compiling DI

@kandrejevs
Copy link

kandrejevs commented May 23, 2016

This error appeared after updating to 2.0.6 and compiling DI. I'm using php7

@4DallasC
Copy link

Yeah, I got this error after compiling Magento 2. I deleted the directories var/di, var/generation/ var/cache var/page_cache and var/view_preprocessed and it all worked fine.

@csdougliss
Copy link

I get this error using Magento 2.1 and the Data Migration Tool 2.1:

/usr/bin/env php -f bin/magento -- maintenance:enable

PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Migration\Console\MigrateSettingsCommand::__construct() must be an instance of Migration\Config, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /var/www/vhosts/magento2-capistrano/releases/20160722103233/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/vhosts/magento2-capistrano/releases/20160722103233/vendor/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php:24

Stack trace:

#0 /var/www/vhosts/magento2-capistrano/releases/20160722103233/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Migration\Console\MigrateSettingsCommand->__construct(Object(Magento\Framework\ObjectManager\ObjectManager))

#1 /var/www/vhosts/magento2-capistrano/releases/20160722103233/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Migration\\Conso...', Array)

#2 /var/www/vhosts/magento in /var/www/vhosts/magento2-capistrano/releases/20160722103233/vendor/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php on line 24

@4DallasC
Copy link

@craigcarnell, I don't think the migration tool works with a compiled instance of Magento 2. Try deleting the var/generation and other temporary directories.

@victor-v-rad
Copy link
Collaborator

Internal ticket MAGETWO-52162 was created to fix the issue

@PreacherX
Copy link

PreacherX commented Aug 9, 2016

Adding another instance of the issue.

Magento 2.1, Migration tool 2.1 loaded from repo.magento.com using composer. cPanel 58.0.12, EasyApache4 compiled with PHP 7.0.9 and Apache 2.4.23 (cPanel)

This is the second system that has failed to move to production mode for performance testing. Both VPS' that I have done the migration on have resulted in the same issue.

Previous system was:

Magento 2.1, Migration tool 2.1 loaded from repo.magento.com using composer. cPanel 58.0.8, EasyApache3 compiled with PHP 5.6.23 and Apache 2.4.23 (cPanel)

bin/magento deploy:mode:set production resulted in:

Starting deployment of static content
Something went wrong while deploying static content. See the error log for details.
Command returned non-zero exit code:
/opt/cpanel/ea-php70/root/usr/bin/php -f /home/user/public_html/bin/magento setup:static-content:deploy en_US

The resulting error_log is:

[09-Aug-2016 04:03:20 UTC] PHP Fatal error:  Uncaught TypeError: Argument 1 passed to Migration\Console\MigrateSettingsCommand::__construct() must be an instance of Migration\Config, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /home/user/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /home/user/public_html/vendor/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php:24
Stack trace:
#0 /home/user/public_html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Migration\Console\MigrateSettingsCommand->__construct(Object(Magento\Framework\ObjectManager\ObjectManager))
#1 /home/user/public_html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Migration\\Conso...', Array)
#2 /home/user/public_html/vendor/magento/framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Compiled->create('Migratio in /home/user/public_html/vendor/magento/data-migration-tool/src/Migration/Console/MigrateSettingsCommand.php on line 24

@flecxie
Copy link

flecxie commented Aug 13, 2016

@victor-v-rad: noticed that you checked in these 2 commits to fix this issue in 2.1.1:

Is there a simple fix or workaround for 2.1.0 users (patches above look a bit complex to manually merge in)? Is my understanding correct that on 2.1.0 one can only switch from developer to production after uninstalling the migration tool?

Thanks!

@victor-v-rad
Copy link
Collaborator

Though 2.1.1 is not ready yet you can try the fix

@victor-v-rad
Copy link
Collaborator

switch from developer to production after uninstalling the migration tool?

you do not necessary need to uninstall the tool to switch to production

@btwq
Copy link

btwq commented Aug 22, 2016

+1 on Magento 2.1.0. Error occurs on command line after running "bin/magento setup:di:compile"

@bartoll
Copy link

bartoll commented Aug 23, 2016

+1

@medma-infomatix
Copy link

I have fixed that issue by updating composer using below command.

$ comoser update

@hexboxone
Copy link

I have similar problems on Magento 2.1.0 with PHP7, but setup:di:compile works fine and exits with "Generated code and dependency injection configuration successfully."
On static-content:deploy same error's are thrown:
Fatal error: Uncaught TypeError: Argument 1 passed to Migration\Console\MigrateSettingsCommand::__construct() must be an instance of Migration\Config, instance of Magento\Framework\ObjectManager\ObjectManager given, called in

Note: composer was fresh installed from last version on githup today.

@victor-v-rad
Copy link
Collaborator

@jknipper @hexboxone
Please recheck the issue on the last release of the tool 2.1.1

@ilol
Copy link

ilol commented Sep 12, 2016

Hey, I am temporary closing until any respond.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests