Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

Failed to update PegaRULES index, Lock timed out

SA-4438

Summary



Rules, Data, and Work indexes are not updating, while system agents are working.

Manual re-indexing helps to solve the problem, but it is not the best, conclusive solution.

In the Pega logs, see errors that pertain to the indexes.


Error Messages



2014-12-02 00:00:52,186 [j2ee14_ws,maxpri=10]] [ STANDARD] [ PegaRULES:06.01.01] ( search.internal.RuleIndexer) ERROR - Failed to update ClipboardPages in the PegaRULES index - Lock obtain timed out: [email protected]/prindex/DataIndex/write.lock
com.pega.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/prindex/DataIndex/write.lock
=======================
2014-12-02 00:00:52,186 [j2ee14_ws,maxpri=10]] [ STANDARD] [ PegaRULES:06.01.01] (xer.System_Work_Indexer.Action) ERROR - [ Indexer ] The System Indexer encountered an error
com.pega.pegarules.pub.PRRuntimeException: Failed to update the PegaRULES index - Lock obtain timed out: [email protected]/prindex/DataIndex/write.lock
at com.pega.pegarules.search.internal.RuleIndexer.updateIndex(RuleIndexer.java:1621)
at com.pega.pegarules.search.internal.RuleIndexer.updateIndex(RuleIndexer.java:1487)

com.pega.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/prindex/DataIndex/write.lock
at com.pega.apache.lucene.store.Lock.obtain(Lock.java:84)
at com.pega.apache.lucene.index.IndexWriter.init(IndexWriter.java:1041)
at com.pega.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:864)
at com.pega.pegarules.search.internal.RuleIndexer.getOptimizedIndexWriter(RuleIndexer.java:1818)
at com.pega.pegarules.search.internal.RuleIndexer.addToIndex(RuleIndexer.java:1747)
at com.pega.pegarules.search.internal.RuleIndexer.updateIndex(RuleIndexer.java:1611)
... 37 more
2014-12-02 00:01:53,262 [j2ee14_ws,maxpri=10]] [ STANDARD] [ PegaRULES:06.01.01] ( search.internal.RuleIndexer) ERROR - Failed to update ClipboardPages in the PegaRULES index - Lock obtain timed out: [email protected]/prindex/DataIndex/write.lock
com.pega.apache.lucene.store.LockObtainFailedException: Lock obtain timed out: [email protected]/prindex/DataIndex/write.lock
at com.pega.apache.lucene.store.Lock.obtain(Lock.java:84)
at com.pega.apache.lucene.index.IndexWriter.init(IndexWriter.java:1041)
at com.pega.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:864)
at com.pega.pegarules.search.internal.RuleIndexer.getOptimizedIndexWriter(RuleIndexer.java:1818)
at com.pega.pegarules.search.internal.RuleIndexer.addToIndex(RuleIndexer.java:1747)
at com.pega.pegarules.search.internal.RuleIndexer.updateIndex(RuleIndexer.java:1611)
at com.pega.pegarules.search.internal.RuleIndexer.updateIndex(RuleIndexer.java:1487)
at com.pega.pegarules.session.internal.mgmt.Executable.updateIndex(Executable.java:6482)
at com.pegarules.generated.activity.ra_action_systemworkindexer_3a1b7f0a7fb9df19ecbe1c18b8e545a9.step1_circum0(ra_action_systemworkindexer_3a1b7f0a7fb9df19ecbe1c18b8e545a9.java:266)
at com.pegarules.generated.activity.ra_action_systemworkindexer_3a1b7f0a7fb9df19ecbe1c18b8e545a9.perform(ra_action_systemworkindexer_3a1b7f0a7fb9df19ecbe1c18b8e545a9.java:70)
at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:3524)
at com.pega.pegarules.session.internal.async.agent.QueueProcessor.runActivity(QueueProcessor.java:699)


at com.ibm.ws.asynchbeans.J2EEContext.run(J2EEContext.java:768)
at com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:222)
at com.ibm.ws.asynchbeans.ABWorkItemImpl.run(ABWorkItemImpl.java:159)
at java.lang.Thread.run(Thread.java:738)
2014-12-02 00:01:53,263 [j2ee14_ws,maxpri=10]] [ STANDARD] [ PegaRULES:06.01.01] (xer.System_Work_Indexer.Action) ERROR - [ Indexer ] The System Indexer encountered an error
com.pega.pegarules.pub.PRRuntimeException: Failed to update the PegaRULES index - Lock obtain timed out: [email protected]/prindex/DataIndex/write.lock
at com.pega.pegarules.search.internal.RuleIndexer.updateIndex(RuleIndexer.java:1621)
..
caused by:
com.ibm.ws.asynchbeans.WorkWithExecutionContextImpl.go(WorkWithExecutionContextImpl.java:222)



Steps to Reproduce



Update indexes using agents.

Root Cause



The root cause of this problem is a defect or misconfiguration in the PRPC operating environment.

Occasionally, there is an error if, for some reason, the .lock file is not deleted. This may occur if, for example, PegaRULES is terminated when Lucene is in progress writing to an index, or some other PegaRULES error occurs. When the system is restored, the indexing operations will fail. The next time indexing is attempted, Lucene tries to take out a lock on the index file and fails because there is already an existing lock on the file – the .lock file already exists on the disk. Lucene will wait for a period of time for the index to be "free" and the lock to be "released" (deleted). But this will never happen because it was left by mistake and will eventually time out with the error.

In most cases, deleting the lock should fix the issue.

Related Content
https://pdn.pega.com/testing-applications/troubleshooting-agents

 

Resolution



Perform the following local-change to remove the .lock file, restart the application server, and rebuild the indexes.
  1. Stop the Indexing Agents.
  2. Delete the write.lock file.
  3. Restart the server.
  4. Run the Indexing using the System Management Application (SMA).
  5. Start the Indexing Agents.

Note: For a multinode environment with Indexing agents enabled on all of the nodes, enable Indexing agents only on the Indexing node and stop those agents on all of the other nodes.

Published September 8, 2016 - Updated October 8, 2020

Was this useful?

0% found this useful

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

Did you find this content helpful?

Want to help us improve this content?

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us