When trying to create a Service Desk project, the error message shown:
On the log:
@4000000057a9752608ec7e14 2016-08-09 01:15:56,135 http-nio-3009-exec-55 ERROR sysadmin 75x13836x1 1n2t2cu 220.127.116.11 /rest/project-templates/1.0/templates [c.a.j.project.ProjectCreateRegistrarImpl.privacy-safe] The handler with id com.atlassian.jira.project-templates-plugin:apply-project-template-handler threw an exception while handling a notification about a project being created
@4000000057a9752608ec89cc com.querydsl.core.QueryException: Caught PSQLException for delete from "public"."AO_54307E_GROUP" where "AO_54307E_GROUP"."VIEWPORT_ID" = ?
@4000000057a9752608ed7044 at com.querydsl.sql.DefaultSQLExceptionTranslator.translate(DefaultSQLExceptionTranslator.java:50)
@4000000057a9752608ed7044 at com.querydsl.sql.Configuration.translate(Configuration.java:453)
@4000000057a9752608ed742c at com.querydsl.sql.dml.SQLDeleteClause.execute(SQLDeleteClause.java:209)
@4000000057a9752608f18ef4 Caused by: org.postgresql.util.PSQLException: ERROR: update or delete on table "AO_54307E_GROUP" violates foreign key constraint "fk_ao_54307e_grouptorequesttype_group_id" on table "AO_54307E_GROUPTOREQUESTTYPE"
@4000000057a9752608f192dc Detail: Key (ID)=(1) is still referenced from table "AO_54307E_GROUPTOREQUESTTYPE".
A customer portal with that project key was created before. A JIRA Service Desk project is deleted after deactivation of JIRA Service Desk will not delete the customer portal from the database.
JSD-4147Getting issue details...
Check the customer portal contains this project name with the following query:
select * from "AO_54307E_VIEWPORT" where "KEY" like '%project_name%';
It is not recommended to remove the existing customer portal from the database because the table is linked to other tables. If we removed the existing customer portal manually, it could cause inconsistency between the tables.
Use a different case order as it is case sensitive.
For example, 'desk' was used by existing customer portal, you could name your new SD project name as 'DESK' or 'Desk'.