Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

ERROR: duplicate key value violates unique constraint "unq_lwr_username"

FreeSoftwareServers May 10, 2020

I can't import my confluence xml export due the the following errors:

 

postgres_confluence | 2020-05-11 03:46:57.299 UTC [318] ERROR: duplicate key value violates unique constraint "unq_lwr_username"
postgres_confluence | 2020-05-11 03:46:57.299 UTC [318] DETAIL: Key (lower_username)=() already exists.
postgres_confluence | 2020-05-11 03:46:57.299 UTC [318] STATEMENT: insert into user_mapping (username, lower_username, user_key) values ($1, $2, $3)
postgres_confluence | 2020-05-11 03:46:57.300 UTC [318] ERROR: current transaction is aborted, commands ignored until end of transaction block
postgres_confluence | 2020-05-11 03:46:57.300 UTC [318] STATEMENT: select 1

I have tried updating to v7 release and I still get the error. I found a bug report with a workaround, but I can't find any of the classes in my entities.xml. The bug-reporter is using cloud verison where I use the server version, perhaps that is why?> Can anybody help me workaround this issue, I have been struggling for days to fix it to no avail.

 

https://jira.atlassian.com/browse/CONFCLOUD-58486

 

"Workaround" says to find

<object class="HibernateMembership" package="com.atlassian.crowd.embedded.hibernate2">

But of course, that doesn't exist in my export, but I get the same error.

2 answers

1 accepted

0 votes
Answer accepted
FreeSoftwareServers May 11, 2020

I was able to get past this by basically deleting all users, clearing almost everything from  `user_mapping` manually via sql and using the "recovery_admin" user to export/import and create a new user. Simple right?

Ran into this issue, but same resolution (I think?)

https://community.atlassian.com/t5/Confluence-questions/ERROR-null-value-in-column-quot-user-id-quot-violates-not-null/qaq-p/1375611

 

0 votes
Ismael Jimoh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
May 10, 2020

Hi @FreeSoftwareServers 

It seems you have a user with the same lower user name as one that currently exists in your backup file.

This means you may need to first verify this conflict and resolve it before proceeding any further.

  1. Check for users with a similar username or the username is similar when you switch  to lower case version of the username.
  2. Either rename these users if you consider them as separate users or fix the username to be the exact same (possible one has block or mixed case while the other has all lowercase).
  3. once fixed, generate a new confluence back up and attempt reimport.

 

Let us know how this goes.

FreeSoftwareServers May 10, 2020

Sorry, not that simple as I have done lots of troubleshooting. I have only two users and I am importing into a brand new setup with only one user which is a different username. This is related to the XML export bug I linked which said I had to move the declarations around in entities.xml somehow, but I can't figure out how.

FreeSoftwareServers May 10, 2020

Literally 100% new Database + Confluence setup w/ Empty site and username of "admin" just to get "into" confluence, then I go into "restore" and select my XML backup and get the error above.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events