Solr secure - errors with search result

Hello, i need help, with strange errors after “solr secure” extention installation.

Result: not propertly working search with user rights - all search results accessible withouth users restricts.

Xwiki - 14.2.1

In tomcat-stdout.logs:

2022-04-21 06:39:59,314 [XWiki Solr index thread] ERROR o.x.j.i.DefaultJobStatusStore  - Failed to create a logger tail for job [[solrsecurity, entity, xwiki, XWiki, Notifications, Code, Macro, Translations]] 
java.nio.file.FileSystemException: X:\XFiles\jobs\status\solrsecurity\entity\xwiki\XWiki\Notifications\Code\Macro\Translations\log.xml: The process cannot access the file because it is being used by another process.

	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
	at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
	at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181)
	at org.xwiki.logging.internal.tail.AbstractFileLoggerTail.initialize(AbstractFileLoggerTail.java:178)
	at org.xwiki.logging.internal.tail.AbstractTextFileLoggerTail.initialize(AbstractTextFileLoggerTail.java:52)
	at org.xwiki.logging.internal.tail.XStreamFileLoggerTail.initialize(XStreamFileLoggerTail.java:55)
	at org.xwiki.logging.logback.internal.DefaultLoggerManager.createLoggerTail(DefaultLoggerManager.java:238)
	at org.xwiki.job.internal.DefaultJobStatusStore.createLoggerTail(DefaultJobStatusStore.java:487)
	at org.xwiki.job.internal.DefaultJobStatusStore.createLoggerTail(DefaultJobStatusStore.java:476)
	at org.xwiki.job.AbstractJob.initialize(AbstractJob.java:175)
	at org.xwiki.job.internal.DefaultJobExecutor.createJob(DefaultJobExecutor.java:308)
	at org.xwiki.job.internal.DefaultJobExecutor.execute(DefaultJobExecutor.java:316)
	at org.xwiki.contrib.solrsecurity.internal.SolrSecurityDispatcher.execute(SolrSecurityDispatcher.java:106)
	at org.xwiki.contrib.solrsecurity.internal.SolrSecurityDispatcher.indexEntity(SolrSecurityDispatcher.java:85)
	at org.xwiki.contrib.solrsecurity.internal.CustomDocumentSolrMetadataExtractor.setFieldsInternal(CustomDocumentSolrMetadataExtractor.java:70)
	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:151)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:499)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:408)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:376)
	at java.base/java.lang.Thread.run(Thread.java:829)

2022-04-21 06:39:59,330 [XWiki Solr index thread] ERROR o.x.j.i.DefaultJobStatusStore  - Failed to create a logger tail for job [[solrsecurity, entity, xwiki, XWiki, Notifications, Code, Macro, Translations]] 
java.nio.file.FileSystemException: X:\XFiles\jobs\status\solrsecurity\entity\xwiki\XWiki\Notifications\Code\Macro\Translations\log.xml: The process cannot access the file because it is being used by another process.

	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
	at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
	at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181)
	at org.xwiki.logging.internal.tail.AbstractFileLoggerTail.initialize(AbstractFileLoggerTail.java:178)
	at org.xwiki.logging.internal.tail.AbstractTextFileLoggerTail.initialize(AbstractTextFileLoggerTail.java:52)
	at org.xwiki.logging.internal.tail.XStreamFileLoggerTail.initialize(XStreamFileLoggerTail.java:55)
	at org.xwiki.logging.logback.internal.DefaultLoggerManager.createLoggerTail(DefaultLoggerManager.java:238)
	at org.xwiki.job.internal.DefaultJobStatusStore.createLoggerTail(DefaultJobStatusStore.java:487)
	at org.xwiki.job.internal.DefaultJobStatusStore.createLoggerTail(DefaultJobStatusStore.java:476)
	at org.xwiki.job.AbstractJob.initialize(AbstractJob.java:175)
	at org.xwiki.job.internal.DefaultJobExecutor.createJob(DefaultJobExecutor.java:308)
	at org.xwiki.job.internal.DefaultJobExecutor.execute(DefaultJobExecutor.java:316)
	at org.xwiki.contrib.solrsecurity.internal.SolrSecurityDispatcher.execute(SolrSecurityDispatcher.java:106)
	at org.xwiki.contrib.solrsecurity.internal.SolrSecurityDispatcher.indexEntity(SolrSecurityDispatcher.java:85)
	at org.xwiki.contrib.solrsecurity.internal.CustomDocumentSolrMetadataExtractor.setFieldsInternal(CustomDocumentSolrMetadataExtractor.java:70)
	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:151)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:499)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:408)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:376)
	at java.base/java.lang.Thread.run(Thread.java:829)

