Tuples must be non-null after upgrading Bitbucket Server

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs 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

Problem

After upgrading to Bitbucket Server 4.11+, the application fails to start and the following message appears in the web UI:

1 2 The database, as currently configured, is not accessible. tuples must be non-null

The following appears in atlassian-bitbucket.log:

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.atlassian.stash.internal.hikari.ExtendedHikariDataSource]: Factory method 'create' threw exception; nested exception is com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: tuples must be non-null at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:189) ~[spring-beans-4.3.2.RELEASE.jar:4.3.2.RELEASE] ... 5 common frames omitted Caused by: com.zaxxer.hikari.pool.HikariPool$PoolInitializationException: Failed to initialize pool: tuples must be non-null at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:516) ~[HikariCP-2.4.7.jar:na] at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:118) ~[HikariCP-2.4.7.jar:na] at com.zaxxer.hikari.HikariDataSource.<init>(HikariDataSource.java:71) ~[HikariCP-2.4.7.jar:na] at com.atlassian.stash.internal.hikari.ExtendedHikariDataSource.<init>(ExtendedHikariDataSource.java:49) ~[bitbucket-dao-impl-4.12.0.jar:na] at com.atlassian.stash.internal.hikari.HikariDataSourceFactory.create(HikariDataSourceFactory.java:70) ~[bitbucket-dao-impl-4.12.0.jar:na] ... 5 common frames omitted Caused by: java.lang.NullPointerException: tuples must be non-null at org.postgresql.jdbc.PgResultSet.<init>(PgResultSet.java:147) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgStatement.createResultSet(PgStatement.java:163) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgStatement$StatementResultHandler.handleResultRows(PgStatement.java:213) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2037) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:291) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:432) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:358) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:305) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgStatement.executeCachedSql(PgStatement.java:291) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgStatement.executeWithFlags(PgStatement.java:269) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgConnection.execSQLUpdate(PgConnection.java:480) ~[postgresql-9.4.1211.jar:9.4.1211] at org.postgresql.jdbc.PgConnection.getTransactionIsolation(PgConnection.java:850) ~[postgresql-9.4.1211.jar:9.4.1211] at com.zaxxer.hikari.pool.PoolBase.checkDriverSupport(PoolBase.java:392) ~[HikariCP-2.4.7.jar:na] at com.zaxxer.hikari.pool.PoolBase.setupConnection(PoolBase.java:350) ~[HikariCP-2.4.7.jar:na] at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:321) ~[HikariCP-2.4.7.jar:na] at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:506) ~[HikariCP-2.4.7.jar:na] ... 9 common frames omitted

Diagnosis

Environment

Cause

In Bitbucket Server 4.11 the Postgres JDBC driver was upgraded to 9.4.1211, this triggers a bug in Postgres DB provided by EnterpriseDB and prevents Bitbucket Server from setting the isolation level. This bug is being tracked with the EnterpriseDB and Postgres teams at https://github.com/pgjdbc/pgjdbc/issues/667.

Solution

Workaround

Version 9.4.1209 of the Postgres JDBC driver does not trigger this bug, as a workaround the previous version of the driver can be used.

  1. Stop Bitbucket Server

  2. Remove the postgresql-9.4.1211.jar from <Bitbucket 4.12 Install>/lib

  3. Copy the postgresql-9.4.*.jar from the lib directory of your previous installation of Bitbucket Server into <Bitbucket 4.12 Install>/lib

  4. Start Bitbucket Server

Resolution

A fix from EnterpriseDB is not yet available, updates should be available at https://github.com/pgjdbc/pgjdbc/issues/667.

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.