Magento2: Undefined Index: arguments in lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php line 132

Created on 10 Dec 2015  路  26Comments  路  Source: magento/magento2

After nearly a dozen clean, magento 2 installs on centos 7, I keep getting this error when I navigate to System -> Web Setup Wizard.

Fatal error: Uncaught exception 'Exception' with message 'Notice: Undefined index: arguments in /home/andrew/public_html/labs/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php on line 132' in /home/andrew/public_html/labs/lib/internal/Magento/Framework/App/ErrorHandler.php on line 61
( ! ) Exception: Notice: Undefined index: arguments in /home/andrew/public_html/labs/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php on line 132 in /home/andrew/public_html/labs/lib/internal/Magento/Framework/App/ErrorHandler.php on line 61

This is post install, when I navigate in Magento 2 admin, via System > Web Setup Wizard.

system: Centos 7
httpd-2.4.6-31.el7.centos.1.x86_64
php56w-5.6.13-1.w7.x86_64
mysql-community-server-5.6.26-2.el7.x86_64

Steps to reproduce.

  1. git clone magento 2
  2. git checkout master
  3. composer install
  4. Use setup wizard to install magento 2
  5. bin/magento deploy:mode:set developer
  6. edit .htaccess and enable developer mode
  7. bin/magento setup:static-content:deploy
  8. bin/magento setup:di:compile

All files owned by me as user, and apache as group.
All file/folder permissions are 660/770.
Frontend appears fine, can navigate around and pages load.
Admin appears fine, can navigate around and modify/add/edit settings, categories, products, cms pages no problem.

If I install on Ubuntu (digital ocean), it works fine, but when I install on Centos 7, this error happens and I cannot install sample data.

sample data requires magento 2 credentials generated via magento commerce site. If I put credentials in auth.json, it won't install. I'm forced to add credentials via admin UI system -> Web Setup Wizard. Even if credentials are in .composer/auth.json, bin/magento sampledata:deploy fails on requiring credentials.

Setup Cannot Reproduce Format is not valid Ready for Work bug report

Most helpful comment

Confirmed that this is still an issue on 2.1.0 release branch, Re-opened so we can take a look at this again.

All 26 comments

I have the same error..

someone has solved?

Same error for me.

Hi. Not a solution, but I wanted to make sure you were not following the steps above for building a production site. Production sites should not use 'master' from the git repo. For example, master now includes some Magento 2.1 functionality (under development). It is half way between 2.0 and 2.1. It is always recommended to build production sites using officially released composer packages. Otherwise upgrades are not guaranteed to work, extensions are not guaranteed to work, etc.

This is not an excuse for it not working, but I noticed a few people saying "me too", which had me concerned people thought they should be getting the latest code from git to build a production site. They should not. Only people who want to sneak peak at the next release, or want to submit a pull request, should be checking out the git repo directly. Upgrades and patches are not guaranteed to work if it grab an arbitrary version from the git repo.

+1, but @alankent I think you meant develop, there is no longer a master branch only develop, 2.0 and merchant_beta

Hi @j88per ,

Some notes about the steps:

  1. git clone magento 2
  2. git checkout master - as @mazhalai mentioned, master branch does not exist anymore. If you want to use the latest version, please, use develop branch.
  3. composer install
  4. Use setup wizard to install magento 2
  5. bin/magento deploy:mode:set developer
  6. edit .htaccess and enable developer mode - it's not needed, as you switched to developer mode in step 5
  7. bin/magento setup:static-content:deploy
  8. bin/magento setup:di:compile

About steps 7 and 8 - these are usually needed for "production" mode. Be sure that you're ok with these files pre-generated in "developer" mode. Some functionality may work not as expected (e.g., modification of DI configuration may not take effect). You may have mentioned errors due to the compiled DI. Please, try to clean "var" and not compile anything and see if you still have same error.

If you will use "develop" branch, please, make sure you add "repo.magento.com" to repositories in composer.json before running sample data deployment command (the documentation does not have this update yet, but it is in progress).

composer config repositories.magento composer https://repo.magento.com

@j88per, @arcadiatec do you have Magento profiler enabled?

I have a trace for the error (which appears for me when running setup:install), in case it helps anyone:

