'Timestamp Format Must Be yyyy-mm-dd' while Importing from an External System

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

A JIRA application import fails, throwing a java.lang.IllegalArgumentException. The following appears in the 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)

Cause

There can be two causes for this error.

  1. The timestamp does not correspond to the  application configured date and time format. In the example above - yyyy-mm-dd - the lower case of m defined is representing the minute in an hour.
  2. If above doesn't help, there could be an invalid date (for example 19740-06-05 00:00:00.0) in the backup XML file that could be causing this error. When this date is not compatible with the targeted JIRA application instance, the system throws this error.

Workaround

  1. Configure the destination of the JIRA application to match the date and time format from the original system's format. See Date/Time Formats.
  2. 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.

Resolution

Based on two causes of this error, there are two resolutions for the error.

  1. Track JRA-23171 - Getting issue details... STATUS for a resolution on the bug.
  2. Fix the invalid date in the XML file and then try to import the file again into the JIRA application. In the above example, that date is 19740-06-05 00:00:00.0. This can be corrected by modifying the date in the XML backup to be something valid, such as 1970-06-05 00:00:00.0.

(info) An easy way of finding the line numbers to modify in Linux would be to use egrep, for example:

egrep -n "[0-9]{5}\-[0-9]{2}\-[0-9]{2}" entities.xml
Last modified on Mar 30, 2016

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.