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

Confluence User List throws NullPointerException

Kathy Taylor November 29, 2018

One of our smaller Confluence servers is throwing these issues when trying to access the User list as admin.  It is running 6.12.2 and is using Postgresql 9.6.  

https://confluence.atlassian.com/confkb/confluence-triggers-npe-when-a-user-tries-to-open-view-all-users-802597745.html?utm_medium=logScan&utm_source=STP

and

https://confluence.atlassian.com/confkb/user-list-throws-nullpointerexception-879799322.html?utm_medium=logScan&utm_source=STP

Following the resolution in the second article and running the query, I find that I have 6 offending users in the database.  

If I try to do the INSERT INTO commands at the end of the article, it works for one, but this article is written from the perspective of 1 user offending.   I have no idea what values to use for user_mapping values when you are looking at multiple users.  Does anyone know what the best way to approach this is?  Thanks.

INSERT INTO user_mapping values ('2c9681954172cf560000000000000001', 'dummyuser01', 'dummyuser01');
INSERT INTO content ("contentid", "contenttype", "version", "content_status", "username") VALUES (9999999, 'USERINFO', 1, 'current', '2c9681954172cf560000000000000001')

 

1 answer

1 accepted

0 votes
Answer accepted
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 29, 2018

Hi Kathy,

For multiple users you're going to want to do separate inserts. As indicated in the article you're going to want to swap out dummyuser01 with the actual offending username. Both statements have unique keys (that long string) that will need to be updated too.

So for your first insert, you'll do what you've got already (swapping out dummyuser01)

INSERT INTO user_mapping values ('2c9681954172cf560000000000000001', 'dummyuser01', 'dummyuser01');
INSERT INTO content ("contentid", "contenttype", "version", "content_status", "username") VALUES (9999999, 'USERINFO', 1, 'current', '2c9681954172cf560000000000000001')

But then the next insert you'll need to swap out dummyuser02 and the unique key. I've incremented the key for you in this statement to show what it would be like:

INSERT INTO user_mapping values ('2c9681954172cf560000000000000002', 'dummyuser02', 'dummyuser02');
INSERT INTO content ("contentid", "contenttype", "version", "content_status", "username") VALUES (9999999, 'USERINFO', 1, 'current', '2c9681954172cf560000000000000002')

For the remaining users, the unique key just needs to be incremented. The second one would be ....02, then the third ...03, etc: 

2c9681954172cf560000000000000002

 Let me know if you've got more questions!

Cheers,
Daniel | Atlassian Support

Kathy Taylor November 29, 2018

Thank you Daniel.  I'll give that a go.  I wasn't sure if I could just increment it like you show here.  I'll try it out and see if it resolves my problem.  Will report back.

Kathy

Kathy Taylor November 29, 2018

Actually, I do have another question about the second insert into statement.  I'm assuming that the "username" in that insert is just verbatim as "username".  You are not substituting the name of your offending user for that field?  You only substitute the dummy username in the first insert with your own user.

 

INSERT INTO content ("contentid", "contenttype", "version", "content_status", "username") VALUES (9999999, 'USERINFO', 1, 'current', '2c9681954172cf560000000000000002')  
Kathy Taylor November 29, 2018

Hi Daniel --

The first insert works fine.  But the second one is giving me a duplicate key error.  As though the content id 9999999 needs to be incremented as well.  

confluence=# INSERT INTO content ("contentid", "contenttype", "version", "content_status", "username") VALUES (9999999, 'USERINFO', 1, 'current', '2c9681954172cf560000000000000002');
ERROR: duplicate key value violates unique constraint "content_pkey"
DETAIL: Key (contentid)=(9999999) already exists.

Kathy

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 30, 2018

Ah - you are 100% correct @Kathy Taylor and good catch. That integer is the key for the other table you're inserting into and does need to be incremented as well.

Like Kathy Taylor likes this
Kathy Taylor November 30, 2018

Thanks, Daniel.  I'll try doing that then.

Kathy Taylor November 30, 2018

@Daniel Eads Thanks for the help with this.   I ended up nuking the secondary user directory that was causing the issues and the database is clean now.  I will recreate the user directory next week and see how it goes.  But incrementing both the contentid and user_key values worked fine.  

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events