March 15, 2020
Estimated Post Reading Time ~

Instance does not start caused by Access is denied / Bad file descriptor

Sometimes the instance doesn't start up and you recieve following error :


*INFO* [FelixStartLevel] com.day.crx.persistence.tar.TarSet scanning index E:\adobe-cq.5.5.0\Author\crx-quickstart\.\repository\workspaces\crx.default\data_04935.tar id:4945 length:102764544 append:-1 1898032864

 *ERROR* [FelixStartLevel] org.apache.jackrabbit.core.RepositoryImpl 
Failed to initialize workspace 'crx.default' javax.jcr.RepositoryException: Cannot instantiate persistence manager com.day.crx.persistence.tar.TarPersistenceManager
 at com.day.crx.core.CRXRepositoryImpl$CRXWorkspaceInfo.createPersistenceManager(CRXRepositoryImpl.java:1290)
 ..
        ...
Caused by: java.io.IOException: Access is denied
 at java.io.RandomAccessFile.writeBytes(Native Method)
 at java.io.RandomAccessFile.write(Unknown Source
 ... 59 more

*ERROR* [FelixStartLevel] org.apache.jackrabbit.core.RepositoryImpl Unable to 
start repository, forcing shutdown...

In a Linux machine, you will get

Caused by: java.io.IOException: Bad file descriptor

This error stack is due to inconsistencies between index_*.tar and data_*.tar files.

Solution 

0/ Stop the instance.
1/ Go to path as per *INFO* e.g. repository\workspaces\crx.default\data_04935.tar
2/ Change the permission of the data_xxx.tar file to read-write.
    a) In windows, just right click on the tar file and uncheck read-only.
    b) In Linux, 
use chmod command to set file permissions right again
3/ Delete the index_*.tar and locks file present in the folder.
4/ Open the workspace.xml add parameters in searchindex tag as following to check, fix consistency and rebuilding of indexes.

<SearchIndex class="com.day.crx.query.lucene.LuceneHandler">
    <param name="path" value="${wsp.home}/index"/>
    <param name="enableConsistencyCheck" value="true"/>
    <param name="forceConsistencyCheck" value="true"/>
    <param name="autoRepair" value="true"/>
</SearchIndex>

5/ Restart the instance and tail the logs.
6/ Once the issue is resolved to remove the parameters added in step 4 so that the consistency check doesn't run on every start of the instance.



By aem4beginner

No comments:

Post a Comment

If you have any doubts or questions, please let us know.