magento2-blog-module-tutorial icon indicating copy to clipboard operation
magento2-blog-module-tutorial copied to clipboard

Invalid Document Element 'add': Duplicate key-sequence ['Ashsmith_Blog::blog_content'] in unique identity-constraint 'uniqueAddItemId'.

Open Git-Rajkumar opened this issue 8 years ago • 4 comments

I am working on create a blog using magento 2. So, i have install your module and go to admin panel it throw below error:

            Invalid Document 
    Element 'add': Duplicate key-sequence ['Ashsmith_Blog::blog_content'] in unique identity-constraint 'uniqueAddItemId'.
    Line: 4

    Element 'add': Duplicate key-sequence ['Ashsmith_Blog::post'] in unique identity-constraint 'uniqueAddItemId'.
    Line: 5

    #0 /var/www/html/magento2/vendor/magento/framework/Config/Reader/Filesystem.php(127): Magento\Framework\Config\Reader\Filesystem->_readFiles(Object(Magento\Framework\Config\FileIterator))
    #1 /var/www/html/magento2/vendor/magento/module-backend/Model/Menu/Config.php(142): Magento\Framework\Config\Reader\Filesystem->read('adminhtml')
    #2 /var/www/html/magento2/vendor/magento/module-backend/Model/Menu/Config.php(109): Magento\Backend\Model\Menu\Config->_initMenu()
    #3 /var/www/html/magento2/vendor/magento/module-backend/Model/Url.php(345): Magento\Backend\Model\Menu\Config->getMenu()
    #4 /var/www/html/magento2/vendor/magento/module-backend/Model/Url.php(305): Magento\Backend\Model\Url->_getMenu()
    #5 /var/www/html/magento2/vendor/magento/module-backend/App/AbstractAction.php(273): Magento\Backend\Model\Url->getStartupPageUrl()
    #6 /var/www/html/magento2/var/generation/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php(50): Magento\Backend\App\AbstractAction->_processUrlKeys()
    #7 /var/www/html/magento2/vendor/magento/module-backend/App/AbstractAction.php(205): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->_processUrlKeys()
    #8 [internal function]: Magento\Backend\App\AbstractAction->dispatch(Object(Magento\Framework\App\Request\Http))
    #9 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
    #10 /var/www/html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callParent('dispatch', Array)
    #11 /var/www/html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Array, 'adminAuthentica...')
    #12 /var/www/html/magento2/vendor/magento/module-backend/App/Action/Plugin/Authentication.php(143): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
    #13 [internal function]: Magento\Backend\App\Action\Plugin\Authentication->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #14 /var/www/html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array)
    #15 /var/www/html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(63): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Array, 'designLoader')
    #16 /var/www/html/magento2/vendor/magento/framework/App/Action/Plugin/Design.php(39): Magento\Framework\Interception\Chain\Chain->Magento\Framework\Interception\Chain\{closure}(Object(Magento\Framework\App\Request\Http))
    #17 [internal function]: Magento\Framework\App\Action\Plugin\Design->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #18 /var/www/html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(68): call_user_func_array(Array, Array)
    #19 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Backend...', 'dispatch', Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Array, 'adminMassaction...')
    #20 /var/www/html/magento2/vendor/magento/module-backend/App/Action/Plugin/MassactionKey.php(33): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #21 [internal function]: Magento\Backend\App\Action\Plugin\MassactionKey->aroundDispatch(Object(Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #22 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array)
    #23 /var/www/html/magento2/var/generation/Magento/Backend/Controller/Adminhtml/Index/Index/Interceptor.php(39): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->___callPlugins('dispatch', Array, Array)
    #24 /var/www/html/magento2/vendor/magento/framework/App/FrontController.php(55): Magento\Backend\Controller\Adminhtml\Index\Index\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #25 [internal function]: Magento\Framework\App\FrontController->dispatch(Object(Magento\Framework\App\Request\Http))
    #26 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(74): call_user_func_array(Array, Array)
    #27 /var/www/html/magento2/vendor/magento/framework/Interception/Chain/Chain.php(70): Magento\Framework\App\FrontController\Interceptor->___callParent('dispatch', Array)
    #28 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(136): Magento\Framework\Interception\Chain\Chain->invokeNext('Magento\\Framewo...', 'dispatch', Object(Magento\Framework\App\FrontController\Interceptor), Array, 'install')
    #29 /var/www/html/magento2/vendor/magento/framework/Module/Plugin/DbStatusValidator.php(69): Magento\Framework\App\FrontController\Interceptor->Magento\Framework\Interception\{closure}(Object(Magento\Framework\App\Request\Http))
    #30 [internal function]: Magento\Framework\Module\Plugin\DbStatusValidator->aroundDispatch(Object(Magento\Framework\App\FrontController\Interceptor), Object(Closure), Object(Magento\Framework\App\Request\Http))
    #31 /var/www/html/magento2/vendor/magento/framework/Interception/Interceptor.php(141): call_user_func_array(Array, Array)
    #32 /var/www/html/magento2/var/generation/Magento/Framework/App/FrontController/Interceptor.php(26): Magento\Framework\App\FrontController\Interceptor->___callPlugins('dispatch', Array, Array)
    #33 /var/www/html/magento2/vendor/magento/framework/App/Http.php(115): Magento\Framework\App\FrontController\Interceptor->dispatch(Object(Magento\Framework\App\Request\Http))
    #34 /var/www/html/magento2/vendor/magento/framework/App/Bootstrap.php(258): Magento\Framework\App\Http->launch()
    #35 /var/www/html/magento2/index.php(39): Magento\Framework\App\Bootstrap->run(Object(Magento\Framework\App\Http))
    #36 {main}

If I go to frontend its working its show

frontend result

If I Comment menu.xml add element Now opening my admin panel Now show created custom menu in content menu. Content-> Blog -> posts. But I comment these two menus in menu.xml. If click post its nothing to show, came blank page.

Suggest me How to solve this problem.

Git-Rajkumar avatar Jun 20 '16 10:06 Git-Rajkumar

why do you close this bug with no answer? I got same situation

crazyfree avatar Jul 17 '17 16:07 crazyfree

@crazyfree what version of Magento 2 are you using? I'll investigate this later today, and see what might be causing this.

ashsmith avatar Jul 18 '17 09:07 ashsmith

I was getting an error similar to this and it was due to an entry in my modules di.xml file that was already being included in another modules di.xml file.

T0MM0R avatar Jun 08 '18 14:06 T0MM0R

I had a similar situation where I had cloned a module from another and it had an admin menu item. In the etc/adminhtml/menu.xml I had an id that was shared in the module I copied from.

michaelbakertup avatar Nov 21 '18 20:11 michaelbakertup