Cannot log in after Confluence upgrade to 5.7.1
Asked by John McGehee:

I allowed the Confluence installer to perform the upgrade from 4.1.7. After the upgrade, I cannot log in to Confluence. I get the error:
> The following error(s) occurred:
>
> * Sorry, an error occurred trying to log you in. Please try again.

So I have lost control of my Confluence instance.

I tried the [Restoring Passwords](https://confluence.atlassian.com/display/DOC/Restoring+Passwords+To+Recover+Admin+User+Rights) procedure, but this gets nowhere because cwd_user does not exist:
> postgres=# select [u.id](http://u.id), u.user_name, u.active from cwd_user u  
> postgres-# join cwd_membership m on [u.id](http://u.id)=m.child_user_id join cwd_group g on m.parent_id=[g.id](http://g.id) join cwd_directory d on [d.id](http://d.id)=g.directory_id  
> postgres-# where g.group_name = 'confluence-administrators' and d.directory_name='Confluence Internal Directory';  
> **ERROR: relation "cwd_user" does not exist**   
> LINE 1: select [u.id](http://u.id), u.user_name, u.active from cwd_user u  
> \^  
> postgres=# 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 (1212121, 'admin', 'admin', 'T', '2009-11-26 17:42:08', '2009-11-26 17:42:08', 'A. D.', 'a. d.', 'Ministrator', 'ministrator', 'A. D. Ministrator', 'a. d. ministrator', 'admin@[example.com](http://example.com)', 'admin@[example.com](http://example.com)', (select id from cwd_directory where directory_name='Confluence Internal Directory'), 'x61Ey612Kl2gpFL56FT9weDnpSo4AV8j8+qx2AuTHdRyY036xxzTTrw10Wq3+4qQyB+XURPWx1ONxp3Y3pB37A==');  
> **ERROR: relation "cwd_user" does not exist**   
> LINE 1: insert into cwd_user(id, user_name, lower_user_name, active,...  
> \^

<br />

<br />


Answers:
author: John McGehee
body: The JIRA data source was missing from the `conf/server.xml` file.

In the old Confluence instance's `conf/server.xml` file, look for lines that resemble this:  
> `<Resource auth=``"Container"`  
> `driverClassName=``"com.mysql.jdbc.Driver"`  
> `maxActive=``"20"`  
> `name=``"*jdbc/JiraDS*"`  
> `password=``"jirauser"`  
> `type=``"javax.sql.DataSource"`  
> `url=``"jdbc:`<mysql://localhost/jiradb?useUnicode=true&characterEncoding=UTF8>`"`  
> `username=``"jirauser"`  
`validationQuery=``"select 1"``/>`  
The XML attributes might be in a different order, but of course the order of XML attributes does not matter.  
Copy these lines from your old `server.xml` into the corresponding position in your new `conf/server.xml`.  
Reference: [https://confluence.atlassian.com/display/CONFKB/Missing+JIRA+Datasource+Causes+Error+When+Attempting+to+List+the+User+Directories+in+Administration?focusedCommentId=726567006\&#comment-726567006](https://confluence.atlassian.com/display/CONFKB/Missing+JIRA+Datasource+Causes+Error+When+Attempting+to+List+the+User+Directories+in+Administration?focusedCommentId=726567006&#comment-726567006)


author: WilliamD
body: Hi John:

This seems to be one of those better safe than sorry issues. See the comment posted towards the bottom of: <https://confluence.atlassian.com/display/DOC/Upgrading+Confluence> posted Sep 05,2014 by [Deividi Luvison \[Atlassian\]](https://confluence.atlassian.com/display/%7Edluvison "").

Upgrade to 5.0.3 as an interim release is a safer path to follow.

William


author: Mike Rathwell
body: John,

You might have to back out the upgrade and then do a few of them in sequence. There are often database schema changes between versions and you seem to have been bitten by one of those. If memory serves, you can only go direct to 5.7.x if you are starting at 5.0 or newer Confluence. If you go through the upgrade notes you'll find out which versions you have to step through to get to 5.7.1

mike

comments: author: John McGehee
body: The documentation says that this is not necessary when upgrading from Conlluence 4.1.7 to 5.7.1.


author: John McGehee
body: I successfully completed the upgrade directly from Conflluence 4.1.7 to 5.7.1, and then I migrated to another server.Although it was nightmarishly complicated, I found no need to go through an intermediate Confluence version.


Tags: confluence-administration