java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool

Atlassian JIRA | Martin Sander | 2 years ago
  1. 0

    h3. Summary A bug in JIRA, exposed by a certain version of the JIRA Toolkit plugin, will cause JIRA to leak database connections from the Database Connection Pool (DBCP) whilst indexing. This will result in an exhaustion of available connections in the DBCP and JIRA will not function as expected. It's the same behaviour as described in our [JIRA Stops Functioning due to Timeout waiting for idle object|https://confluence.atlassian.com/display/JIRAKB/JIRA+Stops+Functioning+due+to+Timeout+waiting+for+idle+object] KB article. h3. Steps to Reproduce # Install JIRA toolkit 0.35.10 or higher. # Create a "Last public comment date" custom field. # Go to issue search and include this field as a column on the search. # Run a search returning 50 or so issues (more than configured max connections in {{dbconfig.xml}}). h3. Expected Results JIRA indexes as per normal without any failures. h3. Actual Results The number of active connections in DBCP spikes and they are not released back into the connection pool. As a result of this the following exceptions will be thrown, affecting JIRA's functionality: {noformat} java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(ConnectionTracker.java:59) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.trackConnection(DBCPConnectionFactory.java:242) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:73) at org.ofbiz.core.entity.ConnectionFactory.tryGenericConnectionSources(ConnectionFactory.java:69) at org.ofbiz.core.entity.transaction.JNDIFactory.getConnection(JNDIFactory.java:146) at org.ofbiz.core.entity.TransactionFactory.getConnection(TransactionFactory.java:101) at org.ofbiz.core.entity.ConnectionFactory.getConnection(ConnectionFactory.java:59) at org.ofbiz.core.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:367) at org.ofbiz.core.entity.GenericDAO.select(GenericDAO.java:584) at org.ofbiz.core.entity.GenericHelperDAO.findByPrimaryKey(GenericHelperDAO.java:97) at org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:609) at org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:647) ... Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory$1.call(DBCPConnectionFactory.java:246) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory$1.call(DBCPConnectionFactory.java:243) at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(ConnectionTracker.java:53) ... 236 more Caused by: java.util.NoSuchElementException: Timeout waiting for idle object at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1134) at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:79) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) ... 240 more {noformat} h3. Workaround Downgrade JIRA Toolkit plugin to version 0.35.9 (compatible with JIRA Server 6.2 - 6.3.15) or disable the plugin. To disable: # Browse to the Add-on Manager. # Search for the JIRA Toolkit plugin and click on the disable button. # Reindex JIRA. To downgrade: # Browse to the Add-on Manager. # Uninstall the current version. # Download 0.35.9 from the [Atlassian Marketplace|https://marketplace.atlassian.com/download/plugins/com.atlassian.jira.toolkit/version/184]. # Manually upload the JAR as per [Installing add-ons|https://confluence.atlassian.com/display/UPM/Installing+add-ons#Installingadd-ons-Installingbyfileupload]. # Reindex JIRA.

    Atlassian JIRA | 2 years ago | Martin Sander
    java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool
  2. 0

    JIRA Stops Functioning due to Timeout waiting for idle object - Atlassian Documentation

    atlassian.com | 7 months ago
    java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool
  3. 0

    JIRA Stops Functioning due to Timeout waiting for idle object - Atlassian Documentation

    atlassian.com | 4 months ago
    java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    h3. Summary A bug in JIRA, exposed by a certain version of the JIRA Toolkit plugin, will cause JIRA to leak database connections from the Database Connection Pool (DBCP) whilst indexing. This will result in an exhaustion of available connections in the DBCP and JIRA will not function as expected. It's the same behaviour as described in our [JIRA Stops Functioning due to Timeout waiting for idle object|https://confluence.atlassian.com/display/JIRAKB/JIRA+Stops+Functioning+due+to+Timeout+waiting+for+idle+object] KB article. h3. Steps to Reproduce # Install JIRA toolkit 0.35.10 or higher. # Create a "Last public comment date" custom field. # Go to issue search and include this field as a column on the search. # Run a search returning 50 or so issues (more than configured max connections in {{dbconfig.xml}}). h3. Expected Results JIRA indexes as per normal without any failures. h3. Actual Results The number of active connections in DBCP spikes and they are not released back into the connection pool. As a result of this the following exceptions will be thrown, affecting JIRA's functionality: {noformat} java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(ConnectionTracker.java:59) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.trackConnection(DBCPConnectionFactory.java:242) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:73) at org.ofbiz.core.entity.ConnectionFactory.tryGenericConnectionSources(ConnectionFactory.java:69) at org.ofbiz.core.entity.transaction.JNDIFactory.getConnection(JNDIFactory.java:146) at org.ofbiz.core.entity.TransactionFactory.getConnection(TransactionFactory.java:101) at org.ofbiz.core.entity.ConnectionFactory.getConnection(ConnectionFactory.java:59) at org.ofbiz.core.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:367) at org.ofbiz.core.entity.GenericDAO.select(GenericDAO.java:584) at org.ofbiz.core.entity.GenericHelperDAO.findByPrimaryKey(GenericHelperDAO.java:97) at org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:609) at org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:647) ... Caused by: org.apache.commons.dbcp.SQLNestedException: Cannot get a connection, pool error Timeout waiting for idle object at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:114) at org.apache.commons.dbcp.BasicDataSource.getConnection(BasicDataSource.java:1044) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory$1.call(DBCPConnectionFactory.java:246) at org.ofbiz.core.entity.transaction.DBCPConnectionFactory$1.call(DBCPConnectionFactory.java:243) at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(ConnectionTracker.java:53) ... 236 more Caused by: java.util.NoSuchElementException: Timeout waiting for idle object at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:1134) at org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool.java:79) at org.apache.commons.dbcp.PoolingDataSource.getConnection(PoolingDataSource.java:106) ... 240 more {noformat} h3. Workaround Downgrade JIRA Toolkit plugin to version 0.35.9 (compatible with JIRA Server 6.2 - 6.3.15) or disable the plugin. To disable: # Browse to the Add-on Manager. # Search for the JIRA Toolkit plugin and click on the disable button. # Reindex JIRA. To downgrade: # Browse to the Add-on Manager. # Uninstall the current version. # Download 0.35.9 from the [Atlassian Marketplace|https://marketplace.atlassian.com/download/plugins/com.atlassian.jira.toolkit/version/184]. # Manually upload the JAR as per [Installing add-ons|https://confluence.atlassian.com/display/UPM/Installing+add-ons#Installingadd-ons-Installingbyfileupload]. # Reindex JIRA.

    Atlassian JIRA | 2 years ago | Martin Sander
    java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool
  6. 0

    JIRA is running out of database connections frequently on MS SQL Server - Atlassian Documentation

    atlassian.com | 4 months ago
    java.lang.RuntimeException: Unable to obtain a connection from the underlying connection pool

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.RuntimeException

      Unable to obtain a connection from the underlying connection pool

      at org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection()
    2. org.ofbiz.core
      GenericDelegator.findByPrimaryKey
      1. org.ofbiz.core.entity.jdbc.interceptors.connection.ConnectionTracker.trackConnection(ConnectionTracker.java:59)
      2. org.ofbiz.core.entity.transaction.DBCPConnectionFactory.trackConnection(DBCPConnectionFactory.java:242)
      3. org.ofbiz.core.entity.transaction.DBCPConnectionFactory.getConnection(DBCPConnectionFactory.java:73)
      4. org.ofbiz.core.entity.ConnectionFactory.tryGenericConnectionSources(ConnectionFactory.java:69)
      5. org.ofbiz.core.entity.transaction.JNDIFactory.getConnection(JNDIFactory.java:146)
      6. org.ofbiz.core.entity.TransactionFactory.getConnection(TransactionFactory.java:101)
      7. org.ofbiz.core.entity.ConnectionFactory.getConnection(ConnectionFactory.java:59)
      8. org.ofbiz.core.entity.jdbc.SQLProcessor.getConnection(SQLProcessor.java:367)
      9. org.ofbiz.core.entity.GenericDAO.select(GenericDAO.java:584)
      10. org.ofbiz.core.entity.GenericHelperDAO.findByPrimaryKey(GenericHelperDAO.java:97)
      11. org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:609)
      12. org.ofbiz.core.entity.GenericDelegator.findByPrimaryKey(GenericDelegator.java:647)
      12 frames