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

Zend ServiceNotCreated Exception #1317

Closed
phphphp opened this issue May 29, 2015 · 9 comments
Closed

Zend ServiceNotCreated Exception #1317

phphphp opened this issue May 29, 2015 · 9 comments
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development

Comments

@phphphp
Copy link

phphphp commented May 29, 2015

I am getting the following when trying to run the setup on the current build. I followed the 2.0 installation documentation to the letter:

An error occurred during execution; please try again later.

Additional information:

Zend\ServiceManager\Exception\ServiceLocatorUsageException

File:
/var/www/html/magento2/vendor/zendframework/zend-servicemanager/Exception/ServiceLocatorUsageException.php:34
Message:
Service "Magento\Setup\Controller\Index" has been requested to plugin manager of type "Zend\Mvc\Controller\ControllerManager", but couldn't be retrieved.
A previous exception of type "Zend\ServiceManager\Exception\ServiceNotCreatedException" has been raised in the process.
By the way, a service with the name "Magento\Setup\Controller\Index" has been found in the parent service locator "Zend\ServiceManager\ServiceManager": did you forget to use $parentLocator = $serviceLocator->getServiceLocator() in your factory code?
Stack trace:
#0 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/AbstractPluginManager.php(312): Zend\ServiceManager\Exception\ServiceLocatorUsageException::fromInvalidPluginManagerRequestedServiceName(Object(Zend\Mvc\Controller\ControllerManager), Object(Zend\ServiceManager\ServiceManager), 'Magento\Setup\C...', Object(Zend\ServiceManager\Exception\ServiceNotCreatedException))
#1 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/AbstractPluginManager.php(120): Zend\ServiceManager\AbstractPluginManager->tryThrowingServiceLocatorUsageException('Magento\Setup\C...', false, Object(Zend\ServiceManager\Exception\ServiceNotCreatedException))
#2 /var/www/html/magento2/vendor/zendframework/zend-mvc/Controller/ControllerManager.php(137): Zend\ServiceManager\AbstractPluginManager->get('Magento\Setup\C...', Array, false)
#3 /var/www/html/magento2/vendor/zendframework/zend-mvc/DispatchListener.php(76): Zend\Mvc\Controller\ControllerManager->get('Magento\Setup\C...')
#4 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#5 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#6 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#7 /var/www/html/magento2/vendor/zendframework/zend-mvc/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#8 /var/www/html/magento2/setup/index.php(26): Zend\Mvc\Application->run()
#9 {main}

Previous exceptions:

Zend\ServiceManager\Exception\ServiceNotCreatedException

File:
/var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php:1135
Message:
An abstract factory could not create an instance of magentosetupcontrollerindex(alias: Magento\Setup\Controller\Index).
Stack trace:
#0 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(646): Zend\ServiceManager\ServiceManager->createFromAbstractFactory('magentosetupcon...', 'Magento\Setup\C...')
#1 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('Magento\Setup\C...', 'magentosetupcon...')
#2 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)
#3 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/AbstractPluginManager.php(116): Zend\ServiceManager\ServiceManager->get('Magento\Setup\C...', false)
#4 /var/www/html/magento2/vendor/zendframework/zend-mvc/Controller/ControllerManager.php(137): Zend\ServiceManager\AbstractPluginManager->get('Magento\Setup\C...', Array, false)
#5 /var/www/html/magento2/vendor/zendframework/zend-mvc/DispatchListener.php(76): Zend\Mvc\Controller\ControllerManager->get('Magento\Setup\C...')
#6 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#7 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#8 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#9 /var/www/html/magento2/vendor/zendframework/zend-mvc/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#10 /var/www/html/magento2/setup/index.php(26): Zend\Mvc\Application->run()
#11 {main}

Zend\ServiceManager\Exception\ServiceNotCreatedException

