Tellier Benoit created JAMES-1869:
-------------------------------------
Summary: JMAP protocol should limit the size of a mailbox name
Key: JAMES-1869
URL: https://issues.apache.org/jira/browse/JAMES-1869
Project: James Server
Issue Type: Bug
Reporter: Tellier Benoit
When creating a mailbox with a size of more than 64K characters, cassandra
implementation complains :
```
esn_james | 13:06:06.702 [WARN ] o.e.j.s.ServletHandler - /jmap
esn_james | com.datastax.driver.core.exceptions.InvalidQueryException:
Index expression values may not be larger than 64K
esn_james | at
com.datastax.driver.core.Responses$Error.asException(Responses.java:102)
esn_james | at
com.datastax.driver.core.DefaultResultSetFuture.onSet(DefaultResultSetFuture.java:149)
esn_james | at
com.datastax.driver.core.RequestHandler.setFinalResult(RequestHandler.java:183)
esn_james | at
com.datastax.driver.core.RequestHandler.access$2300(RequestHandler.java:44)
esn_james | at
com.datastax.driver.core.RequestHandler$SpeculativeExecution.setFinalResult(RequestHandler.java:748)
esn_james | at
com.datastax.driver.core.RequestHandler$SpeculativeExecution.onSet(RequestHandler.java:573)
esn_james | at
com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:1013)
esn_james | at
com.datastax.driver.core.Connection$Dispatcher.channelRead0(Connection.java:936)
esn_james | at
io.netty.channel.SimpleChannelInboundHandler.channelRead(SimpleChannelInboundHandler.java:105)
esn_james | at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
esn_james | at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
esn_james | at
io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:254)
esn_james | at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
esn_james | at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
esn_james | at
io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:103)
esn_james | at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
esn_james | at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
esn_james | at
io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:242)
esn_james | at
io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:339)
esn_james | at
io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:324)
esn_james | at
io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:847)
esn_james | at
io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
esn_james | at
io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:511)
esn_james | at
io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:468)
esn_james | at
io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:382)
esn_james | at
io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:354)
esn_james | at
io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:111)
esn_james | ... 1 common frames omitted
esn_james | Wrapped by:
com.datastax.driver.core.exceptions.InvalidQueryException: Index expression
values may not be larger than 64K
esn_james | at
com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
esn_james | at
com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
esn_james | at
com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:214)
esn_james | at
com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:52)
esn_james | at
org.apache.james.mailbox.cassandra.mail.CassandraMailboxMapper.findMailboxByPath(CassandraMailboxMapper.java:86)
esn_james | at
org.apache.james.mailbox.store.StoreMailboxManager.mailboxExists(StoreMailboxManager.java:607)
esn_james | at
org.apache.james.mailbox.store.StoreMailboxManager.createMailbox(StoreMailboxManager.java:419)
esn_james | at
org.apache.james.jmap.methods.SetMailboxesCreationProcessor.createMailbox(SetMailboxesCreationProcessor.java:97)
esn_james | at
org.apache.james.jmap.methods.SetMailboxesCreationProcessor.lambda$process$2(SetMailboxesCreationProcessor.java:75)
esn_james | at java.util.ArrayList.forEach(ArrayList.java:1249)
esn_james | at
org.apache.james.jmap.methods.SetMailboxesCreationProcessor.process(SetMailboxesCreationProcessor.java:74)
esn_james | at
org.apache.james.jmap.methods.SetMailboxesMethod.lambda$setMailboxesResponse$0(SetMailboxesMethod.java:73)
esn_james | at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
esn_james | at java.util.Iterator.forEachRemaining(Iterator.java:116)
esn_james | at
java.util.Spliterators$IteratorSpliterator.forEachRemaining(Spliterators.java:1801)
esn_james | at
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
esn_james | at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
esn_james | at
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
esn_james | at
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
esn_james | at
java.util.stream.ReferencePipeline.reduce(ReferencePipeline.java:484)
esn_james | at
org.apache.james.jmap.methods.SetMailboxesMethod.setMailboxesResponse(SetMailboxesMethod.java:74)
esn_james | at
org.apache.james.jmap.methods.SetMailboxesMethod.process(SetMailboxesMethod.java:66)
esn_james | at
org.apache.james.jmap.methods.RequestHandler.lambda$extractAndProcess$1(RequestHandler.java:67)
esn_james | at java.util.Optional.map(Optional.java:215)
esn_james | at
org.apache.james.jmap.methods.RequestHandler.handle(RequestHandler.java:57)
esn_james | at
java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:267)
esn_james | at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
esn_james | at
java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
esn_james | at
java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
esn_james | at
java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:481)
esn_james | at
java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
esn_james | at
java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
esn_james | at
java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
esn_james | at
java.util.stream.ReferencePipeline.collect(ReferencePipeline.java:499)
esn_james | at
org.apache.james.jmap.JMAPServlet.doPost(JMAPServlet.java:71)
esn_james | at
javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
esn_james | at
javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
esn_james | at
org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
esn_james | at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1685)
esn_james | at
org.apache.james.jmap.FirstUserConnectionFilter.doFilter(FirstUserConnectionFilter.java:71)
esn_james | at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
esn_james | at
org.apache.james.jmap.AuthenticationFilter.doFilter(AuthenticationFilter.java:75)
esn_james | at
org.apache.james.jmap.BypassAuthOnRequestMethod.tryAuth(BypassAuthOnRequestMethod.java:115)
esn_james | at
org.apache.james.jmap.BypassAuthOnRequestMethod.doFilter(BypassAuthOnRequestMethod.java:97)
esn_james | at
org.apache.james.jmap.AllowAllCrossOriginRequests.doFilter(AllowAllCrossOriginRequests.java:46)
esn_james | at
org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1668)
esn_james | at
org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:581)
esn_james | at
org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:513)
esn_james | at
org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
esn_james | at
org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
esn_james | at org.eclipse.jetty.server.Server.handle(Server.java:517)
esn_james | at
org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)
esn_james | at
org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
esn_james | at
org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
esn_james | at
org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
esn_james | at
org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
esn_james | at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
esn_james | at
org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
esn_james | at
org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
esn_james | at
org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
esn_james | at java.lang.Thread.run(Thread.java:745)
```
We should have a check for this in the JMAP protocol layer. We should also
check for this issue with IMAP. An error should be returned to the user, more
concise and without reaching the storage layer.
Acceptation criteria :
- Write an integration test for JMAP
- Write a MPT test for IMAP
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]