Article - CS273381
Error "FATAL: sorry, too many clients already" reported in PostgreSQL in ThingWorx Platform
Modified: 14-Dec-2020
Applies To
- ThingWorx Platform 8.2 to 9.5
- PostgreSQL
Description
- ThingWorx Platform is up and accessible but not usable due to the following error in Composer
- Unable to execute service SpotlightSearch on SearchFunctions : Unable to get search entries: [2,006] Unknown error occurred. Contact the administrator if this re-occurs.
- Error is reported in PostgreSQL periodically but not always
- FATAL: sorry, too many clients already
- Database connection fails with the following error in ThingworxStorage/logs/ErrorLog.log:
- java.sql.SQLException: Connections could not be acquired from the underlying database!
- <Apache Tomcat>\logs\catalina.out shows the following:
- java.lang.RuntimeException: com.thingworx.common.exceptions.DataAccessException: [2,006] Unknown error occurred. Contact the administrator if this re-occurs.
at com.thingworx.persistence.common.DataTableEngine.lambda$findEntries$11(DataTableEngine.java:237)
at com.thingworx.persistence.TransactionFactory.createDataTransactionAndReturn(TransactionFactory.java:161)
...
Caused by: com.thingworx.common.exceptions.DataAccessException: [2,006] Unknown error occurred. Contact the administrator if this re-occurs.
at com.thingworx.persistence.postgres.PostgresDataExceptionTranslator.rethrowTranslated(PostgresDataExceptionTranslator.java:27)
at com.thingworx.persistence.postgres.dao.PostgresDataTableDao.searchEntries(PostgresDataTableDao.java:292)
...
Caused by: java.sql.SQLException: Connections could not be acquired from the underlying database!
at com.mchange.v2.sql.SqlUtils.toSQLException(SqlUtils.java:118)
at com.mchange.v2.c3p0.impl.C3P0PooledConnectionPool.checkoutPooledConnection(C3P0PooledConnectionPool.java:692)
...
Caused by: com.mchange.v2.resourcepool.CannotAcquireResourceException: A ResourcePool could not acquire a resource from its primary factory or source.
at com.mchange.v2.resourcepool.BasicResourcePool.awaitAvailable(BasicResourcePool.java:1507)
at com.mchange.v2.resourcepool.BasicResourcePool.prelimCheckoutResource(BasicResourcePool.java:644)
...
Caused by: org.postgresql.util.PSQLException: The connection attempt failed.
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(ConnectionFactoryImpl.java:292)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactory.java:49)
...
Caused by: java.io.EOFException
at org.postgresql.core.PGStream.receiveChar(PGStream.java:308)
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(ConnectionFactoryImpl.java:499)
...
- java.lang.RuntimeException: com.thingworx.common.exceptions.DataAccessException: [2,006] Unknown error occurred. Contact the administrator if this re-occurs.
This is a printer-friendly version of Article 273381 and may be out of date. For the latest version click CS273381