LinkedIn
Copied!

OPS0020: Database connection state issue

Pega Predictive Diagnostic Cloud™ (PDC) generates the OPS0020 event when an application reports issues with database connectivity.

Reason for the event

When a connection to the PostgreSQL database system fails at any point, Pega Platform™ generates a com.pega.pegarules.pub.database.ConnectionException exception. To track this exception, PDC generates an OPS0020 event, and creates a unique DBConnectionstate- case for each database for which the exception occurs.

To learn more about the reasons and circumstances behind OPS0020 and related events, see PDC use case PEGA0026, OPS0020, OPS0007: Objective and background.

Example stack trace

[MSG][obj-save failed.][STACK][com.pega.pegarules.pub.database.DatabaseException: Database-General	Non Retryable Exception		Database-General	Problem writing an instance to the database	0	08003	This connection has been closed.
DatabaseException caused by prior exception: org.postgresql.util.PSQLException: This connection has been closed.
 | SQL Code: 0 | SQL State: 08003

DatabaseException caused by prior exception: com.pega.pegarules.pub.database.ConnectionException: Database-General	Problem writing an instance to the database	0	08003	This connection has been closed.
DatabaseException caused by prior exception: org.postgresql.util.PSQLException: This connection has been closed.
 | SQL Code: 0 | SQL State: 08003

From: (AY2ZC8L3OKO9OOTJ9S9PCSM4119M2PDNCA:PegaAES) 
	SQL: INSERT INTO pegadata.pegaam_index_events (pzInsKey , pzTenantId , pxCommitDateTime , "clustername" , "correlationid" , "crossclustercorrelation" , "eventtype" , "generateddatetime" , "interaction" , "iscriticalalert" , "ismaintenancemode" , "kpivalue" , "line" , "msgid" , "operatorid" , "partitionid" , "problemcorrelation" , "pxcreatedatetime" , "pxcreateoperator" , "pxcreateopname" , "pxcreatesystemid" , "pxindexcount" , "pxindexpurpose" , "pxinsindexedclass" , "pxinsindexedkey" , "pxinsname" , "pxobjclass" , "pxsavedatetime" , "pxupdatedatetime" , "pxupdateoperator" , "pxupdateopname" , "pxupdatesystemid" , "pylabel" , "pyrulesetname" , "requestorid" , "requestortype" , "rootexceptionclass" , "rootexceptionmessage" , "ruleapplication" , "serverid") VALUES (? , ? , CURRENT_TIMESTAMP , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?)
	SQL Inserts: 	<22534353820ca5d72ae77f3ff13c0507>					<2020-11-25 11:48:03.031>	<1>			<780>				<25>		<>	<>	<>	<>	<0>						<2020-11-25 11:49:05.678>	<>	<>	<>	<>		<>			<>	<>			

Caused by SQL Problems.
Problem #1, SQLState 08003, Error code 0: org.postgresql.util.PSQLException: This connection has been closed.

DatabaseException caused by prior exception: org.postgresql.util.PSQLException: This connection has been closed.
 | SQL Code: 0 | SQL State: 08003

From: (AY2ZC8L3OKO9OOTJ9S9PCSM4119M2PDNCA:PegaAES) 
	at com.pega.pegarules.data.internal.store.RetryPolicy.tryAgainOrFail(RetryPolicy.java:149)
	at com.pega.pegarules.data.internal.store.DataStoreManager.doInTransaction(DataStoreManager.java:303)
	at com.pega.pegarules.data.internal.access.UpdateProcessor.processUpdates(UpdateProcessor.java:211)
	at com.pega.pegarules.data.internal.access.Saver.save(Saver.java:747)
	at com.pega.pegarules.data.internal.access.Saver.save(Saver.java:1794)
	at com.pega.pegarules.data.internal.access.DatabaseImpl.save(DatabaseImpl.java:2895)
	at com.pega.pegarules.data.internal.access.DatabaseImpl.save(DatabaseImpl.java:2886)
	at com.pega.pegarules.data.internal.access.DatabaseImpl.save(DatabaseImpl.java:2876)
	at com.pegarules.generated.activity.ra_action_parsealertline_0e5be74f76a1f1021a8d6c4190460bc2.step68_circum0(ra_action_parsealertline_0e5be74f76a1f1021a8d6c4190460bc2.java:6179)
	at com.pegarules.generated.activity.ra_action_parsealertline_0e5be74f76a1f1021a8d6c4190460bc2.perform(ra_action_parsealertline_0e5be74f76a1f1021a8d6c4190460bc2.java:1454)
	at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2821)
	at com.pega.pegarules.session.internal.mgmt.Executable.invokeActivity(Executable.java:11429)
	at com.pegarules.generated.activity.ra_action_processevent_fa11e38836e54517f47dccf38ce554a2.step6_circum0(ra_action_processevent_fa11e38836e54517f47dccf38ce554a2.java:511)
	at com.pegarules.generated.activity.ra_action_processevent_fa11e38836e54517f47dccf38ce554a2.perform(ra_action_processevent_fa11e38836e54517f47dccf38ce554a2.java:161)
	at com.pega.pegarules.session.internal.mgmt.Executable.doActivity(Executable.java:2821)
	at com.pega.pegarules.session.internal.mgmt.base.ThreadRunner.runActivitiesAlt(ThreadRunner.java:653)
	at com.pega.pegarules.session.internal.mgmt.PRThreadImpl.runActivitiesAlt(PRThreadImpl.java:520)
	at com.pega.pegarules.integration.engine.internal.RuleExecutionUtils.runServiceActivity(RuleExecutionUtils.java:435)
	at com.pega.pegarules.integration.engine.internal.services.ServiceAPI.runActivities(ServiceAPI.java:2079)
	at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequestInner(EngineAPI.java:445)
	at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at com.pega.pegarules.session.internal.PRSessionProviderImpl.performTargetActionWithLock(PRSessionProviderImpl.java:1399)
	at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:1131)
	at com.pega.pegarules.session.internal.PRSessionProviderImpl.doWithRequestorLocked(PRSessionProviderImpl.java:985)
	at com.pega.pegarules.session.external.engineinterface.service.EngineAPI.processRequest(EngineAPI.java:368)
	at com.pega.pegarules.integration.engine.internal.services.ServiceAPI.processRequest(ServiceAPI.java:3583)
	at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.handleRequest(JMSListener.java:1287)
	at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.processMessages(JMSListener.java:859)
	at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.runPoller(JMSListener.java:762)
	at com.pega.pegarules.integration.engine.internal.services.jms.JMSListener.run_(JMSListener.java:754)
	at com.pega.pegarules.integration.engine.internal.services.listener.ServiceListenerBaseImpl.run(ServiceListenerBaseImpl.java:476)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.pega.pegarules.pub.database.ConnectionException: Database-General	Problem writing an instance to the database	0	08003	This connection has been closed.
