Problem
It isn't possible to publish some content because of a locked node.
The following error messages (or very similar ones) are shown in the log:
INFO info.magnolia.publishing.locking.JcrLockManager : Node nameOfTheNode is locked. Will retry X more times. ERROR receiver.operation.jcr.AbstractJcrReceiveOperation: publishing-receiver.locking.contentLocked info.magnolia.publishing.locking.LockManager$LockException: publishing-receiver.locking.contentLocked at info.magnolia.publishing.locking.JcrLockManager.waitForLock(JcrLockManager.java:178) ~[magnolia-publishing-core-1.0.5.jar:?] at info.magnolia.publishing.transactional.receiver.locking.TransactionalJcrLockManager.applyLock(TransactionalJcrLockManager.java:90) ~[magnolia-publishing-transactional-receiver-1.0.jar:?] at info.magnolia.publishing.receiver.operation.jcr.JcrUnpublicationOperation.preExecute(JcrUnpublicationOperation.java:83) ~[magnolia-publishing-receiver-1.0.5.jar:?] at info.magnolia.publishing.receiver.operation.jcr.AbstractJcrReceiveOperation.execute(AbstractJcrReceiveOperation.java:146) [magnolia-publishing-receiver-1.0.5.jar:?]
or
info.magnolia.publishing.sender.Sender : Could not check for mixin <xyz> or failed to update activation status on systemSessionNode: <xyz> javax.jcr.lock.LockException: Node locked. at org.apache.jackrabbit.core.lock.LockManagerImpl.checkLock(LockManagerImpl.java:694) ~[jackrabbit-core-2.18.1.jar:2.18.1] at org.apache.jackrabbit.core.lock.LockManagerImpl.checkLock(LockManagerImpl.java:670) ~[jackrabbit-core-2.18.1.jar:2.18.1]
Explanation
The publishing (activation) mechanism is a multi-step process during which every node is automatically locked. The Author sends a request to the Public to lock the node -> node locked = publishing can start -> publishing finishes = lock is removed. Once the lock is applied to a node, only the session which created the lock can remove it. This is known as Session locking and it's a feature of JackRabbit. If the Public locks a node and something happens during that publishing process so that it cannot complete it normally, then there is a chance the session does not get a chance to unlock the node -> so that this locked node has to be removed manually.
Solution
- Login to the Public instance. In the LIVE environment, access to it is blocked by default, so it must first be granted to you by HD.
- Go to the "Tools" → "JCR" app.
- Remove the locked node.
- Login to the Author instance.
- Start the publishing process again.
If this solution does not help because it did not allow you to remove the locked node, you can remove it via the Groovy script:
import javax.jcr.Session import info.magnolia.context.MgnlContext session = MgnlContext.getSystemContext().getJCRSession("dam"); session.getNode("/path/to/the/locked/node").remove(); session.save();
This solution should be helpful for the cases when you notice the "jcr:lockIsDeep=true" in the JCR app.