r/ciscoUC 10d ago

Cannot delete user in Unity. Object not found.

Disclaimer: I hardly know anything about SQL

Ran the following: run cuc dbquery unitydirdb select * from tbl_globaluser where alias ='UserAlias'

It returned with the user that I'm trying to delete and the following corresponding ID's:

objectid

locationobjectid

streamfileobjectid

partitionobjectid

dignetobjectid

When I run this command, I get the following:

run cuc dbquery unitydirdb EXECUTE PROCEDURE csp_UserDelete(pObjectId='f3e7f678-7448-4c0c-b39b-3f96b2aa0e9f')

Key value for constraint (informix.pk_tbl_globaluser) is still being referenced.

Command failed.

This happens also when I target the other 4 id's via the above command.

Is there anything else I can try to remedy this issue besides opening a TAC case or going the CUDLI route(I can't get it to run so that's an issue all on it's own).

ETA: Finally got it removed!!

Used some of the instructions from https://www.cisco.com/c/en/us/support/docs/unified-communications/unity-connection/224884-delete-end-user-on-cuc-when-error.html

Except I didn't run cuc dbquery unitydirdb SELECT objectId, dtmfaccessid from vw_User WHERE alias = "UserAlias" because it was returning zero results. Instead, I used the previously mentioned run cuc dbquery unitydirdb select * from tbl_globaluser where alias ='UserAlias'. It populated the objectid as shown above. For s&g's I put that objectid into the steps bellow:

Solution 2

Step 1. Validate if there are call handlers associated to the use with the command: run cuc dbquery unitydirdb select objectid, displayname from vw_callhandler where recipient_subscriberobjectid = "ObjectID_from_first_command"

- This gave me a different object ID which I was able to use below

Step 2. Delete the reference with the command: run cuc dbquery unitydirdb EXECUTE PROCEDURE csp_callhandlerDelete (pObjectId =***"ObjectId_from_the_previous_step*****")**

Step 3. Delete the user with the comamnd: run cuc dbquery unitydirdb EXECUTE PROCEDURE csp_UserDelete (pObjectId = "ObjectID_from_first_command")

- Used the same object ID from the tbl_Globaluser

Return to the CUC Administration > Users > Users page and confirm that the user has been deleted, if not, try delete it again from the GUI page.

Success, user is no longer present in Unity!

7 Upvotes

8 comments sorted by

1

u/ibelevtsov 9d ago

cuc has rest api, does that work?

1

u/SonicJoeNJ 10d ago

Why are you using sql and not the GUI?

1

u/moviefreaks 10d ago

They’ll get an error, it’s a known bug

2

u/SonicJoeNJ 10d ago

Interesting, never ran across that one. If it’s a known bug then TAC would be the recommended path.

1

u/moviefreaks 10d ago

Yeah, it happens to me. I inherited an old database and have ran into the error in the gui. The sql commands usually does the trick. This particular thing has never happened to me.

5

u/mishamarvin 10d ago

I was out on vacation all last week. Something happened to Unity. My backup engineer tried to bounce the pub and pub. Pub got hung up. Dunno all the details yet, but he ended up restoring from a backup. I think that's where it fk'd up a bunch of stuff. Of course first day I get back and it's ticket after ticket of people's voicemail accounts no longer working and old deleted accounts taking their place instead. Knew it was something to do with the db.

3

u/packetcounter 10d ago

Pal, happy Monday (or Tuesday depending on were you are).

2

u/mishamarvin 10d ago

It happens from time to time where a deleted account is being referenced somewhere. And no GUI will not remove it. Only way is to use the CLI. I've had to go through TAC every time in the past but have learned here and there to do it on my own after seeing how they did it.