JIRA password reset after Import

B_ Normann P_ Nielsen
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.
January 9, 2013

I am importing a customers JIRA on a 4.4 (Exported from a 4.4)

But I cant login no matter what afterwards. I am running:

Disable CROWD:

{code}

update cwd_directory set active=0 where id=2;

{code}

Reset password as in: https://confluence.atlassian.com/display/JIRA044/Retrieving+the+JIRA+Administrator:

{code}

update cwd_user set credential='uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==' where user_name='admin';

{code}

Reset Capcha

{code}

update cwd_user_attributes set attribute_value=0,lower_attribute_value=0 where user_id=10000 and (attribute_name='login.currentFailedCount' or attribute_name='login.totalFailedCount');

{code}

Eller

{code}

update cwd_user_attributes set attribute_value=0,lower_attribute_value=0 where user_id=10000;

{code}

I have used diffent versions of the last SQL.

Login just fails, there are nothing in the catalina.out and after 3 tries, Captcha is required...

I can see the cwd_user_attributes table being updated and JIRA is restartet after SQL's

4 answers

1 accepted

1 vote
Answer accepted
Thomas Peter Berntsen February 12, 2013

Hi Normann,

No DB hacking of the target JIRA instance should be necessary in order to achieve this, as long as you ensure that you replace the admin user's hashed password in the exported entities.xml file (inside the export zip file) before importing into the target JIRA instance.

Note: this solution only applies to scenarios involving an XML export.

Cheers,
Thomas

2 votes
Yilin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2013

You can try the following :

insert into cwd_user (id, user_name, lower_user_name, active, created_date, updated_date, first_name, lower_first_name, last_name, lower_last_name, display_name, lower_display_name, email_address, lower_email_address, directory_id, credential)
values (8888, 'admin','admin','1', '2011-07-06 00:00:00','2011-07-06 00:00:00','System','system','Administrator','admin','System Administrator','system admin','admin@crowd','admin@crowd',(select id from cwd_directory where directory_type='INTERNAL'),'{PKCS5S2}Z+3vUbE1FStQUuVWdnKkCmdpH8ebqvsJQYJG9fMoPm5A52fKDas7+nXYg3J15EzP');

insert into cwd_membership (id, parent_id, child_id, membership_type,group_type,parent_name,lower_parent_name,child_name, lower_child_name,directory_id)
values (7777, (select id from cwd_group where group_name = 'jira-administrators' and directory_id = 1), 8888, 'GROUP_USER', 'GROUP', 'jira-administrators','jira-administrators', 'admin', 'admin', (select id from cwd_directory where directory_type='INTERNAL'));

insert into cwd_membership (id, parent_id, child_id, membership_type,group_type,parent_name,lower_parent_name,child_name, lower_child_name,directory_id)
values (6666, (select id from cwd_group where group_name = 'jira-developers' and directory_id = 1), 8888, 'GROUP_USER', 'GROUP', 'jira-developers','jira-developers', 'admin', 'admin', (select id from cwd_directory where directory_type='INTERNAL'));

insert into cwd_membership (id, parent_id, child_id, membership_type,group_type,parent_name,lower_parent_name,child_name, lower_child_name,directory_id)
values (5555, (select id from cwd_group where group_name = 'jira-users' and directory_id = 1), 8888, 'GROUP_USER', 'GROUP', 'jira-users','jira-users', 'admin', 'admin', (select id from cwd_directory where directory_type='INTERNAL'));

update schemepermissions set perm_parameter='jira-administrators' where permission=44;

After restart JIRA, you should be able to logon as login/password : admin/admin.

:)

B_ Normann P_ Nielsen
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.
January 10, 2013

Did not work, are You sure that JIRA 4.4 supports the "'{PKCS5S2}Z+3vUbE1FStQUuVWdnKkCmdpH8ebqvsJQYJG9fMoPm5A52fKDas7+nXYg3J15EzP'" string?

B_ Normann P_ Nielsen
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.
January 10, 2013

update cwd_user set credential='uQieO/1CGMUIXXftw3ynrsaYLShI+GTcPS4LdUGWbIusFvHPfUzD7CZvms6yMMvA8I7FViHVEqr6Mj4pCLKAFQ==' where user_name='admin';

Did not change anything

0 votes
Yilin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 10, 2013

100% sure JIRA 4.4 support this, and I use this cross DB type to initial JIRA instance.

May be you should fire a support ticket for this :)

B_ Normann P_ Nielsen
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.
January 10, 2013

Well, the system is not under support :-/

0 votes
JohnA
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.
January 9, 2013

Hi Normann,

One thing that comes to mind is that the directories might not be in the correct order, although it doesn't seem to document it in the JIRA docs like it does in the Confluence docs so maybe you could try running the queries in the Confluence docs and see whether this works for you: https://confluence.atlassian.com/display/DOC/Restoring+Passwords+To+Recover+Admin+User+Rights#RestoringPasswordsToRecoverAdminUserRights-Step3.PuttheInternalDirectoryinFirstPosition

All the best,
John

B_ Normann P_ Nielsen
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.
January 9, 2013

Thanks for the input, everything is apprciated, but I do think it should be ok:

jira_44=# select id,directory_name,active from cwd_directory;
 id |     directory_name      | active 
----+-------------------------+--------
  1 | JIRA Internal Directory |      1
  2 | Remote Crowd Directory  |      0
(2 rows)

jira_44=#

JohnA
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.
January 9, 2013

That does indeed look correct Normann. One thing that sometimes causes this can be the browser caches, so I'd suggest you also try clearing those, (or just changing browsers), and see whether you can login after that. Strange as it seems, sometimes it does actually work.

B_ Normann P_ Nielsen
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.
January 9, 2013

No luck either; FF, Safari, Chrome.... Postgres restart, jira restart...

Zul NS _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 9, 2013

update cwd_directory set directory_position=0 where ID=1 ? Not sure if this still require when CROWD is already inactive though

B_ Normann P_ Nielsen
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.
January 10, 2013

Tried to switch positions, made no difference - But thanks anyway :-)

Suggest an answer

Log in or Sign up to answer