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

When calling public API createAttachment with a MutableIssue not yet created, throws NPE

    XMLWordPrintable

Details

    • 5
    • Severity 3 - Minor
    • Hide
      Atlassian Update – 06 December 2017

      Hi everyone,

      We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, it's very low on our priority list, and will not be fixed in the foreseeable future. That's why we've decided to resolve it as Time Out.

      Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Jira team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details.

      We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication.
      Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments.
      Thank you,
      Ignat Alexeyenko
      Jira Bugmaster

      Show
      Atlassian Update – 06 December 2017 Hi everyone, We have recently reviewed this issue and the overall interest in the problem. As the issue hasn't collect votes, watchers, comments, or support cases from many customers during its lifetime, it's very low on our priority list, and will not be fixed in the foreseeable future. That's why we've decided to resolve it as Time Out . Although we're aware the issue is still important to those of you who were involved in the conversations around it, we want to be clear in managing your expectations. The Jira team is focusing on issues that have broad impact and high value, reflected by the number of comments, votes, support cases, and customers interested. Please consult the Atlassian Bugfix Policy for more details. We understand how disappointing this decision may be, but we hope you'll appreciate our transparent approach and communication. Atlassian will continue to watch this issue for further updates, so please feel free to share your thoughts in the comments. Thank you, Ignat Alexeyenko Jira Bugmaster

    Description

      The message creating API is not clear, but that is exacerbated significantly by a poorly caught NPE.

      If you call AttachmentManager.createAttachment(...) (and I suspect the same for the method on MessageHandlerContext.createAttachment(...) ) with a MutableIssue which has not yet been created, MutableIssue.getKey() is called and null is returned, but this value is not checked before being passed to the constructor of File(String, String). This throws an NPE and causes the misleading (and incorrect) error message:

      com.atlassian.jira.web.util.AttachmentException: Exception trying to establish attachment directory. Check that the application server and JIRA have permissions to write to it: java.lang.NullPointerException
      

      I am not sure if this should be a feature request or a bug, but due to the erroneous nature of the message and the poorly handled NPE I'd err on the side of bug (but very minor one).

      For details, see JSP-127687

      Attachments

        Activity

          People

            mlassau Mark Lassau (Inactive)
            05165c812422 Carl Myers
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: