Instance doesn't start | java.io.IOException Bad file descriptor(Linux) / Access is denied(Windows)

Issue

An instance doesn't restart, and it logs the following message on a Linux system :

xx.xx.xxxx xx:xx:xx.xxx *ERROR* org.apache.jackrabbit.core.RepositoryImpl Failed to initialize workspace 'crx.default' javax.jcr.RepositoryException: Cannot instantiate persistence manager com.day.crx.persistence.tar.TarPe
rsistenceManager
at com.day.crx.core.CRXRepositoryImpl$CRXWorkspaceInfo.createPersistenceManager(CRXRepositoryImpl.java:1290)
at com.day.crx.core.CRXRepositoryImpl$CRXWorkspaceInfo.doInitialize(CRXRepositoryImpl.java:1307)
at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:2002)
at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:517)
at com.day.crx.core.CRXRepositoryImpl.initStartupWorkspaces(CRXRepositoryImpl.java:428)
at org.apache.jackrabbit.core.RepositoryImpl.(RepositoryImpl.java:324)
at com.day.crx.core.CRXRepositoryImpl.(CRXRepositoryImpl.java:283)
at com.day.crx.core.CRXRepositoryImpl.create(CRXRepositoryImpl.java:258)
...
Caused by: java.io.IOException: Bad file descriptor
at java.io.RandomAccessFile.writeBytes(Native Method)
at java.io.RandomAccessFile.write(RandomAccessFile.java:469)
at com.day.crx.persistence.tar.file.TarFile.write(TarFile.java:736)
at com.day.crx.persistence.tar.file.TarFile.writeData(TarFile.java:629)
at com.day.crx.persistence.tar.file.TarFile.appendMetaData(TarFile.java:703)
at com.day.crx.persistence.tar.file.TarFile.append(TarFile.java:585)
at com.day.crx.persistence.tar.TarSet.switchDataFile(TarSet.java:443)
at com.day.crx.persistence.tar.TarSet.open(TarSet.java:225)
at com.day.crx.persistence.tar.ClusterTarSet.reopenCopy(ClusterTarSet.java:1413)
at com.day.crx.persistence.tar.ClusterTarSet.open(ClusterTarSet.java:828)
at com.day.crx.persistence.tar.TarPersistenceManager.openTarSet(TarPersistenceManager.java:963)
at com.day.crx.persistence.tar.TarPersistenceManager.init(TarPersistenceManager.java:494)
at com.day.crx.core.CRXRepositoryImpl$CRXWorkspaceInfo.createPersistenceManager(CRXRepositoryImpl.java:1286)
... 59 more
xx.xx.xxxx xx:xx:xx.xxx *ERROR* org.apache.jackrabbit.core.RepositoryImpl Unable to start repository, forcing shutdown...

 

or on a Windows system :

 

xx.xx.xxxx xx:xx:xx.xxx *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:1325) at com.day.crx.core.CRXRepositoryImpl$CRXWorkspaceInfo.doInitialize(CRXRepositoryImpl.java:1342) at org.apache.jackrabbit.core.RepositoryImpl$WorkspaceInfo.initialize(RepositoryImpl.java:2002) at org.apache.jackrabbit.core.RepositoryImpl.initStartupWorkspaces(RepositoryImpl.java:517) at com.day.crx.core.CRXRepositoryImpl.initStartupWorkspaces(CRXRepositoryImpl.java:452) at org.apache.jackrabbit.core.RepositoryImpl.(RepositoryImpl.java:324) at com.day.crx.core.CRXRepositoryImpl.(CRXRepositoryImpl.java:307) at com.day.crx.core.CRXRepositoryImpl.create(CRXRepositoryImpl.java:262) at com.day.crx.core.CRXRepositoryImpl.create(CRXRepositoryImpl.java:245) at com.day.crx.sling.server.impl.jmx.ManagedRepository.activate(ManagedRepository.java:168) ...

Caused by: java.io.IOException: Access is denied at java.io.RandomAccessFile.writeBytes(Native Method) at java.io.RandomAccessFile.write(Unknown Source) at com.day.crx.persistence.tar.file.TarFile.write(TarFile.java:742) at com.day.crx.persistence.tar.file.TarFile.writeData(TarFile.java:635) at com.day.crx.persistence.tar.file.TarFile.appendMetaData(TarFile.java:709) at com.day.crx.persistence.tar.file.TarFile.append(TarFile.java:591) at com.day.crx.persistence.tar.TarSet.switchDataFile(TarSet.java:445) at com.day.crx.persistence.tar.TarSet.open(TarSet.java:227) at com.day.crx.persistence.tar.ClusterTarSet.reopenCopy(ClusterTarSet.java:1455) at com.day.crx.persistence.tar.ClusterTarSet.open(ClusterTarSet.java:860) at com.day.crx.persistence.tar.TarPersistenceManager.openTarSet(TarPersistenceManager.java:980) at com.day.crx.persistence.tar.TarPersistenceManager.init(TarPersistenceManager.java:500) at com.day.crx.core.CRXRepositoryImpl$CRXWorkspaceInfo.createPersistenceManager(CRXRepositoryImpl.java:1321) ... 59 more

הערה:

Earlier in the logs, there could be a message like the one below:

*ERROR* com.day.crx.core.backup.LowDiskSpaceMonitor Missing file(s). The repository will be closed now.

Another message related to "The data*.tar files are now read-only for security reasons...." could also appear around same time (depending CRX version and patches).

Solution

The messages are thrown when there is inconsistency detected between the index_*.tar and data_*.tar, and your data*.tar files are read-only.

Set back the data_*.tar to read/write. To do this :

- On Linux systems, use chmod command to set file permissions right again.
- On Windows, just remove the 'read-only' attribute on the files.

Then, delete the index_*.tar files, and configure the repository to start in consistency check/fix mode (for both repository and Lucene search index). If no errors are found, remove the consistency check/fix for the next startup to be faster.

 Adobe

קבל עזרה במהירות ובקלות

משתמש חדש?

‎‎Adobe MAX 2024

Adobe MAX
כנס היצירתיות

14-16 באוקטובר, מיאמי ביץ', ובאינטרנט

Adobe MAX

כנס היצירתיות

14-16 באוקטובר, מיאמי ביץ', ובאינטרנט

‎‎Adobe MAX 2024

Adobe MAX
כנס היצירתיות

14-16 באוקטובר, מיאמי ביץ', ובאינטרנט

Adobe MAX

כנס היצירתיות

14-16 באוקטובר, מיאמי ביץ', ובאינטרנט