-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
4.8.11
-
None
-
Severity 3 - Minor
-
0
-
Issue Summary
The Crucible project creation page currently allows duplicate projects to be created with the same Project Name and Project Key when attempted for the first time. However, once the duplicate project is created in the database, subsequent attempts to create duplicate projects with the same Project Name and Project Key are blocked, and it is clearly indicated that the project being created is a duplicate.
Steps to Reproduce
- Navigate to Gear Settings > Project Settings > Projects.
- Create a project by providing a unique Project name and Project Key. When saving, ensure that you click the Save button more than once.
- Due to a bug, Multiple Duplicate Projects may be created and listed on the Crucible projects UI.
- If you attempt to delete one of the duplicate projects, an error is thrown as below
Please note that the error occurs specifically when trying to delete one of the duplicate projects.
Your request was unable to be processed
javax.servlet.ServletException - javax.servlet.ServletException: org.hibernate.NonUniqueResultException: query did not return a unique result: 2
Expected Results
Even if you accidentally double-click while saving, only one project should be created with the same Project name and project key.
Actual Results
The number of duplicate projects created and listed on the UI depends on how many times the Save button is pressed during the project saving process.
The below exception is thrown in the atlassian-fisheye.log file:
2023-06-26 08:50:41,185 ERROR [qtp2031951755-339 url: /admin/deleteProject.do; user: DSAM ] fisheye TotalityFilter-logExceptionDetails - Exception "org.hibernate.NonUniqueResultException: query did not return a unique result: 2" (javax.servlet.ServletException) while processing "/admin/deleteProject.do" (Referer:"http://10.224.216.44:8060/admin/listProjects.do") javax.servlet.ServletException: org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:285) [webwork-2.2.7-atlassian-37.jar:?] at com.opensymphony.webwork.dispatcher.ServletDispatcher.service(ServletDispatcher.java:111) [webwork-2.2.7-atlassian-37.jar:?] at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api-3.1.0.jar:3.1.0] at org.eclipse.jetty.servlet.ServletHolder$NotAsync.service(ServletHolder.java:1459) [jetty-servlet-9.4.44.v20210927.jar:9.4.44.v20210927] at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:799) [jetty-servlet-9.4.44.v20210927.jar:9.4.44.v20210927] at org.eclipse.jetty.servlet.ServletHandler$ChainEnd.doFilter(ServletHandler.java:1631) [jetty-servlet-9.4.44.v20210927.jar:9.4.44.v20210927] at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:39) [atlassian-plugins-servlet-4.4.18.jar:?] at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) [atlassian-plugins-servlet-4.4.18.jar:?] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [?:?] at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) [atlassian-plugins-servlet-4.4.18.jar:?] at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) [atlassian-plugins-servlet-4.4.18.jar:?] at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) [atlassian-plugins-servlet-4.4.18.jar:?] at com.atlassian.applinks.core.rest.context.ContextFilter.doFilter(ContextFilter.java:24) [?:?] at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter.doFilter(DelegatingPluginFilter.java:64) [atlassian-plugins-servlet-4.4.18.jar:?] at com.atlassian.plugin.servlet.filter.IteratingFilterChain.doFilter(IteratingFilterChain.java:37) [atlassian-plugins-servlet-4.4.18.jar:?] at com.atlassian.plugin.servlet.filter.DelegatingPluginFilter$1.doFilter(DelegatingPluginFilter.java:58) [atlassian-plugins-servlet-4.4.18.jar:?] ..... at java.lang.Thread.run(Thread.java:750) [?:1.8.0_332] Caused by: org.hibernate.NonUniqueResultException: query did not return a unique result: 2 at org.hibernate.internal.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:918) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at org.hibernate.internal.CriteriaImpl.uniqueResult(CriteriaImpl.java:396) [hibernate-core-4.2.13.Final.jar:4.2.13.Final] at com.cenqua.crucible.model.dao.HibernateProjectDAO.getByKey(HibernateProjectDAO.java:71) [fisheye.jar:?] at com.cenqua.crucible.model.managers.impl.DefaultProjectManager.deleteProjectByKey(DefaultProjectManager.java:297) [fisheye.jar:?] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [?:1.8.0_332] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [?:1.8.0_332] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [?:1.8.0_332] at com.opensymphony.xwork.interceptor.AroundInterceptor.intercept(AroundInterceptor.java:31) [xwork-1.2.5-atlassian-8.jar:?] at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) [xwork-1.2.5-atlassian-8.jar:?] at com.cenqua.fisheye.web.admin.interceptors.LoginInterceptor.intercept(LoginInterceptor.java:54) [fisheye.jar:?] at com.opensymphony.xwork.DefaultActionInvocation.invoke(DefaultActionInvocation.java:190) [xwork-1.2.5-atlassian-8.jar:?] at com.opensymphony.xwork.DefaultActionProxy.execute(DefaultActionProxy.java:116) [xwork-1.2.5-atlassian-8.jar:?] at com.opensymphony.webwork.dispatcher.DispatcherUtils.serviceAction(DispatcherUtils.java:274) [webwork-2.2.7-atlassian-37.jar:?] ... 163 more
Workaround
- Edit the existing duplicate project and rename it to a unique name.
- After renaming, delete the project from the user interface (UI).
This process will ensure that the duplicate project is identified and removed from the system.