Getjob query api giving status failed

Untitled Image

I am currently working with the Blackbaud SKY API to programmatically run Adhoc queries and retrieve constituent data. I am following the documented process using the following steps:
  1.Execute the query using the https://developer.sky.blackbaud.com/api#api=query&operation=StartQueryExecutionJob endpoint. This returns a job_id.
  2.Poll the job status using https://developer.sky.blackbaud.com/api#api=query&operation=GetJob . I call this endpoint every few seconds to check the current status.
  3.Once the status changes to "completed", I extract the sas_uri from the response and retrieve the resulting data.

This workflow works correctly for small datasets. i.e. 2000 constituents
However, I am facing a consistent failure when the result set is larger. i.e. 10000 constituents

Note: I am applying one of filter too for getting specific constituents.

I am doing this as I need to get more than 2000 records: https://kb.blackbaud.com/knowledgebase/articles/Article/205700


Here are the detailed symptoms:
  • The first few polling attempts return "status": "running".
  • After a few attempts, the status becomes "failed" and stays that way permanently.
  • There is no detailed error message or explanation provided in the job status response.

My current hypothesis is that the query job may be failing due to one or more of the following reasons:
  • A timeout or execution time limit on the backend when the result set is large.
  • Memory or resource limits on the server during large query processing.
  • A limit on the number of constituents or rows returned per query.

I would appreciate guidance on the following points:
  • Are there any known limits on the size, execution time, or result count for Adhoc query jobs?
  • Is there a recommended way to avoid this failure?
  • Is there any way to retrieve logs or diagnostic information for a failed query job to understand why it failed?

Thanks

Answers