Exceeds max allowed packet for MySQL

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: サーバーと Data Center のみ。この記事は、サーバーおよび Data Center プラットフォームのアトラシアン製品にのみ適用されます。

問題

One or more of the following is observed:

  • Cannot install or upgrade a plugin
  • Cannot upgrade the Universal Plugin Manager
  • Cannot save large pages
  • Cannot upload attachments (when attachments are stored in the database)

The following errors may appear in the atlassian-confluence.log:

ERROR [pool-6-thread-3] [sf.hibernate.util.JDBCExceptionReporter] logExceptions Packet for query is too large (1889999 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
Cause:
java.lang.RuntimeException: There was a problem evicting or flushing a PluginData object
at com.atlassian.confluence.plugin.persistence.hibernate.HibernatePluginDataDao.saveOrUpdate(HibernatePluginDataDao.java:65)
caused by: net.sf.hibernate.exception.GenericJDBCException: Could not execute JDBC batch update
at net.sf.hibernate.exception.ErrorCodeConverter.handledNonSpecificException(ErrorCodeConverter.java:90)
caused by: java.sql.BatchUpdateException: Packet for query is too large (1238730 > 1048576). You can change this value on the server by setting the max_allowed_packet' variable.
at com.mysql.jdbc.PreparedStatement.executeBatchSerially(PreparedStatement.java:1213)

原因

The MySQL packet size setting by default is not big enough to allow most add-on's to install in the Confluence database. Plugin data, attachments, and large page bodies can often exceed the default limit of 1 Mb. For more information see here:

http://dev.mysql.com/doc/refman/5.6/en/packet-too-large.html

ソリューション

Set the MySQL packet size to a larger value (256MB) and restart MySQL Server. 256MB should be large enough to cover most cases.

shell> mysqld --max_allowed_packet=256M

Alternatively, you can do this on your MySQL server's settings by editing MySQL's my.cnf file (often named my.ini on Windows operating systems). Locate the [mysqld]section in the file, and add/modify the following parameters:

[mysqld]
...
max_allowed_packet = 256M
...

(i) Remember to restart MySQL services in order for the changes above to take effect. For more information, please refer to MySQL manual: http://dev.mysql.com/doc/refman/5.0/en/packet-too-large.html.

注意:

If you are unable to stop your database, you can alternatively set the value of the max allowed packet parameter dynamically. To do so:

  1. Log in as a root user.
  2. You'll need to set the value as an integer, rather than '256M'. 256M is equivalent to 256*1024*1024, or 268435456.
  3. mysql> SET GLOBAL max_allowed_packet=268435456;
  4. To check that this has been applied:
    1. Relogin to your mysql client.
    2. mysql> SELECT @@max_allowed_packet;
  5. Restart your Confluence instance.

You will still need to update your /etc/my.cnf file as described in the method above to make the change persistent.

最終更新日: 2016 年 2 月 26 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.