Installation keeps failing (HTTP Status 500 - Cannot call sendError().... etc)
Asked by Roy Boverhof:

I am trying to migrate Confluence to a clean Ubuntu system, but I keep hitting the same error over and over again. After I test the connection to MySQL I hit next and after a while I see:

HTTP Status 500 - Cannot call sendError() after the response has been committed {#toc-hId-1795358245}
-----------------------------------------------------------------------------------------------------

When I look at the logs I see:

```
03-May-2018 16:33:01.478 SEVERE [http-nio-8090-exec-2] org.apache.catalina.core.StandardHostValve.custom Exception Processing ErrorPage[errorCode=500, location=/500page.jsp]
?org.apache.jasper.JasperException: java.util.concurrent.CompletionException: com.atlassian.confluence.tenant.VacantException: Confluence is vacant, a call to tenanted [public abstract org.hibernate.Session org.hibernate.SessionFactory.getCurrentSession() throws org.hibernate.HibernateException] is not allowed.
```

I will spare you all the Java jibberish that is spat out after that.

I looks like the database stays empty:

```
mysql> USE confluence;
Database changed
mysql> show tables;
Empty set (0.00 sec)
```


Answers:
author: Roy Boverhof
body: I have finally found the problem, in our old setup Confuence was linked to Jira... so while the internal users table was populated in the database it wasn't used. After changing the configuration on the orginal installation and doing a full database and application backup it seems to work again.

Lessons learned: do not use a single server for confluence/jira/bitbucket. It might seem like a good idea at the time, but just don't do it...

comments: author: AnnWorley
body: Hi Roy,

Thanks for following up to let us know how you resolved it. I wish you a smooth experience going forward.

For more details on user management configurations in Confluence please review: [Managing Multiple Directories](https://confluence.atlassian.com/doc/managing-multiple-directories-229838494.html).

Thanks,

Ann


author: Roy Boverhof
body: Hi Ann,

we'll probably connect everything to LDAP soon. Although I have to admit this was our fault, some meaningful log-entries would have really helped here ;)

Cheers,

Roy


author: AnnWorley
body: Usually the atlassian-confluence.log will record entries such as "remote directory "Jira" was unavailable while authenticating "user"". Was there nothing like that when you tried logging in when Confluence was using Jira for User Management?


author: Roy Boverhof
body: Unfortunately not, I actually still had the "internal table" active... just below the Jira Users.


author: Roy Boverhof
body: [@AnnWorley](/t5/user/viewprofilepage/user-id/502040)I decided to give it one more try, basically I have ignored the following article: <https://confluence.atlassian.com/doc/migrating-confluence-between-servers-184150.html>

I just did an XML export followed by a restore, it took me an hour to move this application. (Why doesn't this article mention the export -\> import route?)

The import went exactly as planned, but I can't seem to login... again... how can it be this hard to setup a new instance for Confluence!? Either you need to create better documentation / system specs or your developers need to do a better a job. Most of the open source software we work with is easier to setup than Confluence!

comments: author: AnnWorley
body: Hi Roy,

I am not sure where the instructions broke down for you but I am glad you got the instance moved using the XML back-up. We don't recommend that method widely because there can be so many complications with the restores.

To log in, please see the instructions on [Restore Passwords To Recover Admin User Rights](https://confluence.atlassian.com/doc/restore-passwords-to-recover-admin-user-rights-158390.html). The recovery mode feature was added after Confluence 6.5 so if you are running a prior version, make sure and choose the right doc for your version from the pulldown on the top right:

![Screen Shot 2018-05-04 at 5.41.29 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/21380i6947414F8F9B48B9/image-dimensions/155x346?v=v2 "Screen Shot 2018-05-04 at 5.41.29 PM.png")

The instructions for 5.10 will work for earlier versions as well.

Thanks,

Ann


author: Roy Boverhof
body: I have just terminated the entire instance, it shouldn't take 2 days to move an application.

I have followed: <https://confluence.atlassian.com/doc/migrating-confluence-between-servers-184150.html> but this article is effectively useless, I can't log in and when I copy the application-data directory all I see is a 404.

There is no meaningfull information in the logs, I honestly feel for Java developers. How does anyone work with this language?


author: Roy Boverhof
body: I ended up destroying this instance and creating a new instance, I have no idea why but the installer seems to work now?

comments: author: Roy Boverhof
body: _everything_ was a bit too optimistic, I see basic HTML but all assets result in 500 errors:

```
Cause

com.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.IllegalStateException: Container is not setup
 ????at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:149)

caused by: java.lang.IllegalStateException: Container is not setup
 ????at com.atlassian.spring.container.LazyComponentReference.create(LazyComponentReference.java:41)
```


author: Roy Boverhof
body: When you run the installer as "root" it does install Confluence under the "confluence" user, but it keeps running under "root" until you do a reboot and the service is started automagically.

I guess things work now... I still don't quite understand why it failed the first ten times.


author: AnnWorley
body: Please post a screen shot of what Confluence looks like in the browser as well as the lines in the **\<confluence_home\>/logs/atlassian-confluence.log** from "starting Confluence" to "Confluence is ready to serve" (if it is ready).  
Note: The \<confluence_home\> directory is the path defined in the following file: **\<confluence_install\>/confluence/WEB-INF/classes/confluence-init.properties**


author: AnnWorley
body: Our posts crossed - I am sorry to hear you had such hassle installing Confluence. I hope you enjoy the product, and am happy it runs now,


author: Roy Boverhof
body: Thanks! We have always enjoyed Confluence, we are now migrating from our legacy cloud to a new cloud. But the actual data migration is something for tomorrow ;)


author: Roy Boverhof
body: I really hope you make the migration process a bit easier, I have spent an entire day trying to get things up-and-running again... no success yet.


author: Roy Boverhof
body: I found this thread: <https://confluence.atlassian.com/confkb/confluence-generates-confluence-is-vacant-error-on-install-779164449.html> , but that doesn't seem to help either.

This is quite depressing, how can it be _this hard_ to install your product on a clean server?

comments: author: AnnWorley
body: Roy,

What was the result when you ran:

```
$ ping `cat /etc/hostname`

```

as described in the article you linked? Was an IP address returned?

* Please post the contents of your /etc/hostname and /etc/hosts files.

Thanks,

Ann


author: Roy Boverhof
body: ```
root@confluence:/home/ubuntu# ping `cat /etc/hostname`
PING localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.017 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.025 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.028 ms
```

That seems to work as expected, my hosts file looks like this:

```
127.0.0.1 localhost confluence

# The following lines are desirable for IPv6 capable hosts
::1 ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
```


Tags: confluence-server

server