File:
/var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php:946
Message:
An exception was raised while creating "Magento\Setup\Controller\Index"; no instance returned
Stack trace:
#0 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/AbstractPluginManager.php(284): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'magentosetupcon...', 'Magento\Setup\C...')
#1 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(1129): Zend\ServiceManager\AbstractPluginManager->createServiceViaCallback(Array, 'magentosetupcon...', 'Magento\Setup\C...')
#2 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(646): Zend\ServiceManager\ServiceManager->createFromAbstractFactory('magentosetupcon...', 'Magento\Setup\C...')
#3 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('Magento\Setup\C...', 'magentosetupcon...')
#4 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)
#5 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/AbstractPluginManager.php(116): Zend\ServiceManager\ServiceManager->get('Magento\Setup\C...', false)
#6 /var/www/html/magento2/vendor/zendframework/zend-mvc/Controller/ControllerManager.php(137): Zend\ServiceManager\AbstractPluginManager->get('Magento\Setup\C...', Array, false)
#7 /var/www/html/magento2/vendor/zendframework/zend-mvc/DispatchListener.php(76): Zend\Mvc\Controller\ControllerManager->get('Magento\Setup\C...')
#8 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#9 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#10 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#11 /var/www/html/magento2/vendor/zendframework/zend-mvc/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#12 /var/www/html/magento2/setup/index.php(26): Zend\Mvc\Application->run()
#13 {main}

Magento\Framework\Exception\LocalizedException

