Details
-
Suggestion
-
Resolution: Unresolved
-
None
-
None
-
None
Description
The Confluence Helm Chart values integrating with Oracle fails to start:
# REQUIRED - Database configuration # # Confluence requires a backend database. The configuration below can be used to define the # database to use and its connection details. # https://atlassian.github.io/data-center-helm-charts/userguide/CONFIGURATION/#database-connectivity # 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: oracle # -- 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:oracle:thin:@//oracleserver:1521/ORCLPDB1 # 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: orcldbsecret # -- 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
After ~4 minutes from startup, atlassian-confluence.log shows:
... 2022-05-27 04:17:07,216 WARN [http-nio-8090-exec-8] [jdbc.env.internal.JdbcEnvironmentInitiator] initiateService HHH000342: Could not obtain connection to query metadata : An SQLException was provoked by the following failure: com.mchange.v2.resourcepool.NoGoodResourcesException: After checking so many resources we blew the stack, no resources tested acceptable for checkout. See logger com.mchange.v2.resourcepool.BasicResourcePool output at FINER/DEBUG for information on individual failures. -- url: /setup/setupdbtype.action | traceId: 00ff92988016385e | userName: anonymous | action: setupdbtype ...
After a further minute wait, atlassian-confluence.log shows:
2022-05-27 04:18:09,231 ERROR [http-nio-8090-exec-8] [hql.spi.id.IdTableHelper] executeIdTableCreationStatements Unable obtain JDBC Connection -- url: /setup/setupdbtype.action | traceId: 00ff92988016385e | userName: anonymous | action: setupdbtype java.sql.SQLException: An SQLException was provoked by the following failure: com.mchange.v2.resourcepool.NoGoodResourcesException: After checking so many resources we blew the stack, no resources tested acceptable for checkout. See logger com.mchange.v2.resourcepool.BasicResourcePool output at FINER/DEBUG for information on individual failures. at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118) at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:77) at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:74) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:694) at com.mchange.v2.c3p0.impl.AbstractPoolBackedDataSource.getConnection(AbstractPoolBackedDataSource.java:140) ... at org.springframework.transaction.support.TransactionTemplate.execute(TransactionTemplate.java:137) at com.atlassian.confluence.upgrade.upgradetask.DataAccessUtils.runWithNewConnection(DataAccessUtils.java:378) at com.atlassian.confluence.upgrade.upgradetask.DataAccessUtils.filterToExistingTables(DataAccessUtils.java:212) at com.atlassian.confluence.upgrade.upgradetask.DataAccessUtils.isTablePresent(DataAccessUtils.java:263) at com.atlassian.confluence.impl.core.persistence.hibernate.schema.ConfluenceSchemaCreator.dropOldTables(ConfluenceSchemaCreator.java:130) at com.atlassian.confluence.impl.core.persistence.hibernate.schema.ConfluenceSchemaCreator.createSchema(ConfluenceSchemaCreator.java:83) at com.atlassian.confluence.setup.DefaultHibernateConfigurator.createSchema(DefaultHibernateConfigurator.java:171) at com.atlassian.confluence.setup.DefaultHibernateConfigurator.configureDatabase(DefaultHibernateConfigurator.java:67) at com.atlassian.config.bootstrap.DefaultAtlassianBootstrapManager.bootstrapDatabase(DefaultAtlassianBootstrapManager.java:220) at com.atlassian.confluence.setup.actions.SetupDBTypeAction.setupDatabase(SetupDBTypeAction.java:99) at com.atlassian.confluence.setup.actions.AbstractDatabaseCreationAction.execute(AbstractDatabaseCreationAction.java:33) at com.atlassian.confluence.setup.actions.SetupDBTypeAction.execute(SetupDBTypeAction.java:62) ... Caused by: com.mchange.v2.resourcepool.NoGoodResourcesException: After checking so many resources we blew the stack, no resources tested acceptable for checkout. See logger com.mchange.v2.resourcepool.BasicResourcePool output at FINER/DEBUG for information on individual failures. at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:600) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:594) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:594) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:594) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:594) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:594) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:594) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:594) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:594) ... Caused by: java.lang.StackOverflowError at oracle.net.nt.TimeoutSocketChannel.write(TimeoutSocketChannel.java:224) at oracle.net.ns.NIOPacket.writeToSocketChannel(NIOPacket.java:211) at oracle.net.ns.NIONSDataChannel.writeDataToSocketChannel(NIONSDataChannel.java:181) at oracle.net.ns.NIONSDataChannel.writeDataToSocketChannel(NIONSDataChannel.java:132) at oracle.jdbc.driver.T4CMAREngineNIO.prepareForReading(T4CMAREngineNIO.java:96) at oracle.jdbc.driver.T4CMAREngineNIO.unmarshalUB1(T4CMAREngineNIO.java:534) at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:485) at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:252) at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:612) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:213) at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:37) at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:733) at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:904) at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1082) at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1276) at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:366) at com.mchange.v2.c3p0.impl.DefaultConnectionTester.activeCheckConnection(DefaultConnectionTester.java:286) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:510) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.testPooledConnection(C3P0PooledConnectionPool.java:464) at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool$1PooledConnectionResourcePoolManager.refurbishResourceOnCheckout(C3P0PooledConnectionPool.java:339) at com.mchange.v2.resourcepool.BasicResourcePool.attemptRefurbishResourceOnCheckout(BasicResourcePool.java:1771) at com.mchange.v2.resourcepool.BasicResourcePool.checkoutResource(BasicResourcePool.java:558) ... 1002 more
The front end will eventually time out with a:
- 504 Gateway Time-out
The cause of this is that:
- The Validation Query configured in the generated confluence.cfg.xml defaults to SELECT 1 which is not valid for Oracle database
Suggestion:
In the Confluence Docker image, the file /opt/atlassian/etc/confluence.cfg.xml.j2 has the validation query defaulted to 'select 1':
<property name="hibernate.c3p0.preferredTestQuery">{{ atl_db_validationquery | default('select 1') }}</property>
Enhance the confluence.cfg.xml.j2 to automatically use a Validation Query of select 1 from dual if it detects that the configured database is Oracle.
Workaround:
Kubernetes
In addition to the existing Helm Chart values already configured, also set the following values in the Confluence DC Helm Chart values when using Oracle as the Database Engine:
confluence: additionalEnvironmentVariables: - name: ATL_DB_VALIDATIONQUERY value: select 1 from dual
Docker
Ensure you also specify this flag when creating the Confluence Docker Container when integrating with Oracle:
-e ATL_DB_VALIDATIONQUERY="select 1 from dual"