Exception trace:
() at /var/www/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php:132
Composer\Util\ErrorHandler::handle() at /var/www/lib/internal/Magento/Framework/ObjectManager/Config/Compiled.php:132
Magento\Framework\ObjectManager\Config\Compiled->extend() at /var/www/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php:84
Magento\Framework\ObjectManager\ObjectManager->configure() at /var/www/setup/src/Magento/Setup/Model/ObjectManagerProvider.php:62
Magento\Setup\Model\ObjectManagerProvider->get() at /var/www/setup/src/Magento/Setup/Module/SetupFactory.php:39
Magento\Setup\Module\SetupFactory->create() at /var/www/setup/src/Magento/Setup/Model/Installer.php:728
Magento\Setup\Model\Installer->installSchema() at n/a:n/a
call_user_func_array() at /var/www/setup/src/Magento/Setup/Model/Installer.php:331
Magento\Setup\Model\Installer->install() at /var/www/setup/src/Magento/Setup/Console/Command/InstallCommand.php:125
Magento\Setup\Console\Command\InstallCommand->execute() at /var/www/vendor/symfony/console/Symfony/Component/Console/Command/Command.php:257
Symfony\Component\Console\Command\Command->run() at /var/www/vendor/symfony/console/Symfony/Component/Console/Application.php:874
Symfony\Component\Console\Application->doRunCommand() at /var/www/vendor/symfony/console/Symfony/Component/Console/Application.php:195
Symfony\Component\Console\Application->doRun() at /var/www/lib/internal/Magento/Framework/Console/Cli.php:49
Magento\Framework\Console\Cli->doRun() at /var/www/vendor/symfony/console/Symfony/Component/Console/Application.php:126
Symfony\Component\Console\Application->run() at /var/www/bin/magento:25

There should be a problem in steps 7,8. Delete contents of var/di, var/generation.

Clearing out var/di and var/generation solved this issue for me, thanks @bogatyrjov

What is the permanent solution for this? It doesn't seem manually clearing out directories after a compile is a good solution.

@jim5359 it is not clearing our directories after a compile. Rather, cleaning it out before a fresh install or upgrade. We are aware of this and it will be addressed in ticket MAGETWO-50955

Oh, perhaps I need to open a new ticket then. I'm seeing this issue whenever I run:
bin/magento setup:di:compile

After running this I have to clear the var/di directory or else I get the Notice. I'm guessing it's related.

@jim5359 do you change code and then run compile?

Yes, after changing code in my extension I then run compile. Is this unnecessary?

Well, if you are changing code, you should be in developer mode, so then you dont have to run compile every time.

Ah, good to know. I just started building extensions. I guess this is less of an issue if I don't have to run compile. Thanks!

The fix for this issue has been delivered to the develop branch. Please check out the latest code. I will close this issue for now. You can reopen this issue if you still see this problem after you check out the latest code.

still seeing this in the latest 2.1.0 release when browsing the store's frontend after a fresh compile:

Notice: Undefined index: arguments in /var/www/users/xxx/src/www/vendor/magento/framework/ObjectManager/Config/Compiled.php on line 132

Notice: Undefined index: instanceTypes in /var/www/users/xxx/src/www/vendor/magento/framework/ObjectManager/Config/Compiled.php on line 133

Notice: Undefined index: preferences in /var/www/users/xxx/src/www/vendor/magento/framework/ObjectManager/Config/Compiled.php on line 134

Confirmed that this is still an issue on 2.1.0 release branch, Re-opened so we can take a look at this again.

Thanks for re-opening @jamescowie, I'm seeing this in Magento 2.1.0 too. Has anybody found a workaround for the time being?

1 exception(s):
Exception #0 (Exception): Notice: Undefined index: suggestions in /var/www/magento/module-elasticsearch/Model/DataProvider/Suggestions.php on line 158

Exception #0 (Exception): Notice: Undefined index: suggestions in /var/www/magento/module-elasticsearch/Model/DataProvider/Suggestions.php on line 158

@brideo your notice exceptions are from a different module, you should create another issue or ask enterprise support for a fix.

Ah my bad, will do.

@brideo

Workaround :
Add an isset condition in the file :
vendor/magento/module-elasticsearch/Model/DataProvider/Suggestions.php:157

if (is_array($result) && isset($result['suggestions'])) {

I just created an Enterprise support ticket.

It occurs only when I have no product on Magento EE 2.1.2

Sorry to disappear, I stopped working at this job and Magento 2 stuff. If someone else wants to take ownership that's fine, or it can stay here. Glad to see the community take over.

@j88per, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.

Was this page helpful?
0 / 5 - 0 ratings