Magento – Can’t access magento 2.1.3 admin getting some error

admin-controlleradmin-panelmagento-2.1.3

While trying to access the admin panel i got following error. This was shown up from yesterday up to that time i don't have any issue

1 exception(s):
Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid Document 
Element 'route': Duplicate key-sequence ['admin'] in unique identity-constraint 'uniqueRouteFrontName'.
Line: 7


Exception #0 (Magento\Framework\Exception\LocalizedException): Invalid Document 
Element 'route': Duplicate key-sequence ['admin'] in unique identity-constraint 'uniqueRouteFrontName'.
Line: 7

#0 /var/www/html/m2/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
#1 /var/www/html/m2/var/generation/Magento/Framework/App/Route/Config/Reader/Proxy.php(95): Magento\Framework\Config\Reader\Filesystem->read('adminhtml')
#2 /var/www/html/m2/vendor/magento/framework/App/Route/Config.php(82): Magento\Framework\App\Route\Config\Reader\Proxy->read('adminhtml')
#3 /var/www/html/m2/vendor/magento/framework/App/Route/Config.php(125): Magento\Framework\App\Route\Config->_getRoutes('adminhtml')
#4 /var/www/html/m2/vendor/magento/framework/App/Router/Base.php(274): Magento\Framework\App\Route\Config->getModulesByFrontName('admin')
#5 /var/www/html/m2/vendor/magento/framework/App/Router/Base.php(161): Magento\Framework\App\Router\Base->matchAction(Object(Magento\Framework\App\Request\Http), Array)
#6 /var/www/html/m2/vendor/magento/framework/App/FrontController.php(50): Magento\Framework\App\Router\Base->match(Object(Magento\Framework\App\Request\Http))
#7 /var/www/html/m2/vendor/magento/framework/Interception/Interceptor.php(74): Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
#8 /var/www/html/m2/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
#9 /var/www/html/m2/vendor/magento/framework/Interception/Interceptor.php(138): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
#10 /var/www/html/m2/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
#11 /var/www/html/m2/vendor/magento/framework/Interception/Interceptor.php(142): Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
#12 /var/www/html/m2/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
#13 /var/www/html/m2/vendor/magento/framework/App/Http.php(135): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
#14 /var/www/html/m2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
#15 /var/www/html/m2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
#16 {main}

Best Answer

**You have custom module which have frontend name admin **

Check your all custom module

you will find route file have frontName admin. It probably in admin router file etc/adminhtml/routes.xml like this. So change the FrontName to any other name.

 <router id="admin">
    <route id="api" frontName="admin"> // admin 
        <module name="Shiprocket_api" />
    </route>
</router>

change to any other name

<router id="admin">
    <route id="api" frontName="api"> // admin change to api  
        <module name="Shiprocket_api" />
    </route>
</router>
Related Topic