Exception: The data execution is not started because the data object is currently in error state. DataSource.updateSpec()

Viewed 504

Trying to assist an analyst with this error it's written in google app scripts. The job is scheduled every hour and it occasionally fails with. This executes a sql in bigquery and populates a google sheet.

Exception: The data execution is not started because the data object is currently in error state. Please check and update specification with DataSource.updateSpec(). at RefreshDataSource(macros:9:57)

You can rerun it and it works perfectly. Not sure where to start debugging this, any assistance is appreciated. I can run the query in BQ anytime.

 /** @OnlyCurrentDoc */

function RefreshDataSource() {
  var spreadsheet = SpreadsheetApp.getActive();
  spreadsheet.getRange('D1').activate();
  spreadsheet.getRange('A1').activate();
  spreadsheet.setActiveSheet(spreadsheet.getSheetByName('JIRA Security Review'), true);
  SpreadsheetApp.enableAllDataSourcesExecution();
  spreadsheet.getCurrentCell().getDataSourceTables()[0].refreshData();
};


1 Answers
Related