-
Bug
-
Resolution: Unresolved
-
Low
-
None
-
8.20.29, 9.12.1, 10.0.1
-
8.2
-
3
-
Severity 3 - Minor
-
Issue Summary
This is reproducible on Data Center: Yes
Steps to Reproduce
- Navigate to System > General Configuration > Advanced Settings.
- Update the following settings:
- Change the value of jira.date.time.picker.java.format to dd-MM-yyyy HH:mm.
- Change the value of jira.date.time.picker.javascript.format to %d-%m-%Y %H:%M.
- Create a custom field for the datetime picker and ensure it is added to the desired screen.
- Set the date in the datetime picker custom field. When the date appears in the field, prepend a hyphen
before the year, as illustrated in the screenshot below.
- If you prefer not to create a custom field, consider adding a worklog and following the same steps.
- When you update the issue or worklog, please note that the date validation may fail, and the information will be saved as it is.
Expected Results
The date validation must be applied to the format dd-MM-yyyy HH:mm, ensuring that negative years are not permitted for storage in the database.
Actual Results
The date validation does not apply to the format dd-MM-yyyy HH:mm, and dates with negative years are stored in the database.
When a date is stored with a negative year, indexing for the corresponding issue or worklog fails, resulting in the following error:
The below exception is thrown in the xxxxxxx.log file:
2024-10-29 10:25:41,761+0000 http-nio-8080-exec-14 url: /jira/secure/CreateWorklog.jspa; user: admin WARN admin 625x543x1 1qtox0l 172.29.216.187,172.50.0.3 /secure/CreateWorklog.jspa [c.a.jira.index.AccumulatingResultBuilder] java.lang.IllegalArgumentException: LocalDate only handles the Common Era - no BC dates are allowed.
java.lang.RuntimeException: java.lang.IllegalArgumentException: LocalDate only handles the Common Era - no BC dates are allowed.
at com.atlassian.jira.index.DefaultIndex$Failure.<init>(DefaultIndex.java:100)
at com.atlassian.jira.issue.index.DefaultIssueIndexer$EntityOperation.perform(DefaultIssueIndexer.java:842)
at com.atlassian.jira.issue.index.DefaultIssueIndexer.lambda$null$4(DefaultIssueIndexer.java:517)
at com.atlassian.jira.index.SimpleIndexingStrategy.apply(SimpleIndexingStrategy.java:7)
at com.atlassian.jira.index.SimpleIndexingStrategy.apply(SimpleIndexingStrategy.java:5)
at com.atlassian.jira.issue.index.DefaultIssueIndexer.lambda$perform$5(DefaultIssueIndexer.java:515)
at com.atlassian.jira.util.collect.CollectionEnclosedIterable.foreach(CollectionEnclosedIterable.java:40)
at com.atlassian.jira.issue.index.DefaultIssueIndexer.perform(DefaultIssueIndexer.java:489)
at com.atlassian.jira.issue.index.DefaultIssueIndexer.perform(DefaultIssueIndexer.java:553)
at com.atlassian.jira.issue.index.DefaultIssueIndexer.reindexWorklogs(DefaultIssueIndexer.java:364)
at com.atlassian.jira.issue.index.DefaultIndexManager.lambda$reIndexWorklogs$7(DefaultIndexManager.java:713)
at com.atlassian.jira.issue.index.DefaultIndexManager.executeWithIndexLock(DefaultIndexManager.java:919)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexRelatedEntity(DefaultIndexManager.java:730)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexWorklogs(DefaultIndexManager.java:714)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexWorklogs(DefaultIndexManager.java:707)
at com.atlassian.jira.issue.index.DefaultIndexManager.reIndexWorklogs(DefaultIndexManager.java:702)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
Workaround
Change the following properties back to their default values:
- jira.date.time.picker.java.format to dd/MMM/yy h:mm a.
- jira.date.time.picker.javascript.format to %e/%b/%y %I:%M %p.
Please follow the guidelines outlined in the knowledge base article available at https://confluence.atlassian.com/jirakb/indexing-jira-throws-localdate-only-handles-the-common-era-no-bc-dates-are-allowed-error-297669190.html to rectify any corrupted values associated with the issues to avoid indexing failures.