外部システムからのインポート時に"Timestamp Format Must Be yyyy-mm-dd" が表示される
症状
Jira アプリケーションのインポートに失敗し、java.lang.IllegalArgumentException
が返される。atlassian-jira.log
に次のログが記録される。
2012-12-14 09:55:43,055 JiraImportTaskExecutionThread-1 ERROR anonymous 594x16x1 - 0:0:0:0:0:0:0:1%0 /secure/SetupImport.jspa [jira.action.admin.OfbizImportHandler] Failed to set attribute 'CustomFieldValue.datevalue' with value '19740-06-05 00:00:00.0'. Error: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
2012-12-14 09:55:43,056 JiraImportTaskExecutionThread-1 ERROR anonymous 594x16x1 - 0:0:0:0:0:0:0:1%0 /secure/SetupImport.jspa [jira.bc.dataimport.DefaultDataImportService] Error importing data: java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
java.lang.IllegalArgumentException: Timestamp format must be yyyy-mm-dd hh:mm:ss[.fffffffff]
at java.sql.Timestamp.valueOf(Timestamp.java:194)
at org.ofbiz.core.entity.GenericEntity.setString(GenericEntity.java:317)
at com.atlassian.jira.action.admin.OfbizImportHandler.startElement(OfbizImportHandler.java:210)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
原因
このエラーには 2 つの原因が考えられます。
- タイムスタンプが、アプリケーションで設定された日時の形式に対応していない。上述の例の
yyyy-mm-dd
では、定義済みの小文字のm
が時間の分を表しています。 - 上記に該当しない場合、バックアップの XML ファイルに無効な日付 (例:
19740-06-05 00:00:00.0
) が含まれており、それがこのエラーを発生させている可能性があります。この日付がインポート先の Jira アプリケーション インスタンスとの互換性を持たない場合、システムによってこのエラーが返されます。
回避策
- インポート先の Jira アプリケーションを設定し、元のシステムの日時形式に一致するようにします。詳細については「日付と時刻の形式」をご参照ください。
- If there is an invalid date in the xml file, then there would be an indication about it in the atlassian-jira.log file. Try to look throught the logs and then fix the invalid date.
ソリューション
このエラーには 2 つの原因が考えられるため、解決策も 2 種類あります。
- 不具合の修正状況を - JRA-23171Getting issue details... STATUS でご確認ください。
- XML ファイルで無効な日付を修正し、Jira アプリケーションへの再インポートを試みます。上述の例では、この日付は
19740-06-05 00:00:00.0
です。これは、XML バックアップの日付を適切な値 (例:1970-06-05 00:00:00.0
) に変更することで修正できます。
Linux の場合、egrep
を使用して修正対象の数値行を簡単に見つけることができます。例:
egrep -n "[0-9]{5}\-[0-9]{2}\-[0-9]{2}" entities.xml
Last modified on Mar 30, 2016
Powered by Confluence and Scroll Viewport.