Uploaded image for project: 'Jira Cloud'
  1. Jira Cloud
  2. JRACLOUD-69501

Duplicate tickets created from email when 'CC Watcher' is selected and the incoming email has in CC an email address that belongs to JSD portal-only customers which have user_key longer than 60 characters

    XMLWordPrintable

Details

    Description

      Summary

      Duplicate tickets are created when the CC Watchers checkbox is selected in the email handler configuration and an incoming email with an email address address that belongs to JSD portal-only customers that have user_key longer than 60 characters.

      What happens is the following:

      • JIRA starts processing the email and creates a new issue from it
      • The email handler tries to add the email addresses in CC to the issue watchers
      • One (or more) of the email addresses in CC have user_key longer than 60 characters
      • Adding the watcher fails, the email is not set as processed and at the next run the handler will try to process it again starting back from step #1

      Steps to Reproduce

      1. Have incoming mail handler set to automatically add each user in CC as a watcher (by selecting the CC Watchers checkbox)
      2. Send an email which has in Cc a JSD portal-only customer email address (with an username randomly generated of 60+ characters)
        The bug can't be reproduced with "normal" users with usernames more than 60 characters as these accounts have still user_key less than 60 char. They are still managed and added as watchers without issues, the JSD portal-only customer updated to randomly generated usernames have their user_key longer than 60 char.

      Expected Result

      One ticket is created from the incoming email

      Actual Result

      Jira keeps creating new tickets from the same email.

      The below Stack trace is found in the logs:

      2018-04-06 16:02:50.252	
      ERROR	
      APITeam[10100]: Exception: Caught PSQLException for insert into "public"."userassociation" ("association_type", "source_name", "sink_node_entity", "sink_node_id") values (?, ?, ?, ?)
      Caught PSQLException for insert into "public"."userassociation" ("association_type", "source_name", "sink_node_entity", "sink_node_id") values (?, ?, ?, ?)
      
      Caused by: org.postgresql.util.PSQLException: ERROR: value too long for type character varying(60) at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2477) at 
      org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2190) at 
      org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:300) at
       org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:428) at 
      org.postgresql.jdbc.PgStatement.execute(PgStatement.java:354) at 
      org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:169) at 
      org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:136) at sun.reflect.GeneratedMethodAccessor422.invoke(Unknown 
      Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at 
      org.vibur.dbcp.proxy.AbstractInvocationHandler.targetInvoke(AbstractInvocationHandler.java:145) at 
      org.vibur.dbcp.proxy.StatementInvocationHandler.doProcessExecute(StatementInvocationHandler.java:204) at 
      org.vibur.dbcp.proxy.StatementInvocationHandler.on(StatementInvocationHandler.java:195) at 
      com.atlassian.jira.connpool.JiraViburConnectionPoolProvider.lambda$null$5(JiraViburConnectionPoolProvider.java:145) at 
      org.vibur.dbcp.proxy.StatementInvocationHandler.processExecute(StatementInvocationHandler.java:137) at 
      org.vibur.dbcp.proxy.StatementInvocationHandler.restrictedInvoke(StatementInvocationHandler.java:91) at 
      org.vibur.dbcp.proxy.StatementInvocationHandler.restrictedInvoke(StatementInvocationHandler.java:41) at 
      org.vibur.dbcp.proxy.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:81) at com.sun.proxy.$Proxy4994.executeUpdate(Unknown Source) at 
      com.querydsl.sql.dml.AbstractSQLInsertClause.execute(AbstractSQLInsertClause.java:414) ... 39 more
      

      Workaround

      De-select the CC Watchers check box in the email handler configuration

      Attachments

        Issue Links

          Activity

            People

              thunguyen Thuan Nguyen
              rsaputra Adven
              Votes:
              0 Vote for this issue
              Watchers:
              14 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: