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

A corrupt issue gets created despite the error message in case the wrong format year is manually set to the "Date Time Picker" custom field

      Issue Summary

      While creating a new issue (using Jira view or JSM portal view), you can enter the date manually for the "Date Time Picker" custom fields available on the create screen. In case the entered date has the wrong (out of range for database customfieldvalue.datevalue field that stores this data) value for the year, issue creation will fail with the error:
      "We can't create this issue for you right now, it could be due to unsupported content you've entered into one or more of the issue fields. If this situation persists, contact your administrator, as they'll be able to access more specific information in the log file."

      However, in fact, the issue will be created and result in a corrupt workflow state. A newly created issue will not be visible in JQL/REST output because it is not indexed upon creation, but it can be opened by direct link and will appear after the full instance re-index.

      Steps to Reproduce

      1. Create a new "Date Time Picker" custom field (the "Date Time" type custom fields are not affected) and add it to issue create screen
      2. Try to create a new issue and manually set the incorrect year value for the custom field. The "incorrect" value may vary based on jira.date.time.picker.java.format property and used RDBMS (for PostgreSQL and "dd/MMM/yy h:mm a" you can use "30/Jan/2525252 11:09 AM")
        • Validator will correctly identify the wrong format for day/month. Only the wrong year value triggers the issue.
      3. Attempt to create an issue will fail with an error in UI saying that issue can't be created.

        In fact, if you check on the database level (or re-index the instance), the issue will be available.
        select id,issuenum, summary from jiraissue where summary = 'AlexTestSummary';
          id   | issuenum |     summary     
        -------+----------+-----------------
         10100 |       42 | AlexTestSummary
        (1 row)
        
      4. In addition to causing an error message, the main problem is that the issue is created in a corrupt workflow state that prevents it from correctly transitioning.

      This can be identified (and fixed) with the help of database integrity checker or SQL queries from SQL equivalents for Workflow Integrity Check in Jira Data Center:

      SELECT jiraissue.id issue_id,
             jiraissue.workflow_id,
             os_wfentry.*
      FROM jiraissue
               JOIN os_wfentry
                    ON jiraissue.workflow_id = os_wfentry.id
      WHERE os_wfentry.state IS NULL
         OR os_wfentry.state = 0;
       issue_id | workflow_id |  id   |                   name                   | initialized | state 
      ----------+-------------+-------+------------------------------------------+-------------+-------
          10100 |       10100 | 10100 | ITSD: Jira Service Desk default workflow |             |     0
      (1 row)
      

      Expected Results

      The issue shouldn't be created as it was said in the error message (especially in a wrong workflow state)

      Actual Results

      Despite the error, the issue is still created in a corrupt workflow state. The issue is accompanied by the following errors captured in server logs:

      atlassian-jira.log
      2025-01-30 10:42:46,123+0000 http-nio-8080-exec-1 url: /jsm/secure/QuickCreateIssue.jspa; user: admin ERROR admin 642x397x1 s21lz8 10.228.166.49,172.50.0.2 /secure/QuickCreateIssue.jspa [c.a.j.bc.issue.DefaultIssueService] Error creating issue: 
      com.atlassian.jira.exception.CreateException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][parentkey,null][customfield,10301][issue,10100][datevalue,2525252-01-30 10:42:00.0][id,10300][updated,1738233766118] (SQL Exception while executing the following:INSERT INTO public.customfieldvalue (ID, ISSUE, CUSTOMFIELD, UPDATED, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: timestamp out of range: "2525252-01-30 10:42:00+00"))
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:584)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:485)
      ...
      Caused by: com.atlassian.jira.workflow.WorkflowException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][parentkey,null][customfield,10301][issue,10100][datevalue,2525252-01-30 10:42:00.0][id,10300][updated,1738233766118] (SQL Exception while executing the following:INSERT INTO public.customfieldvalue (ID, ISSUE, CUSTOMFIELD, UPDATED, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: timestamp out of range: "2525252-01-30 10:42:00+00"))
      	at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:779)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:576)
      	... 350 more
      Caused by: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:CustomFieldValue][parentkey,null][customfield,10301][issue,10100][datevalue,2525252-01-30 10:42:00.0][id,10300][updated,1738233766118] (SQL Exception while executing the following:INSERT INTO public.customfieldvalue (ID, ISSUE, CUSTOMFIELD, UPDATED, PARENTKEY, STRINGVALUE, NUMBERVALUE, TEXTVALUE, DATEVALUE, VALUETYPE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: timestamp out of range: "2525252-01-30 10:42:00+00"))
      	at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:299)
      	at com.atlassian.jira.ofbiz.WrappingOfBizDelegator.createValue(WrappingOfBizDelegator.java:172)
      ...
      Caused by: org.postgresql.util.PSQLException: ERROR: timestamp out of range: "2525252-01-30 10:42:00+00"
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725)
      	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2412)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:371)
      

      The final root causes of the failure vary based on the used database, but the rest of the exceptions is similar:

      MS SQL
      Caused by: com.microsoft.sqlserver.jdbc.SQLServerException: One or more values is out of range of values for the datetime2 SQL Server data type.
      	at com.microsoft.sqlserver.jdbc.TDSWriter.writeScaledTemporal(IOBuffer.java:5917)
      	at com.microsoft.sqlserver.jdbc.TDSWriter.writeRPCDateTime2(IOBuffer.java:5762)
      
      MySQL
      Caused by: com.mysql.cj.jdbc.exceptions.MysqlDataTruncation: Data truncation: Incorrect datetime value: '2525252-01-30 11:19:00' for column 'DATEVALUE' at row 1
      	at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:104)
      	at com.mysql.cj.jdbc.ClientPreparedStatement.executeInternal(ClientPreparedStatement.java:953)
      	at com.mysql.cj.jdbc.ClientPreparedStatement.executeUpdateInternal(ClientPreparedStatement.java:1092)
      
      Oracle DB
      Caused by: java.sql.SQLException: Year out of range.
      	at oracle.jdbc.driver.DateCommonBinder.setOracleCYMD(OraclePreparedStatement.java:18683)
      	at oracle.jdbc.driver.TimestampBinder.bind(OraclePreparedStatement.java:18964)
      

      Workaround

      Currently, there is no known workaround for this behaviour. A workaround will be added here when available

            [JRASERVER-78560] A corrupt issue gets created despite the error message in case the wrong format year is manually set to the "Date Time Picker" custom field

              Unassigned Unassigned
              e7e12f16f891 Alexander Artemenko
              Affected customers:
              2 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated: