Uploaded image for project: 'James Mailbox'
  1. James Mailbox
  2. MAILBOX-323

InvalidQuery exception in cassandra mailbox quota

    XMLWordPrintableJSON

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: master
    • Fix Version/s: None
    • Component/s: cassandra, quota
    • Labels:

      Description

      A statement was reused accross query execution without being prepared.

      That lead to possibly this kind of error:

      Exception calling IsOverQuota: Invalid amount of bind variables
      com.datastax.driver.core.exceptions.InvalidQueryException: Invalid amount of bind variables
      	at com.datastax.driver.core.exceptions.InvalidQueryException.copy(InvalidQueryException.java:50)
      	at com.datastax.driver.core.DriverThrowables.propagateCause(DriverThrowables.java:37)
      	at com.datastax.driver.core.DefaultResultSetFuture.getUninterruptibly(DefaultResultSetFuture.java:245)
      	at com.datastax.driver.core.AbstractSession.execute(AbstractSession.java:68)
      	at org.apache.james.mailbox.cassandra.quota.CassandraPerUserMaxQuotaManager.getDefaultMaxMessage(CassandraPerUserMaxQuotaManager.java:113)
      	at org.apache.james.mailbox.cassandra.quota.CassandraPerUserMaxQuotaManager.getMaxMessage(CassandraPerUserMaxQuotaManager.java:133)
      	at org.apache.james.mailbox.store.quota.StoreQuotaManager.getMessageQuota(StoreQuotaManager.java:52)
      	at org.apache.james.transport.matchers.IsOverQuota.match(IsOverQuota.java:83)
      	at org.apache.james.mailetcontainer.impl.camel.MatcherSplitter.split(MatcherSplitter.java:112)
      at sun.reflect.GeneratedMethodAccessor67.invoke(Unknown Source)
      

      We should rather use a prepared statement and keeping the key as a bind variable.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              btellier Benoit Tellier
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: