Modeshape: resetting to invalid mark after updating to Tika 1.18
jan.renaat Aug 19, 2019 9:56 AMHi, I updated the Tika dependencies to Tika 1.18 (RH cve fixes), but now I'm running into "org.apache.tika.io.TaggedIOException: Resetting to invalid mark", when org.modeshape.jcr.JcrSession.save is called (it all ends up inside SharedLockingInputStream.reset, which ends up calling BufferedInputStream.reset). Any tips on how to fix this?
Adding the stacktrace for further reference:
javax.jcr.RepositoryException: org.apache.tika.io.TaggedIOException: Resetting to invalid mark at org.modeshape.jcr.JcrSession.save(JcrSession.java:1158) at org.jboss.qe.web.ModeshapeRest.deployFile(ModeshapeRest.java:118) at org.jboss.qe.web.ModeshapeRest.xmi(ModeshapeRest.java:57) at org.jboss.qe.web.ModeshapeRest$Proxy$_$$_WeldClientProxy.xmi(ModeshapeRest$Proxy$_$$_WeldClientProxy.java) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.jboss.resteasy.core.MethodInjectorImpl.invoke(MethodInjectorImpl.java:168) at org.jboss.resteasy.core.ResourceMethod.invokeOnTarget(ResourceMethod.java:269) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:227) at org.jboss.resteasy.core.ResourceMethod.invoke(ResourceMethod.java:216) at org.jboss.resteasy.core.SynchronousDispatcher.getResponse(SynchronousDispatcher.java:583) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:565) at org.jboss.resteasy.core.SynchronousDispatcher.invoke(SynchronousDispatcher.java:130) at org.jboss.resteasy.plugins.server.servlet.ServletContainerDispatcher.service(ServletContainerDispatcher.java:208) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:55) at org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher.service(HttpServletDispatcher.java:50) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:295) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:214) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:231) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:149) at org.jboss.as.web.security.SubjectInfoSetupValve.invoke(SubjectInfoSetupValve.java:34) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:169) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:151) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:97) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:102) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:656) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:926) at java.lang.Thread.run(Thread.java:745) Caused by: org.apache.tika.io.TaggedIOException: Resetting to invalid mark at org.apache.tika.io.TaggedInputStream.handleIOException(TaggedInputStream.java:133) at org.apache.tika.io.ProxyInputStream.reset(ProxyInputStream.java:170) at org.apache.tika.io.TikaInputStream.reset(TikaInputStream.java:673) at org.apache.tika.mime.MimeTypes.detect(MimeTypes.java:496) at org.apache.tika.detect.CompositeDetector.detect(CompositeDetector.java:84) at org.modeshape.jcr.mimetype.TikaMimeTypeDetector.mimeTypeOf(TikaMimeTypeDetector.java:131) at org.modeshape.jcr.mimetype.MimeTypeDetectors.mimeTypeOf(MimeTypeDetectors.java:84) at org.modeshape.jcr.value.binary.AbstractBinaryStore.getMimeType(AbstractBinaryStore.java:171) at org.modeshape.jcr.value.binary.StoredBinaryValue.getMimeType(StoredBinaryValue.java:71) at org.modeshape.jcr.JcrSession$JcrPreSave.process(JcrSession.java:2227) at org.modeshape.jcr.cache.document.WritableSessionCache.runPreSaveBeforeTransaction(WritableSessionCache.java:571) at org.modeshape.jcr.cache.document.WritableSessionCache.save(WritableSessionCache.java:631) at org.modeshape.jcr.JcrSession.save(JcrSession.java:1152) ... 32 more Caused by: java.io.IOException: Resetting to invalid mark at java.io.BufferedInputStream.reset(BufferedInputStream.java:448) at org.modeshape.jcr.value.binary.SharedLockingInputStream$8.call(SharedLockingInputStream.java:246) at org.modeshape.jcr.value.binary.SharedLockingInputStream$8.call(SharedLockingInputStream.java:241) at org.modeshape.jcr.value.binary.SharedLockingInputStream.doOperation(SharedLockingInputStream.java:271) at org.modeshape.jcr.value.binary.SharedLockingInputStream.reset(SharedLockingInputStream.java:241) at org.apache.tika.io.ProxyInputStream.reset(ProxyInputStream.java:168) ... 43 more