I just realized recovering from a lost database connection does not work when there was no database connection during startup at all. It will stuck in the Confluence had problems starting up page forever.
Is there a Confluence way to self heal this situation? Or at least an option such that Confluence will restart in that situation? That would already fix the problem.
FYI: I am running Confluence on a QNAP NAS through Container Station using the official latest docker image (which works great btw). Each time I boot my NAS, postgres will be available about 3 minutes after Confluence already started and therefore fails to start. Postgres runs through a different platform, so there is no elegant way to bound their lifecycles together. Anyway, a Confluence solution would be the robust way, anyway.
Hi Daniel,
thank you for your help. I did a bit of a research especially for the delay approach and found a life hack more than enough for my home deployment. It's quite robust and based on delays, restarts and checking the database TCP port to respond until Confluence will be started.
In a linux environment tools like netcat and the so-called wait-for-it script (on github) are really helpful. The latter one is also recommended by docker. I've just placed that script into the confluence home folder to survive container updates, together with a start script and created a docker-compose yaml file.
For those few (or many?) people that run Confluence on a QNAP through Container-Station like me: you can create the yaml files through ContainerStation > Create > Create Application.
docker compose yaml:
version: '3'
services:
confluence:
image: atlassian/confluence-server:latest
ports:
- 32769:8090
volumes:
- /share/Container/container-station-data/application/confluence-server/:/var/atlassian/application-data/confluence/
command: ["/var/atlassian/application-data/confluence/wait-for-it.sh", "nas:5432", "-s", "--timeout=0", "--", "/var/atlassian/application-data/confluence/start_confluence.sh"]
deploy:
restart_policy:
condition: always
delay: 5s
start_confluence.sh
#!/bin/sh
sleep 30
/entrypoint.py
cheers,
Christian
Hi Christian,
welcome to Atlassian Community!
During startup Confluence expects the database to be there and ready. Your setup is valid (thanks for explaining!) but, I assume, when the application was designed such a scenario was not considered.
Two possibilities which come to mind are:
Please keep in mind there are only two theories of somewhat 'lifehack fixes' - in a data center-like scenario such workarounds are rarely needed :) Maybe you could put the database on a host where it comes alive faster.
Cheers,
Daniel
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.