Duplicate entry errors in logs after upgrading Jira server with MySQL database

お困りですか?

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

コミュニティに質問

問題

After updating a JIRA application the following logs start to appear in the atlassian-jira.log:

2014-06-23 10:14:00,319 http-bio-8080-exec-25 ERROR xxx 614x203x2 p1s16e xxx.xxx.xxx.xxx /rest/activityplugin/1.0/usersettings [common.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service
com.atlassian.activeobjects.internal.ActiveObjectsSqlException: There was a SQL exception thrown by the Active Objects library:
Database:
	- name:MySQL
	- version:5.1.54-rel12.5-log
	- minor version:1
	- major version:5
Driver:
	- name:MySQL-AB JDBC Driver
	- version:mysql-connector-java-5.1.10 ( Revision: ${svn.Revision} )
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 'PRIMARY'
	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:107)
	at com.atlassian.activeobjects.osgi.DelegatingActiveObjects.create(DelegatingActiveObjects.java:63)  <+3>
	at java.lang.reflect.Method.invoke(Unknown Source)
	(...)
	at java.lang.Thread.run(Unknown Source)
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '0' for key 'PRIMARY'
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	(...)
	at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.create(EntityManagedActiveObjects.java:103)
	... 194 more

原因

In MySQL configuration ( my.ini (Windows) or my.cnf (Unix) ), parameter of sql_mode is set to  NO_AUTO_VALUE_ON_ZERO.

ソリューション

  1. Stop the application.
  2. Stop MySQL
  3. Edit the my.cnf file (often named my.ini on Windows operating systems or my.cnf on UNIX operating systems) in your MySQL server.
  4. Remove NO_AUTO_VALUE_ON_ZERO from sql_mode.

  5. Start MySQL
  6. アプリケーションを開始します。

最終更新日 2019 年 9 月 25 日

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

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