Jira Service Management Mail Handler error "invalid byte sequence for encoding "UTF8": 0x00" prevents issue creation by email when Postgres database is used

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Medium
    • 5.11.0
    • Affects Version/s: 4.13.0, 4.19.1
    • Component/s: Email - Incoming
    • None
    • 5
    • Severity 2 - Major
    • 0

      Issue Summary

      When JIRA Service Management mail handler tries to insert in the database an email that contains the character 0x00 NUL, the issue will not be created and the following error is thrown:

      2021-10-20 14:15:28,664+0000 Caesium-1-4 ERROR server@smtp.domain.com     [c.a.j.bc.issue.DefaultIssueService] Error creating issue: 
      com.atlassian.jira.exception.CreateException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,Good news][watches,0][creator,JIRAUSER10000][created,2021-10-20 14:15:28.655][timespent,null][timeoriginalestimate,null][project,10001][description,| ...
      (ERROR: invalid byte sequence for encoding "UTF8": 0x00))
          at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:586)
          at com.atlassian.jira.issue.managers.DefaultIssueManager.createIssue(DefaultIssueManager.java:487)
      [..]
      
      Caused by: com.atlassian.jira.exception.DataAccessException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,Good news][watches,0][creator,JIRAUSER10000][created,2021-10-20 14:15:28.655][timespent,null][timeoriginalestimate,null][project,10001][description,|...

      Steps to Reproduce

      1. Create a JIRA Service Management mail handler
      2. Send an email with the character NUL (0x00) as part of the subject

      Expected Results

      JIRA corrects the NUL character unsupported by Postgres and creates the issue successfully

      Actual Results

      JIRA fails to create the issue and the below exception is thrown in the atlassian-jira.log file:

      2021-10-20 14:15:28,664+0000 Caesium-1-4 ERROR server@smtp.domain.com     [c.a.j.bc.issue.DefaultIssueService] Error creating issue: 
      com.atlassian.jira.exception.CreateException: org.ofbiz.core.entity.GenericEntityException: while inserting: [GenericEntity:Issue][summary,Good news][watches,0][creator,JIRAUSER10000][created,2021-10-20 14:15:28.655][timespent,null][timeoriginalestimate,null][project,10001][description,| ...
      (ERROR: invalid byte sequence for encoding "UTF8": 0x00)) 

      Workaround

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

            Assignee:
            Mingyi Yang
            Reporter:
            Violeta Fulger (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: