max_allowed_packet 관련 에러
증상
요나 글 저장시
아래와 같은 에러 발생1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42[error] play - Cannot invoke the action, eventually got an error: javax.persistence.PersistenceException: ERROR executing DML bindLog[] error[(conn:9874) Could not send query: stre
am size 1552 is >= to max_allowed_packet (1024)]
[error] application -
! @74nc2k2em - Internal server error, for (POST) [/issue/6/edit] ->
play.api.Application$$anon$1: Execution exception[[PersistenceException: ERROR executing DML bindLog[] error[(conn:9874) Could not send query: stream size 1552 is >= to max_allowed
_packet (1024)]]]
at play.api.Application$class.handleError(Application.scala:296) ~[com.typesafe.play.play_2.10-2.3.10.jar:2.3.10]
at play.api.DefaultApplication.handleError(Application.scala:402) [com.typesafe.play.play_2.10-2.3.10.jar:2.3.10]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.10-2.3.10.jar:2
.3.10]
at play.core.server.netty.PlayDefaultUpstreamHandler$$anonfun$3$$anonfun$applyOrElse$4.apply(PlayDefaultUpstreamHandler.scala:320) [com.typesafe.play.play_2.10-2.3.10.jar:2
.3.10]
at scala.Option.map(Option.scala:145) [org.scala-lang.scala-library-2.10.4.jar:na]
Caused by: javax.persistence.PersistenceException: ERROR executing DML bindLog[] error[(conn:9874) Could not send query: stream size 1552 is >= to max_allowed_packet (1024)]
at com.avaje.ebeaninternal.server.persist.dml.DmlBeanPersister.execute(DmlBeanPersister.java:97) ~[org.avaje.ebeanorm.avaje-ebeanorm-3.3.4.jar:na]
at com.avaje.ebeaninternal.server.persist.dml.DmlBeanPersister.insert(DmlBeanPersister.java:57) ~[org.avaje.ebeanorm.avaje-ebeanorm-3.3.4.jar:na]
at com.avaje.ebeaninternal.server.persist.DefaultPersistExecute.executeInsertBean(DefaultPersistExecute.java:66) ~[org.avaje.ebeanorm.avaje-ebeanorm-3.3.4.jar:na]
at com.avaje.ebeaninternal.server.core.PersistRequestBean.executeNow(PersistRequestBean.java:448) ~[org.avaje.ebeanorm.avaje-ebeanorm-3.3.4.jar:na]
at com.avaje.ebeaninternal.server.core.PersistRequestBean.executeOrQueue(PersistRequestBean.java:478) ~[org.avaje.ebeanorm.avaje-ebeanorm-3.3.4.jar:na]
Caused by: java.sql.SQLTransientException: (conn:9874) Could not send query: stream size 1552 is >= to max_allowed_packet (1024)
at org.mariadb.jdbc.internal.util.ExceptionMapper.get(ExceptionMapper.java:140) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.internal.util.ExceptionMapper.getException(ExceptionMapper.java:101) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.internal.util.ExceptionMapper.throwAndLogException(ExceptionMapper.java:77) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.MariaDbStatement.executeQueryEpilog(MariaDbStatement.java:224) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:411) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
Caused by: org.mariadb.jdbc.internal.util.dao.QueryException: Could not send query: stream size 1552 is >= to max_allowed_packet (1024)
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executePreparedQuery(AbstractQueryProtocol.java:608) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:398) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.MariaDbServerPreparedStatement.execute(MariaDbServerPreparedStatement.java:359) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeUpdate(MariaDbServerPreparedStatement.java:348) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at com.jolbox.bonecp.PreparedStatementHandle.executeUpdate(PreparedStatementHandle.java:205) ~[com.jolbox.bonecp-0.8.0.RELEASE.jar:na]
Caused by: org.mariadb.jdbc.internal.stream.MaxAllowedPacketException: stream size 1552 is >= to max_allowed_packet (1024)
at org.mariadb.jdbc.internal.stream.PacketOutputStream.checkPacketMaxSize(PacketOutputStream.java:485) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.internal.stream.PacketOutputStream.finishPacketWithoutRelease(PacketOutputStream.java:415) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.internal.packet.ComStmtExecute.send(ComStmtExecute.java:94) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.internal.protocol.AbstractQueryProtocol.executePreparedQuery(AbstractQueryProtocol.java:601) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
at org.mariadb.jdbc.MariaDbServerPreparedStatement.executeInternal(MariaDbServerPreparedStatement.java:398) ~[org.mariadb.jdbc.mariadb-java-client-1.5.5.jar:na]
[info] a./issue/6/edit - 112.221.117.58 - - [27/Jul/2017:23:26:39 +0900] "POST /issue/6/edit HTTP/1.1" 500 - "http://yona.sky12.kr/issue/6/e
ditform" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" -
[info] a./messages.js - 112.221.117.58 - flapper [27/Jul/2017:23:26:39 +0900] "GET /messages.js HTTP/1.1" 200 - "http://yona.sky12.kr/issue/6/edit" "Mozilla/5.0 (Ma
cintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" 7ms
[info] a./user/usermenuTabContentList - 112.221.117.58 - flapper [27/Jul/2017:23:26:39 +0900] "GET /user/usermenuTabContentList HTTP/1.1" 200 - "http://yona.sky12.kr/issue/6/edit" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36" 60ms원인
해결
- 아래와 같이 설정
SET GLOBAL max_allowed_packet = 524288000; - 확인
show variables where Variable_name = ‘max_allowed_packet’; - DB 리스타트
net stop mysql
net start mysql