Re-index fail due to timestamp conversion issue
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
症状
JIRA is using MySQL as database and while attempting to execute the re-index, this error is shown on the screen:
Also, the following appears in the atlassian-jira.log
:
2013-02-24 19:07:32,477 indexerPool-1-thread-5 WARN [index.indexers.impl.DefaultCustomFieldIndexer] An exception thrown getting the custom field value for indexing. Value for 'customfield_10173' (Server Type) not indexed.
com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: Error creating GenericValue (SQL Exception while getting value: (Cannot convert value '0000-00-00 00:00:00' from column 15 to TIMESTAMP.))
...
原因
MySQL uses "zero dates" as special placeholder, but JDBC can not handle them by default.
ソリューション
- Jira をシャットダウンします。
Add the 'zeroDateTimeBehavior=convertToNull' property to the JDBC url, either in datasource URL if using JNDI location or as an additional parameter to the JDBC url at the dbconfig.xml. The JDBC url will then look like this example:
jdbc:mysql://localhost:3306/jira?useUnicode=true&characterEncoding=UTF8&sessionVariables=storage_engine=InnoDB?zeroDateTimeBehavior=convertToNull
Jira を再起動します
- Manually trigger a re-index.