A detailed follow-up on locked object problems with Plone’s ZODB and dealing with locks.
In a previous post on Plone locking, I explained how to unlock locked Plone objects that aren’t easily unlocked via the normal web-based method of clicking an Unlock button. I’ve discovered some additional, seemingly buggy behavior, on which I’ve not been able to find information elsewhere.
While casually browsing one of my sites, I noticed that a page was marked as “locked” by another user. When I asked this user whether they were still editing the page, he responded that he had no idea that he had locked it: he had edited the document, clicked Save, and moved on. Chalking this up to a user mistake, I simply unlocked the document. However, by pure chance, I then found another locked document by the same user, and then another, and another that was locked for a ridiculous amount of time (169 days!).
Plone does not offer a site administration option to manage, or even view, a list of locked objects within the site. So I navigated to the ZMI’s WebDAV Lock Manager page ([ZMI-root]/Control_Panel/DavLocks). First, note that your Plone site does not provide such a URL; you need to have access to the root of the ZMI, which can be a problem if you host multiple Plone sites and have Apache redirecting traffic appropriately (in my case, I need to gain access to the local machine on which Plone is running in order to do so).
As you can see, even after getting here, the Lock Manager page wasn’t very helpful in identifying locks:
I then guessed it worthwhile to try searching for any locked objects within the site, so I used the site’s Plone object name in my search, and lo and behold:
So this page shows no results for all sites within Zope, but it shows a list of locked objects per Plone site, once you know to search for them that way. This doesn’t seem intuitive. And while the list of locked objects does include a path to each, these paths are not URLs and not click-able, and no information on elapsed time is provided, so you’ll need to manually navigate to each one in order to see the object and how long the lock has been active.
I also observed a pattern here: of all the locked objects, there were only four users who had locks. Thus, these were all “repeat offenders”, and all claimed to have no idea that they had created the locks. I should also mention that, in this case, all four are also Windows users, but I’m sure that has no bearing here.
It’s wonderful that Plone v3 offers object locking to control editing and limit the possibility of someone’s changes being overwritten, but it’s unfortunate that the mechanism seems buggy, and that there is no clear, simple way to manage locked objects.
However, at the very least, you now know how to find locked objects within your site.