AnsweredAssumed Answered

ACT_GE_BYTEARRAY PacketTooBigException

Question asked by mhanrahan on Jan 19, 2017
Latest reply on Jan 25, 2017 by gdharley

We recently upgraded the version of Activiti that we were using from 5.16.3 to 5.21, and we have started to receive this error when we are deploying process bundles via OSGi:

org.apache.ibatis.exceptions.PersistenceException:
### Error updating database.  Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (5157650 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
### The error may involve org.activiti.engine.impl.persistence.entity.ResourceEntity.bulkInsertResource-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO ACT_GE_BYTEARRAY(ID_, REV_, NAME_, BYTES_, DEPLOYMENT_ID_, GENERATED_) VALUES                    (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)        ,           (?,          1,          ?,          ?,          ?,          ?)
### Cause: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (5157650 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
    at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)[224:org.mybatis.mybatis:3.3.0]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:172)[224:org.mybatis.mybatis:3.3.0]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.insert(DefaultSqlSession.java:157)[224:org.mybatis.mybatis:3.3.0]
    at org.activiti.engine.impl.db.DbSqlSession.flushBulkInsert(DbSqlSession.java:856)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.db.DbSqlSession.flushPersistentObjects(DbSqlSession.java:820)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.db.DbSqlSession.flushInserts(DbSqlSession.java:797)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.db.DbSqlSession.flush(DbSqlSession.java:618)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.interceptor.CommandContext.flushSessions(CommandContext.java:212)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.interceptor.CommandContext.close(CommandContext.java:138)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.interceptor.CommandContextInterceptor.execute(CommandContextInterceptor.java:66)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.interceptor.LogInterceptor.execute(LogInterceptor.java:31)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:40)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.cfg.CommandExecutorImpl.execute(CommandExecutorImpl.java:35)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.RepositoryServiceImpl.deploy(RepositoryServiceImpl.java:79)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.engine.impl.repository.DeploymentBuilderImpl.deploy(DeploymentBuilderImpl.java:156)[45:org.activiti.engine:5.21.0.dgit-fix-6]
    at org.activiti.osgi.Extender.checkBundle(Extender.java:224)[9:activiti-osgi:5.21.0.dgit-fix-6]
    at org.activiti.osgi.Extender.checkInitialBundle(Extender.java:147)[9:activiti-osgi:5.21.0.dgit-fix-6]
    at org.activiti.osgi.Extender.addingBundle(Extender.java:105)[9:activiti-osgi:5.21.0.dgit-fix-6]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:469)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker$Tracked.customizerAdding(BundleTracker.java:415)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackAdding(AbstractTracked.java:256)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.AbstractTracked.trackInitial(AbstractTracked.java:183)[org.osgi.core-6.0.0.jar:]
    at org.osgi.util.tracker.BundleTracker.open(BundleTracker.java:156)[org.osgi.core-6.0.0.jar:]
    at org.activiti.osgi.Extender$1.run(Extender.java:86)[9:activiti-osgi:5.21.0.dgit-fix-6]
Caused by: com.mysql.jdbc.PacketTooBigException: Packet for query is too large (5157650 > 4194304). You can change this value on the server by setting the max_allowed_packet' variable.
    at com.mysql.jdbc.MysqlIO.send(MysqlIO.java:3915)[22:com.mysql.jdbc:5.1.29]
    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2598)[22:com.mysql.jdbc:5.1.29]
    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2778)[22:com.mysql.jdbc:5.1.29]
    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2834)[22:com.mysql.jdbc:5.1.29]
    at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:2156)[22:com.mysql.jdbc:5.1.29]
    at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1379)[22:com.mysql.jdbc:5.1.29]
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)[91:org.apache.commons.dbcp:1.4.0]
    at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)[91:org.apache.commons.dbcp:1.4.0]
    at org.apache.ibatis.executor.statement.PreparedStatementHandler.update(PreparedStatementHandler.java:45)[224:org.mybatis.mybatis:3.3.0]
    at org.apache.ibatis.executor.statement.RoutingStatementHandler.update(RoutingStatementHandler.java:73)[224:org.mybatis.mybatis:3.3.0]
    at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:49)[224:org.mybatis.mybatis:3.3.0]
    at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:115)[224:org.mybatis.mybatis:3.3.0]
    at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:75)[224:org.mybatis.mybatis:3.3.0]
    at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:170)[224:org.mybatis.mybatis:3.3.0]
    ... 22 more

 

I would like to avoid changing the max_allowed_packet property of MySQL as the Database is administered by someone else. The contents of the bundle we are trying to deploy add up to ~3mb.

 

This exact same bundle works with Activiti 5.16.3

Outcomes