Article - CS345780

"Execute Query failed: org.postgresql.util.PSQLException: ERROR: canceling statement due to user request" is logged in the ErrorLog.log when a Service or Subscription fails to execute in ThingWorx Platform

Modified: 25-Jul-2025   


Applies To

  • ThingWorx Platform 8.5 to 10.0
  • PostgreSQL

Description

  • SQL query failed when the query takes long time to proceed
  • ThingWorx Platform becomes unresponsive after it appeared that the Event Processing Subsystem backed up to maximum queue size
  • Subscription that updates Thing configurations (e.g. Property, Alerts, Events) by iterating over a large list of Things is not completing as expected due to a PostgreSQL timeout error
  • Executing a Service, Subscription or SQL Command Service takes an extended period of time to return and eventually gives a 1,018 error in ThingWorx Platform
  • Suddenly seeing several generic [1,018] Data store unknown error messages are being logged in the ApplicationLog of ThingWorx Platform
  • PTC Cloud Services has reported a Catchpoint Monitor - !DOWN alert after the Event Processing Subsystem queue backed up due to slow execution of database commands in ThingWorx Platform
  • Custom Service code that iterates over an out of the box ThingWorx API to insert or update rows in a ThingWorx Platform database table does not seem performant enough to handle current use case
  • Seeing repeated messages about database commands resulting from Service calls being cancelled, despite the fact a user is not manually terminating the statements
  • ThingWorx Platform logs located in <ThingworxStorage>\logs show the following:
    •  ApplicationLog.log
      • [L: ERROR] [O: c.t.p.p.PostgresModelExceptionTranslator] [I: ] [U: Administrator] [S: ] [P: ] [T: TWEventProcessor-<Number>] [1,018] Data store unknown error: [Error occurred while accessing the model provider.]
    • ErrorLog.log (with Error stack tracing enabled in the LoggingSubsystem)
      • [L: ERROR] [O: E.c.t.p.p.PostgresModelExceptionTranslator] [I: ] [U: Administrator] [S: ] [P: ] [T: TWEventProcessor-<Number>] ERROR: current transaction is aborted, commands ignored until end of transaction block 
        [L: ERROR] [O: E.c.q.l.c.Logger] [I: ] [U: Administrator] [S: ] [P: ] [T: TWEventProcessor-<Number>] [1,018] Data store unknown error: [Error occurred while accessing the model provider.] org.postgresql.util.PSQLException: ERROR: canceling statement due to user request
          Where: while locking tuple <Tuple> in relation "<Table>"
        	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
        	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
        	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
        	...
        Wrapped by: org.postgresql.util.PSQLException: ERROR: current transaction is aborted, commands ignored until end of transaction block
        	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
        	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
        	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
        	...
        Wrapped by: com.thingworx.common.exceptions.ModelAccessException: [1,018] Data store unknown error: [Error occurred while accessing the model provider.]
        	at com.thingworx.persistence.postgres.PostgresModelExceptionTranslator.rethrowTranslated(PostgresModelExceptionTranslator.java:31)
        	at com.thingworx.persistence.postgres.PostgresDocumentModelDriver.setProperty(PostgresDocumentModelDriver.java:230)
        	at com.thingworx.persistence.documentmodel.LoggingDocumentModelDriver.setProperty(LoggingDocumentModelDriver.java:129)
        	...
      •  Where
        • <Tuple> is the tuple that must be locked to perform the command
        • <Table> is the table the command was being performed on
This is a printer-friendly version of Article 345780 and may be out of date. For the latest version click CS345780