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

Cloning an issue with a sub-task fails with a DB exception if its summary has 255 characters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Low Low
    • None
    • 7.4.6, 8.13.3
    • Issue - Create Issue
    • None

      Issue Summary

      When cloning an issue with sub-tasks, if it contains a sub-task with 255 characters, the operation will fail with an untreated DB exception

      Steps to Reproduce

      1. Create a task on Jira
      2. Associate it with a sub-task with a 255 character long summary
      3. Clone the task, checking the option to clone its sub-tasks.

      Expected Results

      Jira should warn that there's a sub-task that exceeds the limit of characters for the summary field, which is automatically appended to "CLONE - "

      Actual Results

      Jira fails to clone both task and sub-task with the following exception:

      The below exception is thrown in the xxxxxxx.log file:

      ERROR:  value too long for type character varying(255)
      STATEMENT:  INSERT INTO public.jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT, ARCHIVED, ARCHIVEDBY, ARCHIVEDDATE) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10, $11, $12, $13, $14, $15, $16, $17, $18, $19, $20, $21, $22, $23, $24, $25, $26, $27, $28, $29, $30)
      2021-04-23 12:54:55,126-0300 JiraTaskExecutionThread-1 ERROR rrosa 774x292x1 15mwema 127.0.0.1 /secure/CloneIssueDetails.jspa [c.a.j.bc.issue.DefaultIssueService] com.atlassian.jira.workflow.WorkflowException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,CLONE - This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of charact][watches,0][creator,JIRAUSER10000][created,2021-04-23 12:54:55.122][timespent,null][timeoriginalestimate,null][project,10200][description,null][reporter,JIRAUSER10000][type,10003][priority,3][number,4][archived,N][environment,null][security,null][timeestimate,null][duedate,null][resolutiondate,null][votes,0][assignee,null][id,10403][updated,2021-04-23 12:54:55.122][workflowId,10403][status,10000] (SQL Exception while executing the following:INSERT INTO public.jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT, ARCHIVED, ARCHIVEDBY, ARCHIVEDDATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(255)))
      com.atlassian.jira.exception.CreateException: com.atlassian.jira.workflow.WorkflowException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,CLONE - This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of charact][watches,0][creator,JIRAUSER10000][created,2021-04-23 12:54:55.122][timespent,null][timeoriginalestimate,null][project,10200][description,null][reporter,JIRAUSER10000][type,10003][priority,3][number,4][archived,N][environment,null][security,null][timeestimate,null][duedate,null][resolutiondate,null][votes,0][assignee,null][id,10403][updated,2021-04-23 12:54:55.122][workflowId,10403][status,10000] (SQL Exception while executing the following:INSERT INTO public.jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT, ARCHIVED, ARCHIVEDBY, ARCHIVEDDATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(255)))
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:522)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssueObject(DefaultIssueManager.java:616)
      	at com.atlassian.jira.issue.managers.RequestCachingIssueManager.createIssueObject(RequestCachingIssueManager.java:212)
      	at com.atlassian.jira.bc.issue.CloneIssueCommand.cloneSubTasksIfNeeded(CloneIssueCommand.java:452)
      	at com.atlassian.jira.bc.issue.CloneIssueCommand.cloneIssueDependencies(CloneIssueCommand.java:225)
      	at com.atlassian.jira.bc.issue.CloneIssueCommand.call(CloneIssueCommand.java:138)
      	at com.atlassian.jira.bc.issue.CloneIssueCommand.call(CloneIssueCommand.java:61)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:533)
      	at com.atlassian.jira.task.TaskManagerImpl$TaskCallableDecorator.call(TaskManagerImpl.java:491)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
      	at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
      	at com.atlassian.jira.task.ForkedThreadExecutor$ForkedRunnableDecorator.run(ForkedThreadExecutor.java:216)
      	at java.base/java.lang.Thread.run(Thread.java:834)
      Caused by: com.atlassian.jira.workflow.WorkflowException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,CLONE - This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of charact][watches,0][creator,JIRAUSER10000][created,2021-04-23 12:54:55.122][timespent,null][timeoriginalestimate,null][project,10200][description,null][reporter,JIRAUSER10000][type,10003][priority,3][number,4][archived,N][environment,null][security,null][timeestimate,null][duedate,null][resolutiondate,null][votes,0][assignee,null][id,10403][updated,2021-04-23 12:54:55.122][workflowId,10403][status,10000] (SQL Exception while executing the following:INSERT INTO public.jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT, ARCHIVED, ARCHIVEDBY, ARCHIVEDDATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(255)))
      	at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:780)
      	at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:513)
      	... 13 more
      Caused by: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,CLONE - This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of charact][watches,0][creator,JIRAUSER10000][created,2021-04-23 12:54:55.122][timespent,null][timeoriginalestimate,null][project,10200][description,null][reporter,JIRAUSER10000][type,10003][priority,3][number,4][archived,N][environment,null][security,null][timeestimate,null][duedate,null][resolutiondate,null][votes,0][assignee,null][id,10403][updated,2021-04-23 12:54:55.122][workflowId,10403][status,10000] (SQL Exception while executing the following:INSERT INTO public.jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT, ARCHIVED, ARCHIVEDBY, ARCHIVEDDATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(255)))
      	at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:299)
      	at com.atlassian.jira.entity.EntityUtils.createValue(EntityUtils.java:35)
      	at com.atlassian.jira.issue.IssueImpl.store(IssueImpl.java:1207)
      	at com.atlassian.jira.workflow.function.issue.IssueCreateFunction.execute(IssueCreateFunction.java:73)
      	at com.opensymphony.workflow.AbstractWorkflow.executeFunction(AbstractWorkflow.java:1014)
      	at com.opensymphony.workflow.AbstractWorkflow.transitionWorkflow(AbstractWorkflow.java:1407)
      	at com.opensymphony.workflow.AbstractWorkflow.initialize(AbstractWorkflow.java:606)
      	at com.atlassian.jira.workflow.OSWorkflowManager.createIssue(OSWorkflowManager.java:754)
      	... 14 more
      Caused by: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,CLONE - This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of characters This is a subtask with a lot of charact][watches,0][creator,JIRAUSER10000][created,2021-04-23 12:54:55.122][timespent,null][timeoriginalestimate,null][project,10200][description,null][reporter,JIRAUSER10000][type,10003][priority,3][number,4][archived,N][environment,null][security,null][timeestimate,null][duedate,null][resolutiondate,null][votes,0][assignee,null][id,10403][updated,2021-04-23 12:54:55.122][workflowId,10403][status,10000] (SQL Exception while executing the following:INSERT INTO public.jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT, ARCHIVED, ARCHIVEDBY, ARCHIVEDDATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(255)))
      	at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:210)
      	at org.ofbiz.core.entity.GenericDAO.insert(GenericDAO.java:175)
      	at org.ofbiz.core.entity.GenericHelperDAO.create(GenericHelperDAO.java:89)
      	at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:566)
      	at org.ofbiz.core.entity.GenericDelegator.create(GenericDelegator.java:552)
      	at com.atlassian.jira.ofbiz.DefaultOfBizDelegator.createValue(DefaultOfBizDelegator.java:296)
      	... 22 more
      Caused by: org.ofbiz.core.entity.GenericDataSourceException: SQL Exception while executing the following:INSERT INTO public.jiraissue (ID, pkey, issuenum, PROJECT, REPORTER, ASSIGNEE, CREATOR, issuetype, SUMMARY, DESCRIPTION, ENVIRONMENT, PRIORITY, RESOLUTION, issuestatus, CREATED, UPDATED, DUEDATE, RESOLUTIONDATE, VOTES, WATCHES, TIMEORIGINALESTIMATE, TIMEESTIMATE, TIMESPENT, WORKFLOW_ID, SECURITY, FIXFOR, COMPONENT, ARCHIVED, ARCHIVEDBY, ARCHIVEDDATE) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) (ERROR: value too long for type character varying(255))
      	at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:570)
      	at org.ofbiz.core.entity.GenericDAO.singleInsert(GenericDAO.java:202)
      	... 28 more
      Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(255)
      	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2468)
      	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:309)
      	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:446)
      	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:370)
      	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:149)
      	at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:124)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
      	at org.apache.commons.dbcp2.DelegatingPreparedStatement.executeUpdate(DelegatingPreparedStatement.java:98)
      	at com.atlassian.jira.ofbiz.sql.PreparedStatementWrapper.executeUpdate(PreparedStatementWrapper.java:47)
      	at com.atlassian.jira.diagnostic.connection.DiagnosticPreparedStatement.lambda$executeUpdate$7(DiagnosticPreparedStatement.java:69)
      	at  com.atlassian.diagnostics.internal.platform.monitor.db.DefaultDatabaseDiagnosticsCollector.recordExecutionTime(DefaultDatabaseDiagnosticsCollector.java:69)
      	at com.atlassian.jira.diagnostic.connection.DatabaseDiagnosticsCollectorDelegate.recordExecutionTime(DatabaseDiagnosticsCollectorDelegate.java:55)
      	at com.atlassian.jira.diagnostic.connection.DiagnosticPreparedStatement.executeUpdate(DiagnosticPreparedStatement.java:69)
      	at org.ofbiz.core.entity.jdbc.SQLProcessor.executeUpdate(SQLProcessor.java:562)
      	... 29 more
      

      Workaround

      Reduce the summary from the affected sub-tasks, ensuring that they do not exceed 255 characters after appending its summary to "CLONE - " or any defined prefix.

        1. image-2021-04-29-16-37-52-300.png
          193 kB
          Maciej Rzymski
        2. image-2021-04-29-16-39-06-589.png
          284 kB
          Maciej Rzymski
        3. image-2021-04-29-16-45-38-596.png
          253 kB
          Maciej Rzymski

              Unassigned Unassigned
              rrosa@atlassian.com Rodrigo Rosa
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: