Skip to main content
Question

CogniteApiError - 408 - Graph Query Timed out

  • October 28, 2025
  • 2 replies
  • 34 views


Hello,
We are querying the view WfAlarms (structure as given below) which has direct reference to alarmCode. When we are querying it for say 3+ months, we get the CogniteApiError, but works fine when it is 1month. This error is seen in our application deployed in production. 

We expect almost 2 million of records in this view. Can you help to understand what can be done to fix this issue ? Any configuration that needs to be changed. Let me know if you need any other details.


1. Properties being queried from view - WfAlarms
 




Error



View:

type WfAlarms @view(version: "2") @container(indexes: [{identifier : "entityName", fields : ["entityName"], cursorable : true}, {identifier : "entityExternalId", fields : ["entityExternalId"], cursorable : true}, {identifier : "alarmFlags", fields : ["alarmFlags"], cursorable : true}, {identifier : "entityType", fields : ["entityType"], cursorable : true}, {identifier : "alarmCode", fields : ["alarmCode"], cursorable : true}, {identifier : "startDateTime", fields : ["startDateTime"], cursorable : true}, {identifier : "endDateTime", fields : ["endDateTime"], cursorable : true}]) {

  entityName: String!

  entityExternalId: String!

  entityType: String!

  startDateTime: Timestamp!

  endDateTime: Timestamp!

  alarmFlags: String

  operationType: String

  alarmCounter: Int!

  ticketId: String

  alarmCode: AlarmDefinition

  removeAlaramForUser: JSONObject

  markAsRead: JSONObject

  customWorkflowAlarmMessage: String!

  ssWorkflowAlarmMessage: String

  relatedEntity: String

  relatedEntityExternalId: String

  additionalInformation: JSONObject

}

 

type AlarmDefinition @view(version: "1") @container(indexes: [{identifier : "alarmName", fields : ["alarmName"], cursorable : true}]) {

  alarmName: String

  alarmMessage: String

  alarmMsgParameter: String

  alarmCategory: String

  alarmDescription: String

  workflowCode: String

  workflowName: String

  alarmPriority: String

  alarmCriticality: String

  isAlarmTicket: String

  alarmCounterToTicket: Int

  alarmDataSource: String

  alarmType: String

  ticketAsset: String

  ticketDept: String

  ticketAssignedTo: String

  ticketAssignedGroup: String

  ticketRecommedation: String

  subCategory: String

  subWorkflowName: String

  alarmUnifiedCode: String

  alarmTypeCategory: String

  alarmTypeSubCategory: String

}

​​​​​​@Akash Sood  - Can you add the cognite project name in the comments. They can track the request from the x-request-id in the logs and check in the logs at their side.

2 replies

Arild  Eide
Seasoned Practitioner
Forum|alt.badge.img
  • Seasoned Practitioner
  • October 28, 2025

Hi ​@Neerajkumar Bhatewara 

The query hint that is returned as part of the 408 response does not reveal the actual reason for the time out. It would be useful to see the actual query if you are able to obtain it, in particular to the filters and any sorts applied.

This article on query performance troubleshooting is also relevant, if you haven’t seen already. By including the alpha-header you can get hold of the actual database query and the query plan, which should provide more insights.

Support for query debug notices was added to the Python SDK in 7.85 (late September).

 

Please keep us updated. 

 

Arild Eide


Akash Sood
MVP
Forum|alt.badge.img+3
  • MVP
  • November 4, 2025

@Neerajkumar Bhatewara we can add query debug and also get execution plan from postgres according to the article shared above