DatabaseException caused by prior exception: org.postgresql.util.PSQLException: This connection has been closed.
 | SQL Code: 0 | SQL State: 08003

From: (AY2ZC8L3OKO9OOTJ9S9PCSM4119M2PDNCA:PegaAES) 
	SQL: INSERT INTO pegadata.pegaam_index_events (pzInsKey , pzTenantId , pxCommitDateTime , "clustername" , "correlationid" , "crossclustercorrelation" , "eventtype" , "generateddatetime" , "interaction" , "iscriticalalert" , "ismaintenancemode" , "kpivalue" , "line" , "msgid" , "operatorid" , "partitionid" , "problemcorrelation" , "pxcreatedatetime" , "pxcreateoperator" , "pxcreateopname" , "pxcreatesystemid" , "pxindexcount" , "pxindexpurpose" , "pxinsindexedclass" , "pxinsindexedkey" , "pxinsname" , "pxobjclass" , "pxsavedatetime" , "pxupdatedatetime" , "pxupdateoperator" , "pxupdateopname" , "pxupdatesystemid" , "pylabel" , "pyrulesetname" , "requestorid" , "requestortype" , "rootexceptionclass" , "rootexceptionmessage" , "ruleapplication" , "serverid") VALUES (? , ? , CURRENT_TIMESTAMP , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ? , ?)
	SQL Inserts: 	<22534353820ca5d72ae77f3ff13c0507>					<2020-11-25 11:48:03.031>	<1>			<780>				<25>		<>	<>	<>	<>	<0>						<2020-11-25 11:49:05.678>	<>	<>	<>	<>		<>			<>	<>			

Caused by SQL Problems.
Problem #1, SQLState 08003, Error code 0: org.postgresql.util.PSQLException: This connection has been closed.
	at com.pega.pegarules.data.internal.access.ExceptionInformation.createAppropriateExceptionDueToDBFailure(ExceptionInformation.java:379)
	at com.pega.pegarules.data.internal.access.ExceptionInformation.createExceptionDueToDBFailure(ExceptionInformation.java:364)
	at com.pega.pegarules.data.internal.access.Saver.insertInstance(Saver.java:1099)
	at com.pega.pegarules.data.internal.access.Saver.saveInstance(Saver.java:976)
	at com.pega.pegarules.data.internal.access.Saver.saveInstance(Saver.java:873)
	at com.pega.pegarules.data.internal.access.UpdateProcessor.performOps(UpdateProcessor.java:1585)
	at com.pega.pegarules.data.internal.access.UpdateProcessor.action(UpdateProcessor.java:281)
	at com.pega.pegarules.data.internal.access.UpdateProcessor.action(UpdateProcessor.java:94)
	at com.pega.pegarules.data.internal.store.DataStoreManager.doInTransaction(DataStoreManager.java:275)
	... 32 more
Caused by: org.postgresql.util.PSQLException: This connection has been closed.
	at org.postgresql.jdbc.PgConnection.checkClosed(PgConnection.java:782)
	at org.postgresql.jdbc.PgConnection.releaseSavepoint(PgConnection.java:1658)
	at sun.reflect.GeneratedMethodAccessor141.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.apache.tomcat.jdbc.pool.ProxyConnection.invoke(ProxyConnection.java:126)
	at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
	at org.apache.tomcat.jdbc.pool.interceptor.AbstractCreateStatementInterceptor.invoke(AbstractCreateStatementInterceptor.java:79)
	at org.apache.tomcat.jdbc.pool.JdbcInterceptor.invoke(JdbcInterceptor.java:108)
	at org.apache.tomcat.jdbc.pool.DisposableConnectionFacade.invoke(DisposableConnectionFacade.java:81)
	at com.sun.proxy.$Proxy4.releaseSavepoint(Unknown Source)
	at com.pega.pegarules.data.internal.store.DatabaseConnectionImpl.releaseSavepoint(DatabaseConnectionImpl.java:1011)
	at com.pega.pegarules.data.internal.access.postgres.SQLGeneratorPostgres.releaseSavepoint(SQLGeneratorPostgres.java:106)
	at com.pega.pegarules.data.internal.access.Saver.executeUpdate(Saver.java:1533)
	at com.pega.pegarules.data.internal.access.Saver.insertInstance(Saver.java:1081)
	... 38 more

Recommended next steps

If the OPS0020 event occurs more than once, restart the node. If you are a Pega Cloud® Services client, contact Pega Support.

Suggest Edit

Related Content

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.