File:
/var/www/html/magento2/lib/internal/Magento/Framework/Code/Generator.php:106
Message:
Can't create directory /var/www/html/magento2/var/generation/Magento/Framework/App/Resource/.
Stack trace:
#0 /var/www/html/magento2/lib/internal/Magento/Framework/Code/Generator/Autoloader.php(35): Magento\Framework\Code\Generator->generateClass('Magento\Framewo...')
#1 [internal function]: Magento\Framework\Code\Generator\Autoloader->load('Magento\Framewo...')
#2 [internal function]: spl_autoload_call('Magento\Framewo...')
#3 /var/www/html/magento2/lib/internal/Magento/Framework/Code/Reader/ClassReader.php(19): ReflectionClass->__construct('Magento\Framewo...')
#4 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Definition/Runtime.php(44): Magento\Framework\Code\Reader\ClassReader->getConstructor('Magento\Framewo...')
#5 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(73): Magento\Framework\ObjectManager\Definition\Runtime->getParameters('Magento\Framewo...')
#6 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')
#7 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')
#8 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'resource', 'Magento\Framewo...')
#9 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)
#10 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')
#11 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')
#12 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'frontendFactory', 'Magento\Framewo...')
#13 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)
#14 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')
#15 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')
#16 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'frontendPool', 'Magento\Framewo...')
#17 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)
#18 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')
#19 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')
#20 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'cacheFrontendPo...', 'Magento\Framewo...')
#21 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)
#22 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')
#23 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/AbstractFactory.php(236): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')
#24 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(53): Magento\Framework\ObjectManager\Factory\AbstractFactory->resolveArgument(Array, 'Magento\Framewo...', NULL, 'cache', 'Magento\Framewo...')
#25 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/Factory/Dynamic/Developer.php(84): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->_resolveArguments('Magento\Framewo...', Array, Array)
#26 /var/www/html/magento2/lib/internal/Magento/Framework/ObjectManager/ObjectManager.php(71): Magento\Framework\ObjectManager\Factory\Dynamic\Developer->create('Magento\Framewo...')
#27 /var/www/html/magento2/lib/internal/Magento/Framework/App/ObjectManager/Environment/Developer.php(67): Magento\Framework\ObjectManager\ObjectManager->get('Magento\Framewo...')
#28 /var/www/html/magento2/lib/internal/Magento/Framework/App/ObjectManagerFactory.php(181): Magento\Framework\App\ObjectManager\Environment\Developer->configureObjectManager(Object(Magento\Framework\Interception\ObjectManager\Config\Developer), Array)
#29 /var/www/html/magento2/setup/src/Magento/Setup/Model/ObjectManagerProvider.php(59): Magento\Framework\App\ObjectManagerFactory->create(Array)
#30 /var/www/html/magento2/setup/src/Magento/Setup/Controller/Index.php(29): Magento\Setup\Model\ObjectManagerProvider->get()
#31 /var/www/html/magento2/vendor/zendframework/zend-di/Di.php(488): Magento\Setup\Controller\Index->__construct(Object(Magento\Setup\Model\ObjectManagerProvider))
#32 /var/www/html/magento2/vendor/zendframework/zend-di/Di.php(299): Zend\Di\Di->createInstanceViaConstructor('Magento\Setup\C...', Array, NULL)
#33 /var/www/html/magento2/vendor/zendframework/zend-di/Di.php(248): Zend\Di\Di->newInstance('Magento\Setup\C...', Array, true)
#34 /var/www/html/magento2/vendor/zendframework/zend-mvc/Service/DiStrictAbstractServiceFactory.php(97): Zend\Di\Di->get('Magento\Setup\C...')
#35 [internal function]: Zend\Mvc\Service\DiStrictAbstractServiceFactory->createServiceWithName(Object(Zend\Mvc\Controller\ControllerManager), 'magentosetupcon...', 'Magento\Setup\C...')
#36 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(939): call_user_func(Array, Object(Zend\Mvc\Controller\ControllerManager), 'magentosetupcon...', 'Magento\Setup\C...')
#37 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/AbstractPluginManager.php(284): Zend\ServiceManager\ServiceManager->createServiceViaCallback(Array, 'magentosetupcon...', 'Magento\Setup\C...')
#38 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(1129): Zend\ServiceManager\AbstractPluginManager->createServiceViaCallback(Array, 'magentosetupcon...', 'Magento\Setup\C...')
#39 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(646): Zend\ServiceManager\ServiceManager->createFromAbstractFactory('magentosetupcon...', 'Magento\Setup\C...')
#40 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(598): Zend\ServiceManager\ServiceManager->doCreate('Magento\Setup\C...', 'magentosetupcon...')
#41 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/ServiceManager.php(530): Zend\ServiceManager\ServiceManager->create(Array)
#42 /var/www/html/magento2/vendor/zendframework/zend-servicemanager/AbstractPluginManager.php(116): Zend\ServiceManager\ServiceManager->get('Magento\Setup\C...', false)
#43 /var/www/html/magento2/vendor/zendframework/zend-mvc/Controller/ControllerManager.php(137): Zend\ServiceManager\AbstractPluginManager->get('Magento\Setup\C...', Array, false)
#44 /var/www/html/magento2/vendor/zendframework/zend-mvc/DispatchListener.php(76): Zend\Mvc\Controller\ControllerManager->get('Magento\Setup\C...')
#45 [internal function]: Zend\Mvc\DispatchListener->onDispatch(Object(Zend\Mvc\MvcEvent))
#46 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/EventManager.php(444): call_user_func(Array, Object(Zend\Mvc\MvcEvent))
#47 /var/www/html/magento2/vendor/zendframework/zend-eventmanager/EventManager.php(205): Zend\EventManager\EventManager->triggerListeners('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#48 /var/www/html/magento2/vendor/zendframework/zend-mvc/Application.php(314): Zend\EventManager\EventManager->trigger('dispatch', Object(Zend\Mvc\MvcEvent), Object(Closure))
#49 /var/www/html/magento2/setup/index.php(26): Zend\Mvc\Application->run()
#50 {main}

Server: CentOS 7
MySQL: mysql Ver 14.14 Distrib 5.6.24, for Linux (x86_64) using EditLine wrapper

