voyanttools / trombone

GNU General Public License v3.0
3 stars 2 forks source link

Access Management isn't working #1

Closed ajmacdonald closed 3 years ago

ajmacdonald commented 3 years ago

Stack trace:

no segments* file found in NIOFSDirectory@/mnt/voyant-data/trombone5_2/lucene-per-corpus/2754d83c3dcc1b5f024e16818d5c319f lockFactory=org.apache.lucene.store.NativeFSLockFactory@36b412e6: files: []
org.apache.lucene.index.IndexNotFoundException: no segments* file found in NIOFSDirectory@/mnt/voyant-data/trombone5_2/lucene-per-corpus/2754d83c3dcc1b5f024e16818d5c319f lockFactory=org.apache.lucene.store.NativeFSLockFactory@36b412e6: files: []
    at org.apache.lucene.index.SegmentInfos$FindSegmentsFile.run(SegmentInfos.java:680)
    at org.apache.lucene.index.StandardDirectoryReader.open(StandardDirectoryReader.java:77)
    at org.apache.lucene.index.DirectoryReader.open(DirectoryReader.java:63)
    at org.voyanttools.trombone.lucene.SingleIndexLuceneManager.getDirectoryReader(SingleIndexLuceneManager.java:52)
    at org.voyanttools.trombone.lucene.PerCorpusIndexLuceneManager.getDirectoryReader(PerCorpusIndexLuceneManager.java:58)
    at org.voyanttools.trombone.lucene.CorpusMapper.buildFromTermsEnum(CorpusMapper.java:153)
    at org.voyanttools.trombone.lucene.CorpusMapper.build(CorpusMapper.java:145)
    at org.voyanttools.trombone.lucene.CorpusMapper.getLeafReader(CorpusMapper.java:105)
    at org.voyanttools.trombone.model.CorpusTermMinimalsDB.buildFromDocumentTermVectors(CorpusTermMinimalsDB.java:61)
    at org.voyanttools.trombone.model.CorpusTermMinimalsDB.getInstance(CorpusTermMinimalsDB.java:55)
    at org.voyanttools.trombone.model.CorpusTermMinimalsDB.getInstance(CorpusTermMinimalsDB.java:46)
    at org.voyanttools.trombone.tool.build.CorpusBuilder.indexCorpusTerms(CorpusBuilder.java:180)
    at org.voyanttools.trombone.tool.build.CorpusBuilder.indexCorpusTerms(CorpusBuilder.java:167)
    at org.voyanttools.trombone.tool.build.CorpusBuilder.run(CorpusBuilder.java:97)
    at org.voyanttools.trombone.tool.build.CorpusBuilder.run(CorpusBuilder.java:76)
    at org.voyanttools.trombone.tool.build.RealCorpusCreator.run(RealCorpusCreator.java:115)
    at org.voyanttools.trombone.tool.corpus.CorpusCreator.run(CorpusCreator.java:49)
    at org.voyanttools.trombone.tool.util.ToolRunner.run(ToolRunner.java:134)
    at org.voyanttools.trombone.Controller.run(Controller.java:110)
    at org.voyanttools.voyant.Trombone.runTromboneController(Trombone.java:337)
    at org.voyanttools.voyant.Trombone.doRequest(Trombone.java:311)
    at org.voyanttools.voyant.Trombone.doRequest(Trombone.java:146)
    at org.voyanttools.voyant.Trombone.doPost(Trombone.java:87)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:650)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:731)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:218)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:110)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:498)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:169)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
    at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:683)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:962)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:445)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1091)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:637)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:316)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
    at java.lang.Thread.run(Thread.java:748)
ajmacdonald commented 3 years ago

Further research reveals that access management is broken only when using the "file-per-corpus" storage strategy.

A new corpus ID is set but the directory for it does not exist: https://github.com/voyanttools/trombone/blob/4c3602f2ac8e2e29298f86bdf76bf4652a7729f4/src/main/java/org/voyanttools/trombone/tool/build/CorpusBuilder.java#L89

ajmacdonald commented 3 years ago

de8785bf16851c178f9b6706f30934c691fd99fe