deletion of server doesn't work correctly if errors occured during server creation

Bug #298411 reported by Christophe Vandeplas
2
Affects Status Importance Assigned to Milestone
Zivios Open Source Enterprise Management
Fix Committed
Low
Faraz Khan

Bug Description

Create a 'server', make sure you get an 'error' in the process (wrong path of /opt/zivios/emsmanagement)
then go to the list of servers and delete the object. (using the webinterface)
Create the same 'server' again, this will fail. The error message is:

Adding a: EMSServer to LDAP with dn: cn=vpn01,ou=servers,ou=maison,l=waterloo,dc=be-wat,dc=vandeplas,dc=com FAILED
Exception Type Ecl_Ldap_Exception
Exception Message Ldap Caused Error :::: Already exists :::: Error Code 68
Exception Code 0
Exception File /var/www/vhosts/zpanel/application/library/Ecl/Ldap/Engine.php
Exception Line 535
#0 /var/www/vhosts/zpanel/application/library/Ecl/Ldap/Engine.php(809): Ecl_Ldap_Engine->getError()
#1 /var/www/vhosts/zpanel/application/library/Ecl/Transaction/Item.php(99) : eval()'d code(1): Ecl_Ldap_Engine->postAdd(Object(EMSOrganizationalUnit))
#2 /var/www/vhosts/zpanel/application/library/Ecl/Transaction/Item.php(99): eval()
#3 /var/www/vhosts/zpanel/application/library/Ecl/Transaction/Handler.php(228): Ecl_Transaction_Item->commit()
#4 /var/www/vhosts/zpanel/application/library/Ecl/Transaction/Handler.php(203): Ecl_Transaction_Handler->commit()
#5 /var/www/vhosts/zpanel/application/library/Ecl/Controller.php(352): Ecl_Transaction_Handler->process()
#6 /var/www/vhosts/zpanel/application/modules/default/controllers/ServerController.php(313): Ecl_Controller->processTransaction(Object(Ecl_Transaction_Handler))
#7 /var/www/vhosts/zpanel/zlibrary/Zend/Controller/Action.php(499): ServerController->addServerAction()
#8 /var/www/vhosts/zpanel/zlibrary/Zend/Controller/Dispatcher/Standard.php(242): Zend_Controller_Action->dispatch('addserverAction')
#9 /var/www/vhosts/zpanel/zlibrary/Zend/Controller/Front.php(929): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#10 /var/www/vhosts/zpanel/application/launcher/common.func.php(133): Zend_Controller_Front->dispatch()
#11 /var/www/vhosts/zpanel/web/index.php(35): runZivios()
#12 {main}

This means the server object has some remainings left based on the 'hostname'.
Creating a new server with the same IP address works fine.

Revision history for this message
Faraz Khan (fkhan-zivios) wrote :

Did it not give you an option to "rollback" the original failed transaction? If you let the rollback slide deleting a 'bad object' is not possible- hence the already exist errors.

Maybe we should force rollback of a faulty transaction.

Changed in zivios:
assignee: nobody → fkhan-zivios
importance: Undecided → Low
Revision history for this message
Christophe Vandeplas (cvandeplas) wrote :

It probably gave the rollback option when creating the 'server'.
But being concentrated on the error I must admit I only saw the rollback feature when the deletion failed.

Shouldn't the system rollback automatically if something fails? Otherwise isn't there a huge risk to populate the ldap with corrupted information?

The only way for me to have a non-corrupt ldap would be to either reinstall everything or to manually explore the ldap and delete the unwanted data. That's not something you want in a future production environment...

Just my 2c :-)

Revision history for this message
Faraz Khan (fkhan-zivios) wrote :

You are absolutely correct. I left that part out since I didn't want there to be too much 'magic'. I will put in a configurable option for 'disabled automatic rollback on failure' so that the default mechanism is to rollback when a failure occurs. Otherwise- you have a corrupt ldap tree as you correctly noticed!

Changed in zivios:
status: New → Confirmed
Revision history for this message
Faraz Khan (fkhan-zivios) wrote :

Transactions can now be browsed even after creating the server and a rollback initiated. The rollback does NOT need to be run precisely at the time of error

Changed in zivios:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.