• Icon: Bug Bug
    • Resolution: Not a bug
    • Icon: Medium Medium
    • None
    • master
    • Environment - Docker
    • None
    • Severity 2 - Major

      Issue Summary

      Confluence docker was not able to start up by following the database configuration in https://hub.docker.com/r/atlassian/confluence-server. Keep getting Setup Database Failed error from UI.

      Environment

      • Confluence docker

      Steps to Reproduce

      docker run --name="confluence" -d \
      -p 8090:8090 \
      -p 8091:8091 \
      -v ~/docker-home/confluence-home:/var/atlassian/application-data/confluence \
      -e ATL_JDBC_URL=jdbc:postgresql://postgres.testnet:5432/confluence \
      -e ATL_JDBC_USER=username \
      -e ATL_JDBC_PASSWORD= \
      -e ATL_DB_TYPE=postgresql \
      --network testnet \
      atlassian/confluence-server:latest
      

      Expected Results

      Avoiding the need to do the database setup through the UI.

      Actual Results

      Note

      Here is the template of confluence.cfg.xml in /etc/atlassian/etc/confluence.cfg.xml.j2

      {% if atl_jdbc_url is defined %}
            {% set databases =  {
                 "mysql": ["com.mysql.jdbc.Driver", "MySQLDialect"],
                 "postgresql": ["org.postgresql.Driver", "PostgreSQLDialect"],
                 "mssql": ["com.microsoft.sqlserver.jdbc.SQLServerDriver", "SQLServerDialect"],
                 "oracle12c": ["oracle.jdbc.driver.OracleDriver", "OracleDialect"]
                } %}
            <property name="confluence.database.choice">{{ atl_db_type }}</property>
      
            <property name="hibernate.connection.url">{{ atl_jdbc_url }}</property>
            <property name="hibernate.connection.username">{{ atl_jdbc_user }}</property>
            <property name="hibernate.connection.password">{{ atl_jdbc_password }}</property>
            <property name="hibernate.connection.driver_class">{{ databases[atl_db_type][0] }}</property>
            <property name="hibernate.dialect">com.atlassian.confluence.impl.hibernate.dialect.{{ databases[atl_db_type][1] }}</property>
      

      Workaround

      • A password must be specified using the ATL_JDBC_PASSWORD environment variable

            [SCALE-1] Confluence docker database configuration not working

            Is Docker Secrets support (ATL_JDBC_PASSWORD_FILE environment variable!) implemented?

            Siegfried Lipp added a comment - Is Docker Secrets support (ATL_JDBC_PASSWORD_FILE environment variable!) implemented?

            Cheers isaac.foulkes the env variable is worth mentioning in the feature request gathering interest. 

            Dylan Rathbone added a comment - Cheers isaac.foulkes  the env variable is worth mentioning in the feature request gathering interest. 

             Thanks, I will vote on that feature request.

            It also needs to be supported as an environment variable input when building the docker image - should that be a new feature request?

            Deleted Account (Inactive) added a comment -  Thanks, I will vote on that feature request. It also needs to be supported as an environment variable input when building the docker image - should that be a new feature request?

            Thanks for clarifying. Unfortunately at present Confluence does not support the usage of encrypted passwords, which I suspect, is why the docker image does not either. There is however a feature request gathering interest for support here: https://jira.atlassian.com/browse/CONFSERVER-60073

             

            Dylan Rathbone added a comment - Thanks for clarifying. Unfortunately at present Confluence does not support the usage of encrypted passwords, which I suspect, is why the docker image does not either. There is however a feature request gathering interest for support here:  https://jira.atlassian.com/browse/CONFSERVER-60073  

            Yes, for Confluence. That is our intention - I'd rather not specify the password in plain text in the yaml/Docker Compose config.

            We are deploying both Confluence & Jira within a Docker Swarm, and would prefer to use Docker Secrets wherever possible for passwords and certificates.

            Documentation on this feature here: https://docs.docker.com/engine/swarm/secrets/

            Official postgres container already supports this, which we are using in the stack.

            Deleted Account (Inactive) added a comment - Yes, for Confluence. That is our intention - I'd rather not specify the password in plain text in the yaml/Docker Compose config. We are deploying both Confluence & Jira within a Docker Swarm, and would prefer to use Docker Secrets wherever possible for passwords and certificates. Documentation on this feature here: https://docs.docker.com/engine/swarm/secrets/ Official postgres container already supports this, which we are using in the stack.

            Hi isaac.foulkes can you confirm if this ask is for Confluence? If so is your intention to be able to supply an encrypted file containing the password to the docker container?

            Dylan Rathbone added a comment - Hi isaac.foulkes can you confirm if this ask is for Confluence? If so is your intention to be able to supply an encrypted file containing the password to the docker container?

            Please support Docker Secrets with ATL_JDBC_PASSWORD_FILE environment variable!!

            Deleted Account (Inactive) added a comment - Please support Docker Secrets with ATL_JDBC_PASSWORD_FILE environment variable!!

              dchevell Dave Chevell
              lwang3@atlassian.com Lei Wang
              Affected customers:
              0 This affects my team
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: