Confluence Synchrony Pod is not getting started in Kubernetes Cluster
Platform Notice: Data Center - This article applies to Atlassian products on the Data Center platform.
Note that this knowledge base article was created for the Data Center version of the product. Data Center knowledge base articles for non-Data Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
While Installing Confluence in Kubernetes cluster, the Synchrony pod does not start.
Environment
Confluence in Kubernetes Cluster
Diagnosis
Run below command to check the logs of synchrony pod and found error:
$ kubectl logs confluence-synchrony-0 Loading synchrony WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-vals WARNING: update-keys already refers to: #'clojure.core/update-keys in namespace: clojure.tools.analyzer, being replaced by: #'clojure.tools.analyzer.utils/update-keys WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.passes, being replaced by: #'clojure.tools.analyzer.utils/update-vals WARNING: update-vals already refers to: #'clojure.core/update-vals in namespace: clojure.tools.analyzer.passes.uniquify, being replaced by: #'clojure.tools.analyzer.utils/update-vals SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/opt/atlassian/confluence/confluence/WEB-INF/packages/synchrony-standalone.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/opt/atlassian/confluence/confluence/WEB-INF/lib/org.apache.logging.log4j_log4j-slf4j-impl-2.19.0.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Reload4jLoggerFactory] Starting synchrony 2024-07-11 04:49:49,579 ERROR [main] [synchrony.logging] uncaught exception {:throwable #error { :cause "Cannot invoke \"java.lang.CharSequence.subSequence(int, int)\" because \"text\" is null" :via [{:type clojure.lang.ExceptionInfo :message "error while starting state #'synchrony.querydsl.db/pool-datasource-st" :data {:var #'synchrony.querydsl.db/pool-datasource-st} :at [mount.lite$start$fn__24145 invoke "lite.clj" 153]} {:type java.lang.NullPointerException :message "Cannot invoke \"java.lang.CharSequence.subSequence(int, int)\" because \"text\" is null" :at [instaparse.gll$sub_sequence invokeStatic "gll.clj" 216]}]
Run below command to describe synchrony pod and to find required environment variables which are missing for synchrony:
$ kubectl describe pod confluence-synchrony-0 ... Environment: SET_PERMISSIONS: true SYNCHRONY_BIND: (v1:status.podIP) SYNCHRONY_SERVICE_URL: https:///synchrony ...
Cause
- Database details are missing in value.yaml file of Confluence helm chart.
database: # -- The database type that should be used. If not specified, then it will need to be # provided via the browser during manual configuration post deployment. Valid values # include: # * 'postgresql' # * 'mysql' # * 'oracle' # * 'mssql' # https://atlassian.github.io/data-center-helm-charts/userguide/CONFIGURATION/#databasetype # type: # -- The jdbc URL of the database. If not specified, then it will need to be provided # via the browser during manual configuration post deployment. Example URLs include: # * 'jdbc:postgresql://<dbhost>:5432/<dbname>' # * 'jdbc:mysql://<dbhost>/<dbname>' # * 'jdbc:sqlserver://<dbhost>:1433;databaseName=<dbname>' # * 'jdbc:oracle:thin:@<dbhost>:1521:<SID>' # https://atlassian.github.io/data-center-helm-charts/userguide/CONFIGURATION/#databaseurl # url: # JDBC connection credentials # credentials: # -- The name of the K8s Secret that contains the database login credentials. # If the secret is specified, then the credentials will be automatically utilised on # Confluence startup. If the secret is not provided, then the credentials will need to be # provided via the browser during manual configuration post deployment. # # Example of creating a database credentials K8s secret below: # 'kubectl create secret generic <secret-name> --from-literal=username=<username> \ # --from-literal=password=<password>' # https://kubernetes.io/docs/concepts/configuration/secret/#opaque-secrets # secretName: # -- The key ('username') in the Secret used to store the database login username # usernameSecretKey: username # -- The key ('password') in the Secret used to store the database login password # passwordSecretKey: password
Solution
- Add and ensure all database specific details are present in value.yaml file of confluence helm chart and update deployment.
- When you describe synchrony pod next time then it should display details of all required environment variables.
- Below is an example:
...
Environment:
SET_PERMISSIONS: true
SYNCHRONY_BIND: (v1:status.podIP)
SYNCHRONY_SERVICE_URL: https://<confluence_URL>/synchrony
SYNCHRONY_DATABASE_URL: jdbc:postgresql://postgres-postgresql:5432/atldb
SYNCHRONY_DATABASE_USERNAME: <set to the key 'username' in secret 'conniedb'> Optional: false
SYNCHRONY_DATABASE_PASSWORD: <set to the key 'password' in secret 'conniedb'> Optional: false
KUBERNETES_NAMESPACE: default (v1:metadata.namespace)
HAZELCAST_KUBERNETES_SERVICE_NAME: confluence-synchrony
HAZELCAST_KUBERNETES_SERVICE_PORT: 5701
CLUSTER_JOIN_TYPE: kubernetes
...