Preparing for Confluence 9.0 - EAP out now

Hi,

I am using Confluence 9.0.0-m48 dockerized together with postgreSQL 15.6 and I always get randomly after some minutes or hours:

UPDATE: Not randomly, but always when installing a new app version or uninstalling app!

java.lang.IllegalStateException: The CacheManager has been shut down. It can no longer be used.

And Confluence crashes completely.

My setup on Linux:

# START DB
docker run --name confluence90dbvanilla -d \
     -p 5444:5432 \
     -e POSTGRES_USER=root \
     -e POSTGRES_PASSWORD=rootpwcool \
     postgres:15.6-alpine

# SEED
echo "CREATE DATABASE confluence WITH ENCODING 'UNICODE' LC_COLLATE 'utf8' LC_CTYPE 'utf8' TEMPLATE template0;" > confluence-seed.sql
echo "CREATE USER confluence WITH ENCRYPTED PASSWORD 'secret123';" >> confluence-seed.sql
echo "GRANT ALL PRIVILEGES ON DATABASE confluence TO confluence;" >> confluence-seed.sql
echo "ALTER DATABASE confluence OWNER TO confluence;" >> confluence-seed.sql
PGPASSWORD=rootpwcool psql -h 192.168.178.66 -p 5444 -U root -f ./confluence-seed.sql


# START CONFLUENCE
docker run --name confluence90vanilla -d \
     -p 8090:8090 \
     -p 8091:8091 \
     -e JVM_MINIMUM_MEMORY=512M \
     -e JVM_MAXIMUM_MEMORY=2048M \
     -e JVM_SUPPORT_RECOMMENDED_ARGS='-Dupm.plugin.upload.enabled=true' \
     -e CLUSTERED=false \
     atlassian/confluence:9.0.0-m48-ubi9-jdk17

:white_check_mark: SOLVED: It can be solved like so:

    @Bean(destroyMethod="") // IMPORTANT! OTHERWISE CACHEMANAGER CRASHES CONFLUENCE ON SHUTDOWN
    public CacheManager importCacheManager() {
        return importOsgiService(CacheManager.class);
    }

:zap: WARNING: This applies to Jira too. And once you got your faulty app installed even an uninstall leads to a crash! Very unpleasant!

SEE ORIGINAL THREAD: Atlassian Cache crashes Confluence/Jira upon app disable - #20 by aswan

:question: The root cause for this seems to be 4 years old. So my question to Atlassian:

  • Why does Atlassian not provide a better exported Service called “NonCrashingCacheManagerForApps” or similar that we can use?
  • This was impossible to debug! If there hasn’t been the community post already I would have never known.
2 Likes