More fun with Plone locks

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!).

A Pone object that was inadvertantly locked -- for over 169 days!

A Plone object that was inadvertantly locked -- for 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:

The WebDAV Lock Manager in the ZMI.

The WebDAV Lock Manager in the ZMI.

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:

Per-site locked objects in the ZMI.

Per-site list of locked objects in the ZMI.

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.


7 thoughts on “More fun with Plone locks

  1. The biggest reason why objects stay lock, in my experience is when inline editing is enable. That’s why for our customers using Plone 3 we decided to disable that feature.

    People tend to click on the content or select some text and not with the intention to edit that content.
    Browsing away from the page, without clicking the cancel button, keeps the object locked.

  2. Thanks jladage. Yes, I found this as well, and I disabled inline editing long ago just for this reason: seems like a useful feature, but the implementation opened up opportunities for problems such as these.

    Of course, when I’ve asked users whether this could have been a possible reason, they all say “no”, but anything’s possible. And it doesn’t explain why such locks were created recently, as inline editing has been disabled for months now.

  3. Hi,
    Amazing stuff. Thanks for the info. The blog is extremely well written and adequately explanatory.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s