Unable to create new email channel due to connection duplication error
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Problem
When trying to setup email channel, we get the error "Unable to create new email channel due to connection duplication. Provided mail connection definition is currently used in another mail channel"
Diagnosis
Run the following queries:
select * from AO_2C4E5C_MAILCHANNEL where MAIL_CHANNEL_KEY = (select MAIL_CHANNEL_KEY from AO_54307E_EMAILCHANNELSETTING where EMAIL_ADDRESS = 'Email address you are trying to add as channel');
If this doesn't give any results, then run the following queries:
select * from "AO_54307E_EMAILCHANNELSETTING";
select * from "AO_2C4E5C_MAILCONNECTION";
select * from "AO_2C4E5C_MAILCHANNEL";
select * from "AO_2C4E5C_MAILHANDLER";
Where you will notice, the email is not in AO_54307E_EMAILCHANNELSETTING, however, it is included in the other tables.
Cause
You have data for that email address in other tables in the database, however, is missing from the AO_54307E_EMAILCHANNELSETTING, hence not showing in the UI and causing the duplication error.
Resolution
Always back up your data before performing any modifications to the database. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
- Shutdown JIRA
- Take a backup of the instance
- Delete the entries with regards to the above email from tables AO_2C4E5C_MAILCONNECTION, AO_2C4E5C_MAILCHANNEL, AO_2C4E5C_MAILHANDLER
- Start JIRA
- Re-create the email channel in the UI