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

Incoming mail servers throw 500 error if two Mail Servers configured with the same name

    XMLWordPrintable

Details

    Description

      Summary

      Trying to edit or add a new Mail server throws a 500 error

      Environment

      This Affects JIRA Cloud only as only in Cloud will the default Mail server be put back after a restart of JIRA.

      Steps to Reproduce

      1. As a JIRA Admin, go to Incoming Mail.
      2. Delete the default 'Pop Mail Server'
      3. Add a new mail server with the same name 'POP Mail Server'
      4. The next time JIRA restarts JIRA Cloud will put the default mail server back
      5. Now there are two mail servers with the same name
      6. Try to update the mail server you added in step 3. Either by saving it, or by Testing the connection

      Expected Results

      The save or connection test is successful

      Actual Results

      The below exception is thrown in the Browser as well in the default JIRA log.

      com.atlassian.cache.CacheException: java.lang.IllegalArgumentException: Passed List had more than one value.
      	at com.atlassian.cache.memory.DelegatingCache$DelegatingLoadingCache.get(DelegatingCache.java:306)
      	at com.atlassian.mail.server.managers.OFBizMailServerManager$CacheHolder.getMailServer(OFBizMailServerManager.java:440)
      	at com.atlassian.mail.server.managers.OFBizMailServerManager.getMailServer(OFBizMailServerManager.java:96)
      	at com.atlassian.jira.plugins.mail.webwork.MailServerActionSupport.doValidation(MailServerActionSupport.java:236)
      	at com.atlassian.jira.plugins.mail.webwork.VerifyPopServerConnection.doUpdate(VerifyPopServerConnection.java:72)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:483)
      	at webwork.util.InjectionUtils$DefaultInjectionImpl.invoke(InjectionUtils.java:70)
      	at webwork.util.InjectionUtils.invoke(InjectionUtils.java:56)
      	at webwork.action.ActionSupport.invokeCommand(ActionSupport.java:438)
      	at webwork.action.ActionSupport.execute(ActionSupport.java:157)
      	at com.atlassian.jira.action.JiraActionSupport.execute(JiraActionSupport.java:88)
      ...
      Caused by: java.lang.IllegalArgumentException: Passed List had more than one value.
      	at org.ofbiz.core.entity.EntityUtil.getOnly(EntityUtil.java:62)
      	at com.atlassian.mail.server.managers.OFBizMailServerManager$MailServerCacheLoader.load(OFBizMailServerManager.java:394)
      	at com.atlassian.mail.server.managers.OFBizMailServerManager$MailServerCacheLoader.load(OFBizMailServerManager.java:386)
      	at com.atlassian.cache.memory.MemoryCacheManager$3$1.load(MemoryCacheManager.java:130)
      	at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3573)
      	at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2350)
      

      Workaround

      Rename your custom Mail server to something else.

      Attachments

        Activity

          People

            Unassigned Unassigned
            imaduro Ivan Maduro (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: