Firefox Redirect Loop and plone.app.redirector behaving badly
If you encounter a Firefox Redirect Loop when browsing to an object then plone.app.redirector may be at fault.
plone.app.redirector keeps track of IObjectMovedEvent and IObjectRemovedEvent by event subscribers. The noble idea is that your visitors' bookmarks stay valid even in the case of you renaming an item repeatedly.
When you attempt to navigate to an object which leads to a NotFound then plone.app.redirector reacts to the NotFound and does a lookup in a BTree. If it finds a matching object it will instruct your browser to permanently redirect to the proper location. I recently had a case where plone.app.redirector got it horribly wrong. A remember account melatree was renamed to melattree. When I attempted to visit http://mysite/members/melattree the redirect loop was encountered.
My theory as to how things went wrong: the members folder on this site got corrupted at BTree level and required me to recreate the folder and migrate non-broken objects accross to the new folder. The API calls I used did not fire the IObject* events, so plone.app.redirector's event subscribers did not fire. This caused its internal BTrees to be out of sync.
This is how I fixed it.
# Startup the instance in debug mode, eg. ./bin/instance debug
import transaction
from zope.component import getUtility
from plone.app.redirector.interfaces import IRedirectionStorage
site_id = 'yoursite'
storage = getUtility(IRedirectionStorage, context=app[site_id])
pth = '/yoursite/members/melatree'
# Confirm that the path is in the storage.
# You will get a return value which is identical to pth.
storage.get(pth)
# Clean it up
storage.remove(pth)
transaction.commit()
UPDATE: this has been fixed. See https://dev.plone.org/plone/changeset/26239.It will be in Plone 3.3.






