Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-25825

Date validation needs to be tightened up - at the moment we rely on the backend database too much


      You can give any valid date to JIRA and if the database stores it then it will be accepted. Not all databases that we support have the same range of date support, and data import errors can occur when moving from one db to another. For instance examine https://jira.atlassian.com/browse/TST-26302 0 - this appeasr to have a due date of 11/Jan/00, but on closer examination you will find this was created by SOAP and actually has the date "0800-01-07 15:55:28+10:04:52". This stores fine in Postgres, but when trying to import the XML export into MS SQL Server you get the following exception...

      Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,TEST][status,5][votes,0][resolution,2][type,2][resolutiondate,2011-08-03 23:18:06.842][id,131989][reporter,test_automation_user][project,10420][created,2011-04-26 15:41:13.657][updated,2011-08-03 23:18:06.87][workflowId,290606][priority,4][duedate,0800-01-07 15:50:36.0][watches,0][key,TST-26302] (SQL Exception while setting value:  (Only dates between January 1, 1753 and December 31, 9999 are accepted.))
      	at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:133)
      	at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:98)
      	at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:64)
      	at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:489)
      	at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:469)
      	at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:80)
      	at com.atlassian.jira.action.admin.OfbizImportHandler.createWithDeadlockRetry(OfbizImportHandler.java:515)
      	at com.atlassian.jira.action.admin.OfbizImportHandler$1.run(OfbizImportHandler.java:481)
      	... 6 more

      Please refer the knowledge article here which explains the workaround to prevent this error.

            Unassigned Unassigned
            jwinters tier-0 grump
            8 Vote for this issue
            10 Start watching this issue