php -m output:

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
ereg
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
intl
json
libxml
mbstring
mcrypt
mhash
mysql
mysqli
openssl
pcntl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
readline
Reflection
session
shmop
SimpleXML
soap
sockets
SPL
sqlite3
standard
tidy
tokenizer
wddx
xml
xmlreader
xmlwriter
xsl
zip
zlib

Zend Modules

@mazhalai
Copy link
Contributor

@phphphp thank you for reporting this issue. I noticed the last exception in the trace was related to file permissions. Does the var directory have write permissions? Also, did you install using CLI or Web wizard?

@phphphp
Copy link
Author

phphphp commented May 29, 2015

I just tried to go to the setup url and receive that error.

@phphphp
Copy link
Author

phphphp commented May 29, 2015

I just found out that this is an SElinux issue. I completed all the steps in regard to security under CentOS. However, I still get this permission failure in audit.log. Setting selinux to permissive fixes the issue but is not a solution:

type=AVC msg=audit(1432908506.970:652): avc: denied { write } for pid=21684 comm="httpd" name="page_cache" dev="dm-1" ino=101671381 scontext=system_u:system_r:httpd_t:s0 tcontext=system_u:object_r:httpd_sys_content_t:s0 tclass=dir
type=SYSCALL msg=audit(1432908506.970:652): arch=c000003e syscall=21 success=no exit=-13 a0=7f5817c4bdb0 a1=2 a2=0 a3=7f58094a0fe0 items=0 ppid=21681 pid=21684 auid=4294967295 uid=48 gid=48 euid=48 suid=48 fsuid=48 egid=48 sgid=48 fsgid=48 tty=(none) ses=4294967295 comm="httpd" exe="/usr/sbin/httpd" subj=system_u:system_r:httpd_t:s0 key=(null)

@mazhalai
Copy link
Contributor

Thank you @phphphp. We have created ticket MAGETWO-29465 to work on this issue.

@mazhalai mazhalai added Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development PROD and removed PROD labels May 29, 2015
@mazhalai
Copy link
Contributor

@phphphp the following folders require write access for the httpd user during installation.

  • var (this stores generated code, cache and session storage when the application is running)
  • pub/static and pub/media (for static css and js files and images respectively)
  • app/etc (can be read only after installation)

So instead of blanket permissive setting, only the above specific folders need permissive setting.

@adesigner2
Copy link

Even we put full right permissions - it show same error as described above by @phphphp phphphp.

@klierik
Copy link

klierik commented Jul 17, 2015

i have the same problem as @adesigner2 on: Ubuntu 14.04 (vagrant with mount settings mount_options: ["dmode=755,fmode=644"])

$ ls -la var/
total 4
drwxr-xr-x 1 vagrant www-data  238 Jul 17 11:29 .
drwxr-xr-x 1 vagrant www-data 1122 Jul 17 10:39 ..
-rw-r--r-- 1 vagrant www-data   30 Jul 16 13:10 .htaccess
drwxr-xr-x 1 vagrant www-data   68 Jul 17 11:29 cache
drwxr-xr-x 1 vagrant www-data  136 Jul 17 11:29 composer_home
drwxr-xr-x 1 vagrant www-data  102 Jul 17 11:29 generation
drwxr-xr-x 1 vagrant www-data   68 Jul 17 11:29 page_cache

@mazhalai
Copy link
Contributor

@phphphp @klierik any update on this issue? MAGETWO-29465 has been fixed.

@sshrewz
Copy link

sshrewz commented Jan 22, 2016

@phphphp @klierik Since we have not heard back from you for quite some time, we will go ahead and close this issue. If you have any updates, feel free to submit a new issue.

@sshrewz sshrewz closed this as completed Jan 22, 2016
cpartica pushed a commit that referenced this issue Jul 14, 2017
[TSGAB] MAGETWO-60339: The layered navigation does not filter products correctly, with enabled elasticsearch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug report Issue: Ready for Work Gate 4. Acknowledged. Issue is added to backlog and ready for development
Projects
None yet
Development

No branches or pull requests

6 participants