Unable to connect to database, Could not retrieve a valid tenant
search cancel

Unable to connect to database, Could not retrieve a valid tenant


Article ID: 135606


Updated On:


Clarity PPM On Premise Clarity PPM SaaS


The services are not able to connect to database with messages similar to following: 

FATAL 2019-08-05 12:49:29,997 [BG Shutdown] union.persistence (clarity:none:none:none) Failed to initialize Context properties java.sql.SQLNonTransientConnectionException: [CA Clarity][Oracle JDBC Driver]CLARITYDB  at com.ca.clarity.jdbc.oraclebase.ddcr.b(Unknown Source) at com.ca.clarity.jdbc.oraclebase.ddcr.a(Unknown Source) at com.ca.clarity.jdbc.oraclebase.ddcq.b(Unknown Source) at com.ca.clarity.jdbc.oraclebase.ddcq.a(Unknown Source) at com.ca.clarity.jdbc.oracle.OracleImplConnection.y(Unknown Source) at com.ca.clarity.jdbc.oracle.OracleImplConnection.a(Unknown Source) at com.ca.clarity.jdbc.oracle.OracleImplConnection.ag(Unknown Source) at 

ERROR 2019-08-05 12:49:30,011 [Thread-5] persistence.PersistenceController (clarity:none:none:none) Exception due to DB Connection failure
ERROR 2019-08-05 12:49:30,011 [Thread-5] niku.security (clarity:none:none:none) UserSessionCache.get:PMD error com.niku.union.persistence.DBConnectionException: java.sql.SQLNonTransientConnectionException: [CA Clarity][Oracle JDBC Driver]CLARITYDB 
2019/08/05 15:56:16.841 | Could not perform an initTenant call for Tenant with Id = clarity 2019/08/05 15:56:16.841 | java.util.ConcurrentModificationException 2019/08/05 15:56:16.841 | at java.base/java.util.ArrayList$Itr.checkForComodification(ArrayList.java:1042) 2019/08/05 15:56:16.841 | at java.base/java.util.ArrayList$Itr.next(ArrayList.java:996) 2019/08/05 15:56:16.841 | at 

ERROR 2019-08-05 13:59:38,233 [https-jsse-nio-8243-exec-47] filter.RequestTenantIdExtractor (none:none:none:none) com.niku.union.config.ConfigurationException: Could not retrieve a valid tenant.
at com.niku.union.config.TenantConfigurationManager.getValidLocalTenant(TenantConfigurationManager.java:355) at com.niku.union.web.filter.RequestTenantIdExtractor.getTenantIdForRequest(RequestTenantIdExtractor.java:229) at com.niku.union.web.filter.TenantSetupFilter.doFilter(TenantSetupFilter.java:54) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)

ERROR 2022-01-30 09:17:40,804 [localhost-startStop-1] niku.union (none:none:none:none) Clarity 1x.x failed to initialize. 
com.niku.union.config.ConfigurationException: The application failed to start because of a database configuration problem.  Please review the application log for specific error information.
 at com.niku.union.config.ConfigurationManager.initAppServerType(ConfigurationManager.java:4166)


  1. Connect to CSA - Database and ensure the parameters are set up properly and that it shows Available.
  2. If the database is Not Available in NSA, ensure the parameters entered for connections are correct and restart the services after correcting it
  3. If updating the connection details does not work, check that you are able to connect to the database with the same JDBC line, outside and from the Clarity server
  4. Check with your network team to ensure that the database server hostname is resolvable and the server is accessible from the Clarity app server

Additional Information

If the issue started happening after a Distribute, check Unable to connect to database after Distribute