2022-04-21 06:40:25,239 [XWiki Solr index thread] ERROR o.x.j.i.DefaultJobStatusStore  - Failed to create a logger tail for job [[solrsecurity, entity, xwiki, Mail, MailConfig]] 
java.nio.file.FileSystemException: X:\XFiles\jobs\status\solrsecurity\entity\xwiki\Mail\MailConfig\log.xml: The process cannot access the file because it is being used by another process.

	at java.base/sun.nio.fs.WindowsException.translateToIOException(WindowsException.java:92)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:103)
	at java.base/sun.nio.fs.WindowsException.rethrowAsIOException(WindowsException.java:108)
	at java.base/sun.nio.fs.WindowsFileSystemProvider.implDelete(WindowsFileSystemProvider.java:274)
	at java.base/sun.nio.fs.AbstractFileSystemProvider.deleteIfExists(AbstractFileSystemProvider.java:110)
	at java.base/java.nio.file.Files.deleteIfExists(Files.java:1181)
	at org.xwiki.logging.internal.tail.AbstractFileLoggerTail.initialize(AbstractFileLoggerTail.java:178)
	at org.xwiki.logging.internal.tail.AbstractTextFileLoggerTail.initialize(AbstractTextFileLoggerTail.java:52)
	at org.xwiki.logging.internal.tail.XStreamFileLoggerTail.initialize(XStreamFileLoggerTail.java:55)
	at org.xwiki.logging.logback.internal.DefaultLoggerManager.createLoggerTail(DefaultLoggerManager.java:238)
	at org.xwiki.job.internal.DefaultJobStatusStore.createLoggerTail(DefaultJobStatusStore.java:487)
	at org.xwiki.job.internal.DefaultJobStatusStore.createLoggerTail(DefaultJobStatusStore.java:476)
	at org.xwiki.job.AbstractJob.initialize(AbstractJob.java:175)
	at org.xwiki.job.internal.DefaultJobExecutor.createJob(DefaultJobExecutor.java:308)
	at org.xwiki.job.internal.DefaultJobExecutor.execute(DefaultJobExecutor.java:316)
	at org.xwiki.contrib.solrsecurity.internal.SolrSecurityDispatcher.execute(SolrSecurityDispatcher.java:106)
	at org.xwiki.contrib.solrsecurity.internal.SolrSecurityDispatcher.indexEntity(SolrSecurityDispatcher.java:85)
	at org.xwiki.contrib.solrsecurity.internal.CustomDocumentSolrMetadataExtractor.setFieldsInternal(CustomDocumentSolrMetadataExtractor.java:70)
	at org.xwiki.search.solr.internal.metadata.AbstractSolrMetadataExtractor.getSolrDocument(AbstractSolrMetadataExtractor.java:151)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.getSolrDocument(DefaultSolrIndexer.java:499)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.processBatch(DefaultSolrIndexer.java:408)
	at org.xwiki.search.solr.internal.DefaultSolrIndexer.run(DefaultSolrIndexer.java:376)
	at java.base/java.lang.Thread.run(Thread.java:829)

Hello. Could it be that you have another instance of XWiki pointing to the same perm dir or that you have opened the file (log.xml) in an editor? The error says that another process has a lock on it. Maybe you can run some tool on windows to find out which process this is.

Hello, @vmassol

  1. No. only One Xwiki instance.
  2. By windows utils “openfiles”, i don’t seen any processes that opened files in my path “X:\XFiles\jobs\status\solrsecurity”. Only tomcat user’s process.

any idea?

Test case:

  1. I stop tomcat service.
  2. moving folder “X:\XFiles\jobs\status\solrsecurity” in “X:\XFiles\jobs\status\solrsecurity_old”
  3. start tomcat service
  4. new folder “X:\XFiles\jobs\status\solrsecurity” was created, and created any files and subfolders, but erros in logs, still exist/
  5. i try delete folder “X:\XFiles\jobs\status\solrsecurity_old” but get next error(“path too long” - see scr.) maybe problem in this?

path_too_long