Can’t delete a user from Unity Connection

This week we closed one of our satellite offices and therefore I had to remove the office from, among other things, Cisco Unity Connection. I started deleting the users and hit a problem when I tried to delete the Operator User. The error I receive was:

“Operation cannot be completed because the object is in use”

Now since I had just finished removing this office from the Cisco Unified Communications Manager box, I expected to have the option in Unity to actually see what object is using the User that I’m trying to delete, as I did in UCM. But no such luck.

After some digging around I discovered that this is actually a bug in the 7.0.2.10000-18 version of UC that I’m running. Here’s the original Bug Toolkit from Cisco on the issue.

As you’ll see, the document gives you a number of queries to run on the UC box from a command line to help identify the object that is using the User that you’re trying to delete. The query that worked in identifying the object for me is the one shown below in bold.

When using these commands, replace the word SUBSCRIBER with the user alias you’re trying to delete and run them from the command line to get the name of the object that is referencing this user.

run cuc dbquery unitydirdb select displayname from vw_callhandler where  objectid = (select callhandlerobjectid from vw_menuentry where  targethandlerobjectid IN (select callhandlerobjectid from vw_subscriber where fn_tolower(alias) = lower(‘SUBSCRIBER’)))

If the above SQL command does not tell you why the user can’t be deleted try  to following SQL commands in order:

run cuc dbquery unitydirdb select * from vw_subscriberreference where objectid IN (select objectid from vw_subscriber where fn_tolower(alias) = fn_tolower(‘SUBSCRIBER’))

run cuc dbquery unitydirdb select owner.displayname, “personal call xfer rule” as referenceype, owner.objectid as referrerobjectid, target.objectid from vw_personalrulecaller, vw_subscriber target, vw_subscriber owner where
vw_personalrulecaller.calleruserobjectid = target.objectid and owner.objectid = vw_personalrulecaller.subscriberobjectid and target.objectid in (select objectid from vw_subscriber where fn_tolower(alias) = fn_tolower(‘SUBSCRIBER’))

run cuc dbquery unitydirdb select owner.displayname, “exiting conversation” as referencetype, owner.objectid as referrerobjectid, target.objectid from vw_callhandler, vw_callaction, vw_subscriber target, vw_subscriber owner where target.callhandlerobjectid = vw_callaction.targethandlerobjectid and vw_callaction.objectid = owner.exitcallactionobjectid and vw_callaction.targethandlerobjectid = vw_callhandler.objectid and target.objectid in (select objectid from vw_subscriber where fn_tolower(alias) = fn_tolower(‘SUBSCRIBER’))

run cuc dbquery unitydirdb select owner.displayname, “exiting conversation” as referencetype, owner.objectid as referrerobjectid, target.objectid from vw_callhandler, vw_callaction, vw_subscriber target, vw_subscribertemplate
owner where target.callhandlerobjectid = vw_callaction.targethandlerobjectid and vw_callaction.objectid = owner.exitcallactionobjectid and vw_callaction.targethandlerobjectid = vw_callhandler.objectid and target.objectid in (select objectid from vw_subscriber where fn_tolower(alias) = fn_tolower(‘SUBSCRIBER’))

If you have UC 7 or later and you still can’t determine why you can’t remove a user try:

run cuc dbquery unitydirdb select vw_subscriber.displayname, “smpp provider” as referencetype, vw_smppprovider.objectid as referrerobjectid, vw_subscriber.objectid from vw_smppprovider, vw_subscriber where
vw_smppprovider.owner_subscriberobjectid = vw_subscriber.objectid and vw_smppprovider.owner_subscriberobjectid in (select objectid from vw_subscriber where fn_tolower(alias) = fn_tolower(‘SUBSCRIBER’))

If none of those work then try this:

run cuc dbquery unitydirdb select objectid from tbl_callaction where targethandlerobjectid IN (select callhandlerobjectid from vw_subscriber where fn_tolower(alias) = fn_tolower(‘SUBSCRIBER’))

run cuc dbquery unitydirdb select objectid from tbl_callaction where targethandlerobjectid IN (select callhandlerobjectid from vw_subscriber where fn_tolower(alias) = fn_tolower(‘kcharron’))

If this returns a result, there is an orphaned call action that is preventing the deletion of the user.
Now run this query to remove the call action.

run cuc dbquery unitydirdb delete from tbl_callaction where objectid=”

Using puTTY to connect to the UC box, I logged in and executed the query command above in bold, which displayed the output in Figure A.

FigureA

Figure A: Click to enlarge.

As you can see in Figure A, the object ‘Whitema’ is listed as an object using the User Object ‘KalamazooOperator’ that I was trying to delete. And checking the Call Input of the ‘Whitema’ user, I discovered that the number 0 (zero) key was set to send the caller to the KalamazooOperator User when pressed. So I selected another target and saved the change. Then I tried once more to delete the KalamazooOperator User and this time it was successful!

Now according to the Bug Toolkit, this problem was fixed in versions 7.1(0.51), 7.1(0.71) and 7.1(2a). I haven’t upgraded as of yet, so I don’t know if by fixed they mean that you can delete an object even if it’s in use, or if it means that they now give you a way to find the object within the web interface. Hopefully it’s the latter since we have this ability in CUCM already.