So... I am trying to get a docker confluence and a docker mysql to communicate.
I set up the database, created a user and changed my.cnf according to https://confluence.atlassian.com/doc/database-setup-for-mysql-128747.html.
I didn't do the step 1 though, mostly due to the fact that I don't have any installation wizard.
Then I start up the docker for confluence, I already changed the image to let it work with Oracle JDK according to https://confluence.atlassian.com/confkb/update-the-confluence-docker-image-to-use-oracle-jdk-829062521.html
I also did this,
"docker cp mysql-connector-java-5.1.45-bin.jar myconfluence:/opt/atlassian/confluence/confluence/WEB-INF/lib",
which was required because of the change to Oracle.
Next, did this in an attempt to get rid of permission-related bugs
- docker exec -it myconfluence /bin/bash
- chmod -R 755 /opt/atlassian
- chmod -R 755 /var/atlassian
I go to my confluence setup, went to the database page and keyed in the relevant information to link it to the docker mysql.
I think it worked partially because the database wasn't empty when I checked it again. The problem is that the whole page just crashed.
The message given to me by the setup page is
- com.atlassian.spring.container.ComponentNotFoundException: Failed to find component: Error creating bean with name 'i18NBean' defined in class path resource [i18NContext.xml]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.confluence.util.i18n.I18NBean]: Factory method 'getI18NBean' threw exception; nested exception is java.util.concurrent.CompletionException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantedTransactionManager' defined in class path resource [databaseSubsystemContext.xml]: Invocation of init method failed; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'tenantedLocalSessionFactoryBean5' defined in class path resource [productionDatabaseContext.xml]: Invocation of init method failed; nested exception is java.lang.IllegalStateException: premature SessionFactory initialisation, Hibernate properties have not yet been persisted in confluence.cfg.xml
while a "docker logs myconfluence" gave me some
- Caused by: com.atlassian.confluence.tenant.VacantException: Confluence is vacant, a call to tenanted [public abstrac t org.hibernate.Session org.hibernate.SessionFactory.getCurrentSession() throws org.hibernate.HibernateException] is not allowed.
at the bottom of the error report.
I've googled around and saw that vacant is usually due to the hostname. I /bin/bash into the docker confluence and ran this
I 've got some legit results, no packets loss. So now I have no idea why it is vacant.
The most infuriating thing I guess is that I actually set up the whole thing once, but it was months ago and I forgot what I did. I recall encountering into such issues before and it was only after a series of hacks and what-not then it barely works. Another irritating part I guess is that docker Jira and docker mysql works beautifully but Confluence and mysql became like this...
I'm trying to not hack now, and hoping that the community can help me out. Thanks for reading this ranty post. 