2

Hi i am getting error in magento 2 frontend after creating my custom module.(Here mmm2 is my magento directory)

a:4:{i:0;s:134:"Notice: Undefined index: modules in /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Route/Config/Converter.phpon line 47";i:1;s:5727:"#0 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Route/Config/Converter.php(47):Magento\Framework\App\ErrorHandler->handler(8, 'Undefined index...','/home/vhost/_de...', 47, Array)

If anyone face this type of error please give me solution for that. thanks in advance. comment if you needs more info.(Full detail of error as per below)

Array
(
    [0] => Notice: Undefined index: modules in /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Route/Config/Converter.php on line 47
    [1] => #0 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Route/Config/Converter.php(47): Magento\Framework\App\ErrorHandler->handler(8, 'Undefined index...', '/home/vhost/_de...', 47, Array)
#1 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Config/Reader/Filesystem.php(168): Magento\Framework\App\Route\Config\Converter->convert(Object(DOMDocument))
#2 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#3 /home/vhost/_default/mmm2/var/generation/Magento/Framework/App/Route/Config/Reader/Proxy.php(95): Magento\Framework\Config\Reader\Filesystem->read('frontend')
#4 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Route/Config.php(82): Magento\Framework\App\Route\Config\Reader\Proxy->read('frontend')
#5 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Route/Config.php(125): Magento\Framework\App\Route\Config->_getRoutes('frontend')
#6 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Router/Base.php(274): Magento\Framework\App\Route\Config->getModulesByFrontName('cms')
#7 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Router/Base.php(161): Magento\Framework\App\Router\Base->matchAction(Object(Magento\Framework\App\Request\Http), Array)
#8 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/FrontController.php(50): Magento\Framework\App\Router\Base->match(Object(Magento\Framework\App\Request\Http))
#9 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#10 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#11 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'requestPreproce...')
#12 /home/vhost/_default/mmm2/app/code/Magento/Store/App/FrontController/Plugin/RequestPreprocessor.php(94): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#13 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Chain/Chain.php(67): Magento\Store\App\FrontController\Plugin\RequestPreprocessor->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#14 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#15 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#16 /home/vhost/_default/mmm2/lib/internal/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))
#17 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#18 /home/vhost/_default/mmm2/app/code/Magento/PageCache/Model/App/FrontController/VarnishPlugin.php(55): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
#19 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Chain/Chain.php(67): Magento\PageCache\Model\App\FrontController\VarnishPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#20 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'front-controlle...')
#21 /home/vhost/_default/mmm2/app/code/Magento/PageCache/Model/App/FrontController/BuiltinPlugin.php(68): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#22 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/Interception/Interceptor.php(142): Magento\PageCache\Model\App\FrontController\BuiltinPlugin->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#23 /home/vhost/_default/mmm2/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#24 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#25 /home/vhost/_default/mmm2/lib/internal/Magento/Framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#26 /home/vhost/_default/mmm2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#27 {main}
    [url] => /mmm2/
    [script_name] => /mmm2/index.php
)
  • What’s your Magento version? – Khoa TruongDinh Dec 28 '17 at 11:38
  • I am using Magento 2.1.6 – Ravi Oza Dec 28 '17 at 11:40
0

This issue occurs due to permission issue of generation folder

For Magento 2 latest versions try

sudo chown -R current_user:www-data generated/

or

sudo chmod -R 777 generated/

For Old Magento 2.1

Change ownership or permission of var/generation folder in

  • Change ownership

sudo chown -R current_user:www-data var/ Or

  • Change permission

sudo chmod -R 777 var/

If not resolved try after removing var/ folder

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.