IncorrectResultSizeDataAccessException when logging in

When trying to login to Confluence with our admin account the following error is displayed:

Cause

org.springframework.dao.IncorrectResultSizeDataAccessException: query did not return a unique result: 2
    at org.springframework.orm.hibernate.SessionFactoryUtils.convertHibernateAccessException(SessionFactoryUtils.java:590)

 

I have checked the cwd_users table and there are no duplicate usernames.

What else might I need to check to identify the root cause of this issue?

1 answer

1 vote

Hello,

In order to resolve this issue, there are two suggested resolutions from this page:

User login renders 'query did not return a unique result' error

Give both of those suggestions a try and let us know how it goes. You can try resolution #1 first, and if that does not work, try #2, searching the cwd_user table for the specific username that is having the problem.

Let us know if you have any trouble or if the solutions do not correct your issue.

Kind Regards,
Shannon

Hi @Shannon Spaniol!

I had seen that article aready, but as I stated above our cwd_users table does not contain any duplicate usernames.

I cannot try resolution #1 as we only have one administrative user, and that's the one that cannot login.

I cannot try resolution #2 as there are no duplicated usernames in the cwd_table to delete.

Do you have any other suggestions?

Hi there,

So this means that the duplicate row is in another table. For example, user_mapping could have a duplicate.

My recommendation to you would be to turn on SQL Logging and then you will be able to see which SQL statement is causing the error.

Let us know how it goes or if you have any follow-up questions.

Kind Regards,
Shannon

Thanks @Shannon Spaniol!

With SQL Logging enabled I was able to indentify that this query was returning two rows:

SELECT
confluence0_.user_key as user_key,
confluence0_.username as username,
confluence0_.lower_username as lower_us3_
FROM
user_mapping confluence0_
WHERE
(confluence0_.lower_username='interconnekt');

I edited the values of username and lower_username on one of the rows, and the issue was resolved.

I'm happy to hear the SQL logging was able to help you resolve your issue!

Take care and Kind Regards,
Shannon

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Tuesday in Confluence

We want to see the templates you've created in Confluence!

Hi Community, Jessica here from the Confluence Product Marketing team!  July’s community challenge is all about sharing pictures  — and as an extension of our first post on what ...

478 views 19 9
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you