search cancel

Jobs stuck and "Error getting a DB connection" and "Connection unavailable" in logs on GCP


Article ID: 203413


Updated On:


Clarity PPM SaaS Clarity PPM On Premise


Some or all jobs are not running and we can see the following error in bg logs:

ERROR 2020-11-16 07:15:56,640 [Dispatch Time Slicing : [email protected] (tenant=clarity)] niku.blobcrack (clarity:admin:42766287__F5161F63-2431-4F36-B884-16B05BF096A6:Time Slicing) Exception during blobcrack process
com.niku.union.persistence.PersistenceException: Error getting a DB connection
             at com.niku.union.persistence.PersistenceController.doProcessRequest(
             at com.niku.union.persistence.PersistenceController.processRequest(
             at com.niku.xql2.pmd.PMDRecordSet.executePMDStatement(
Caused by: java.sql.SQLException: Connection unavailable
             at com.niku.union.persistence.connection.ApacheContext.getConnection(
             at com.niku.union.persistence.PersistenceController.createLocalContext(
             at com.niku.union.persistence.PersistenceController.doProcessRequest(
             ... 28 more


Error in bg-system log:

2020/11/16 07:15:57.653 | Nov 16, 2020 7:15:57 AM org.apache.tomcat.jdbc.pool.ConnectionPool terminateTransaction
2020/11/16 07:15:57.654 | WARNING: Unable to terminate transaction, connection will be closed.
2020/11/16 07:15:57.654 | org.postgresql.util.PSQLException: This connection has been closed.
2020/11/16 07:15:57.654 |        at org.postgresql.jdbc.PgConnection.checkClosed(
2020/11/16 07:15:57.654 |        at org.postgresql.jdbc.PgConnection.getAutoCommit(
2020/11/16 07:15:57.654 |        at org.apache.tomcat.jdbc.pool.ConnectionPool.terminateTransaction(
2020/11/16 07:15:57.654 |        at org.apache.tomcat.jdbc.pool.ConnectionPool.shouldClose(
2020/11/16 07:15:57.654 |        at org.apache.tomcat.jdbc.pool.ConnectionPool.returnConnection(


Release : 15.8.1+

Component : 


When checking with SAAS DBA we find that:

This is caused by an OOM event on the PostgreSQL database (OS level) and the database that goes into recovery mode. When it recovers, BG no longer processes some or all jobs


To resolve the problem, BG service has to be restarted

This is logged as DE58908, and currently fixed in 15.9.0