0

On visiting System>Tools>Backup link, Magento system give me below error

Item (Varien_Object) with the same id "0_db" already exist

Trace

#0 /home/sanasana/public_html/lib/Varien/Data/Collection/Filesystem.php(307): Varien_Data_Collection->addItem(Object(Varien_Object))
#1 /home/sanasana/public_html/lib/Varien/Data/Collection.php(622): Varien_Data_Collection_Filesystem->loadData(false, false)
#2 /home/sanasana/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(533): Varien_Data_Collection->load()
#3 /home/sanasana/public_html/app/code/core/Mage/Adminhtml/Block/Backup/Grid.php(51): Mage_Adminhtml_Block_Widget_Grid->_prepareCollection()
#4 /home/sanasana/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(626): Mage_Adminhtml_Block_Backup_Grid->_prepareCollection()
#5 /home/sanasana/public_html/app/code/core/Mage/Adminhtml/Block/Widget/Grid.php(632): Mage_Adminhtml_Block_Widget_Grid->_prepareGrid()
#6 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Abstract.php(918): Mage_Adminhtml_Block_Widget_Grid->_beforeToHtml()
#7 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#8 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('backupsGrid', true)
#9 /home/sanasana/public_html/app/code/core/Mage/Adminhtml/Block/Backup.php(104): Mage_Core_Block_Abstract->getChildHtml('backupsGrid')
#10 /home/sanasana/public_html/app/design/adminhtml/default/default/template/backup/list.phtml(39): Mage_Adminhtml_Block_Backup->getGridHtml()
#11 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/sanasana/...')
#12 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#13 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#14 /home/sanasana/public_html/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#15 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#16 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#17 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Core_Block_Text_List->_toHtml()
#18 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Abstract.php(637): Mage_Core_Block_Abstract->toHtml()
#19 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Abstract.php(581): Mage_Core_Block_Abstract->_getChildHtml('content', true)
#20 /home/sanasana/public_html/app/design/adminhtml/default/default/template/page.phtml(74): Mage_Core_Block_Abstract->getChildHtml('content')
#21 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Template.php(241): include('/home/sanasana/...')
#22 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('adminhtml/defau...')
#23 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#24 /home/sanasana/public_html/app/code/core/Mage/Adminhtml/Block/Template.php(81): Mage_Core_Block_Template->_toHtml()
#25 /home/sanasana/public_html/app/code/core/Mage/Core/Block/Abstract.php(919): Mage_Adminhtml_Block_Template->_toHtml()
#26 /home/sanasana/public_html/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#27 /home/sanasana/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#28 /home/sanasana/public_html/app/code/core/Mage/Adminhtml/controllers/System/BackupController.php(56): Mage_Core_Controller_Varien_Action->renderLayout()
#29 /home/sanasana/public_html/app/code/core/Mage/Core/Controller/Varien/Action.php(418): Mage_Adminhtml_System_BackupController->indexAction()
#30 /home/sanasana/public_html/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#31 /home/sanasana/public_html/app/code/core/Mage/Core/Controller/Varien/Front.php(172): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#32 /home/sanasana/public_html/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#33 /home/sanasana/public_html/app/Mage.php(684): Mage_Core_Model_App->run(Array)
#34 /home/sanasana/public_html/index.php(87): Mage::run('', 'store')
#35 {main}

I am not sure what to do, I have tried to google it but found us very less result.

Thank You.

1

I don't suspect this is a resolution as such but perhaps a workaround for now...

Open up /lib/Varien/Data/Collection.php

Find the following function:-

public function addItem(Varien_Object $item)
{
    $itemId = $this->_getItemId($item);

    if (!is_null($itemId)) {
        if (isset($this->_items[$itemId])) {
            throw new Exception('Item ('.get_class($item).') with the same id "'.$item->getId().'" already exist');
        }
        $this->_items[$itemId] = $item;
    } else {
        $this->_addItem($item);
    }
    return $this;
}

And comment out the following line:-

throw new Exception('Item ('.get_class($item).') with the same id "'.$item->getId().'" already exist');

Resulting in:-

public function addItem(Varien_Object $item)
{
    $itemId = $this->_getItemId($item);

    if (!is_null($itemId)) {
        if (isset($this->_items[$itemId])) {
            //throw new Exception('Item ('.get_class($item).') with the same id "'.$item->getId().'" already exist');
        }
        $this->_items[$itemId] = $item;
    } else {
        $this->_addItem($item);
    }
    return $this;
}

See if that then allows you to access System > Tools > Backup.

1

Tiny bit late for an answer, but I just found its because there was a corrupted backup file in the httpdocs/var/backups/ folder. Manually remove all the backup files in this folder and see if that fixes it.

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.