Atlassian Confluence 5

I migrated the awesome intranet WIKI system Confluence from v4 on Linux to v5 on Windows.  This was not straight forward but it’s now working great. As a JAVA based app it runs fine on Windows and it’s easier to support on this platform (IMHO).  Some findings/gotchas:

Confluence config settings

All references to setenv.bat in Atlassian docs should be ignored. Making JVM config changes to this file has no impact. Big red herring.  Instead use tomcat config GUI or registry settings. This article is correct where lots of other confluence guides are wrong https://confluence.atlassian.com/display/CONF43/Configuring+System+Properties

Confluence  JVM memory settings don’t work out of the box

It’s left as an exercise to the admin to guestimate how much RAM the application will require and allocate not to little, not too much, but just right:

This error can be thrown from the Serial, Parallel or Concurrent collectors. It often means that the Xmx value is too high, however it can also be because it is too low”

https://confluence.atlassian.com/display/CONFKB/Confluence+Crashes+Due+to+java.lang.OutOfMemoryError+GC+overhead+limit+exceeded

This is some sort of Goldilocks IT…

Confluence can’t get to the plugin market place

Out of the box, Confluence can’t get to the plugin market place. It runs an old version of JRE 1.6u20 and JAVA cannot connect if it cannot verify certs for SSL connections. You need to add SSL certs for Market Place website to the JRE cert store.

Edit the JRE trusted certificate authorities files using Portecle GUI java.exe -jar portecle.jar

or
<code class="java plain">echo JRE </code><code class="java keyword">default</code> <code class="java plain">password is changeit</code>
<code class="java plain">cd /d </code><code class="java string">"c:\Program Files\Atlassian\Confluence\jre\bin"</code>
<code class="java plain">set certspath=*Path to your </code><code class="java plain">SSLCerts here*</code>
<code class="java plain">set keystore=C:\Program Files\Atlassian\Confluence\jre\lib\security\cacerts</code>
<code class="java plain">keytool.exe -</code><code class="java keyword">import</code> <code class="java plain">-alias CompanyRootCA -file %certspath%\CompanyRootCA.cer -keystore </code><code class="java string">"%keystore%"</code>
<code class="java plain">keytool.exe -</code><code class="java keyword">import</code> <code class="java plain">-alias ServerName -file %certspath%\ServerName.cer -keystore </code><code class="java string">"%keystore%"</code>
<code class="java plain">keytool.exe -</code><code class="java keyword">import</code> <code class="java plain">-alias Proxy -file %certspath%\proxy.crt -keystore </code><code class="java string">"%keystore%"</code>
<code class="java plain">keytool.exe -</code><code class="java keyword">import</code> <code class="java plain">-alias atlassian -file %certspath%\StarAtlassianPositiveSSL.cer -keystore </code><code class="java string">"%keystore%"</code>
<code class="java plain">keytool.exe -</code><code class="java keyword">import</code> <code class="java plain">-alias cloudfront -file %certspath%\StarCloudfrontVerisign.cer -keystore </code><code class="java string">"%keystore%"</code>
<code class="java plain">keytool.exe -list -keystore </code><code class="java string">"%keystore%"</code>
Confluence 4.3.3 upgrade to Confluence 5 fails
We’ve been using confluence since v2 in 2007 and upgraded through v3 and v4. At some point Atlassian decided to change database collation to case sensitive and change string datatypes to unicode.  The upgrade process doesn’t allow for the schema change.  Confluence 5 upgrade process adds a new table (user_mapping) with nvarchar datatype and then crashes when trying to link this to other table columns with varchar.
2014-06-16 11:29:40,732 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute Unsuccessful: alter table FOLLOW_CONNECTIONS add constraint FK_FOLLOW_CONNECTIONS_FOLLOWER foreign key (FOLLOWER) references user_mapping
2014-06-16 11:29:40,732 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute Column 'user_mapping.user_key' is not the same data type as referencing column 'FOLLOW_CONNECTIONS.FOLLOWER' in foreign key 'FK_FOLLOW_CONNECTIONS_FOLLOWER'.
2014-06-16 11:29:40,733 ERROR [localhost-startStop-1] [hibernate.tool.hbm2ddl.SchemaUpdate] execute could not complete schema update
Atlassian had no solution for this.  An option might have been export to XML, make a new database with new schema, import from XML.  Assuming the export-import process captures everything.  But our database was too large and the export process timed out.
Fortunately we had an amazing DBA who was able to refactor the database to the new schema, after which the upgrade completed ok.
Atlassian do not have a High Availability solution for Confluence. If the server fails you’re out of luck.  By virtualisation can help here. Running Confluence as a Virtual Machine in a cluster protects you against hardware failure.  Replicating the VM to another datacentre protects you against a site-wide outage (e.g. storage failure).

Leave a Reply