Removing broken objects

I have this strange error of a broken object reference in when accessing backrelations(

I can't find this source object anywhere, and a catalog rebuild doesn't help remove it.

I am able to access the object via intids.

If I can get access to this ghost object via intids, what are my next steps in terms of finding it manually such as finding out what it's oid is and deleting it via code from ZODB?


Have you tried grepping the log files for POSKeyError? It usually shows OIDs along with the error message.

Wait. You are able to access the relating object (the item that stored the relation). Can you still query it for its id? For parent?

After I get the parent, I refer to:

Sometimes I need to recreate the item first using the same id before I can delete the broken object.