Issue key increments unexpectedly on new issue creation in Jira server
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Symptoms
Issue count increases randomly to a high value with no apparent cause. For example, in a project with 30 issues, the next issue created should be ATP-31, but instead is something like ATP-392.
In the atlassian-jira-incoming-mail.log
an error like the following will be displayed:
][priority,3][timeestimate,null][duedate,null][timeoriginalestimate,null][watches,0][key,TFT-36629] (SQL Exception while executing the following:INSERT INTO jiraissue (ID, pkey, PROJECT, REPORTER, ASSIGNEE, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (Incorrect string value: '\xEF\xBB\xBF \x0D\x0A...' for column 'DESCRIPTION' at row 1))
at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:135)
at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:100)
at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:64)
at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:487)
at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:467)
at org.ofbiz.core.entity.GenericValue.create(GenericValue.java:98)
at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:374)
... 22 more
Cause
- Running JIRA with a non UTF-8 file encoding
- The JIRA database is configured with an incorrect file encoding
This is known to cause problems when creating issues that contain special characters through an email, which causes JIRA to thrown SQL exceptions when trying to store the issue, and consequently fails to create it. However, the issue key counter is increased even though the issue was not stored, hence the issue count is randomly increased.
Diagnose
Verify if the System Encoding encoding is
utf-8
(Administration » System Info » System Encoding
). In the logs, you can see this encoding as the following:file.encoding : ANSI_X3.4-1968
- Check that the correct URL is used in
dbconfig.xml
, as in Connecting JIRA to MySQL. Verify if the JIRA database was created with the correct character encoding using the below:
use <jira_database_name>; show variables where variable_name = 'character_set_database';