We had a missing image in one of our stories and I just spent a few hours dealing with a UUID I just couldn't find in the index, no matter how hard I tried:
>>> story = app.RFA.english.news.china['indonesia-death-07092020180018.html']
>>> image = story['indonesia-death.jpg']
>>> from plone.uuid.interfaces import IUUID
>>> uuid = IUUID(image, None)
>>> uuid
'8a4e1f1a-00f4-4913-927e-7b8fe894e3a1'
ok.... then....
>>> from plone.app.uuid.utils import uuidToObject
>>> obj = uuidToObject(uuid)
>>> obj
huh?
>>> from Products.CMFCore.utils import getToolByName
>>> catalog = getToolByName(app.RFA, 'portal_catalog')
>>> catalog.unrestrictedSearchResults(UID=uuid)
[]
Wha..?
I cleared and reindexed the UUID index and this specific case was resolved, but I'm noticing that my Path Index has 83973 values, but the UUID index has 80058 values. That seems a bit suspicious to me. I expect I'll be revisiting a bug where another UUID lookup is failing.
What am I doing wrong?
Should I be suspicious?
Anyone else seeing something like this?
Where can I debug deeper? Like raise a pdb if the indexer fails to put an object's UID into the UID index? I want to investigate this further.