I can't add user to global permission. When i try add user,It retuns "query did not return a unique"
Asked by G?khan ??pl?o?lu:

Hi,

I want to grant permissions for any user. But bambo says "query did not return a unique result:". I looked "EXTERNAL_ENTITIES" from database, users is unique in this table.

How can i solve this problem? Thank you.

Bamboo version 5.10.3

![Captureerror.PNG](/t5/image/serverpage/image-id/13202iDA9375FD193B051F/image-size/large?v=v2&px=999 "Captureerror.PNG")

logs:

query did not return a unique result:

org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 23; nested exception is org.hibernate.NonUniqueResultException: query did not return a unique result: 23  
at org.springframework.orm.hibernate3.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:674)  
at org.springframework.orm.hibernate3.HibernateAccessor.convertHibernateAccessException(HibernateAccessor.java:414)  
at org.springframework.orm.hibernate3.HibernateTemplate.doExecute(HibernateTemplate.java:416)  
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:341)  
at com.atlassian.bamboo.security.acegi.acls.AclHibernateDao.findAcl(AclHibernateDao.java:86)  
at sun.reflect.GeneratedMethodAccessor2524.invoke(Unknown Source)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)  
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)  
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)  
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)  
at com.sun.proxy.$Proxy30.findAcl(Unknown Source)  
at com.atlassian.bamboo.security.acegi.acls.HibernateMutableAclServiceImpl.readMutableAclById(HibernateMutableAclServiceImpl.java:212)  
at sun.reflect.GeneratedMethodAccessor2523.invoke(Unknown Source)  
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)  
at java.lang.reflect.Method.invoke(Method.java:498)  
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)  
at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:98)  
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:262)  
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:95)  
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)  
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:207)  
at com.sun.proxy.$Proxy31.readMutableAclById(Unknown Source)


Answers:
author: Alexey Chystoprudov
body: There should be unique records in acl_object_identity table.

Try to run script to see if some records have the same value on object_id_identity

```
select object_id_class, object_id_identity, count(id) 
from acl_object_identity group by object_id_class, object_id_identity 
having count(id) > 1;
```

In case it returns some records, you should fix DB content to have result of this query empty

comments: author: G?khan ??pl?o?lu
body: Thanks, it works!


Tags: user-management