Cannot delete or edit OAuth2 SMTP Mail Server when underlying Application Link is deleted

XMLWordPrintable

    • 5
    • Severity 3 - Minor
    • 10

      Issue Summary

      Cannot delete or edit oAuth2 SMTP Mail Server when underlying Application Link is deleted.

      Steps to Reproduce

      1. Install Confluence
      2. Setup an outgoing Application Link with oAuth2 to Gmail 
      3. Setup a SMTP Mail server using oAuth2 - Authorize and Save
      4. Send a test email to make sure SMTP server is working with the oAuth2 credentials
      5. Delete the outgoing Application Link
      6. Create a new outgoing Application Link with oAuth2 to Gmail
      7. Attempt to edit or delete the oAuth2 SMTP Mail Server

      Expected Results

      1. Editing the oAuth2 SMTP Mail Server and Auth’ing against the new oAuth2 app link should save the new token
      2. Alternatively, deleting the entire oAuth2 SMTP Mail Server should delete the Mail Server entry

      Actual Results

      1. Editing the oAuth2 SMTP Mail Server with the new oAuth2 app link authorizes with the new App Link
        • However, once saved and re-editing the oAuth2 SMTP Mail Server still shows as Unknown (meaning it didn’t save the new token)
      2. Deleting the oAuth2 SMTP Mail Server fails to delete the entry
        • The backend atlassian-confluence.log doesn’t show an error for the delete but upon loading the Mail Server page, it will show the following error:
          2026-09-14 14:29:47,856 WARN [https-jsse-nio2-8443-exec-16 url: /c10213/rest/troubleshooting/1.0/check/admin; user: admin] [confluence.impl.hibernate.ConfluenceHibernateTransactionManager] doRollback Performing rollback. Transactions:\n ->[PluginReadWriteTx]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT (Session #420974217) -- url: /c10213/rest/troubleshooting/1.0/check/admin | userName: admin | referer: https://******.au:8443/c10213/admin/mail/viewmailservers.action | traceId: 84e5bf921ecd01dd 2026-09-14 14:29:47,859 ERROR [https-jsse-nio2-8443-exec-16 url: /c10213/rest/troubleshooting/1.0/check/admin; user: admin] [v2.api.model.ExceptionConverter] convertServiceException No status code found for exception, converting to internal server error. Log referral number: 73e83643-c025-45d4-af93-6cfd11dae588 -- url: /c10213/rest/troubleshooting/1.0/check/admin | userName: admin | referer: https://*****.au:8443/c10213/admin/mail/viewmailservers.action | traceId: 84e5bf921ecd01dd org.springframework.transaction.UnexpectedRollbackException: Transaction rolled back because it has been marked as rollback-only at org.springframework.transaction.support.AbstractPlatformTransactionManager.processRollback(AbstractPlatformTransactionManager.java:938) at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:754) at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:152) at com.atlassian.sal.spring.component.SpringHostContextAccessor.doInTransaction(SpringHostContextAccessor.java:70) at com.atlassian.sal.core.transaction.HostContextTransactionTemplate.execute(HostContextTransactionTemplate.java:18) .. at com.atlassian.activeobjects.internal.SalTransactionManager.inTransaction(SalTransactionManager.java:45) at com.atlassian.activeobjects.internal.AbstractLoggingTransactionManager.doInTransaction(AbstractLoggingTransactionManager.java:27) at com.atlassian.activeobjects.internal.EntityManagedActiveObjects.executeInTransaction(EntityManagedActiveObjects.java:227) at com.atlassian.activeobjects.osgi.ActiveObjectsDelegate.executeInTransaction(ActiveObjectsDelegate.java:327) .. at com.atlassian.activeobjects.tx.TransactionalProxy.executeInTransaction(TransactionalProxy.java:45) at com.atlassian.activeobjects.tx.TransactionalProxy.invokeInTransaction(TransactionalProxy.java:38) at com.atlassian.activeobjects.tx.TransactionalProxy.invoke(TransactionalProxy.java:30) at jdk.proxy221/jdk.proxy221.$Proxy3239.getStatusesForUserNotifications(Unknown Source) at com.atlassian.troubleshooting.healthcheck.rest.HealthCheckResource.getStatusesForUser(HealthCheckResource.java:101) .. 
        • Similarly, the backend atlassian-confluence-outgoing.log shows on the Load Mail Server screen:
          2026-09-14 14:29:47,843 WARN [https-jsse-nio2-8443-exec-16 url: /c10213/rest/troubleshooting/1.0/check/admin; user: admin] [atlassian.confluence.mail.ConfluenceMailServerManager] setAuthContextIfNeeded Failed to get oAuth configuration for mail server SMTP Server. Enable debug logging for full trace. Cause: Token {0d2cb6eb-8732-4b74-840b-5c2ff322d75b} does not exist -- url: /c10213/rest/troubleshooting/1.0/check/admin | userName: admin | referer: https://******..au:8443/c10213/admin/mail/viewmailservers.action | traceId: 84e5bf921ecd01dd  

      Workaround

      Manually delete the Mail Server entry directly from the database:

      1. Shutdown Confluence
      2. Backup the Confluence database
      3. Check the rows to be deleted and then delete:
      select * FROM PLUGIN_SETTING where NAMESPACE = 'com.atlassian.mail.server.MailServer'; 
      delete from PLUGIN_SETTING where NAMESPACE = 'com.atlassian.mail.server.MailServer'; 

              Assignee:
              Unassigned
              Reporter:
              Disha Rathore
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: