{"record":{"id":"64cac47800822e0f","repo":"cube-js/cube","slug":"query-was-cancelled-64cac4","errorCode":null,"errorMessage":"Query was cancelled","messagePattern":"Query was cancelled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts","lineNumber":1029,"sourceCode":"      }\n    });\n  }\n\n  protected executeCancelable<R>(\n    connectionPromise: Promise<Connection>,\n    options: Omit<StatementOption, 'complete'>,\n    onComplete: (stmt: RowStatement, rows: any[] | undefined) => R | PromiseLike<R>,\n  ): CancelablePromise<R> {\n    let stmt: RowStatement | undefined;\n    let cancelled = false;\n    let settled = false;\n\n    const promise = <CancelablePromise<R>>(async () => {\n      const connection = await connectionPromise;\n\n      if (cancelled) {\n        // Cancelled while we were still connecting - never issue the statement.\n        throw new Error('Query was cancelled');\n      }\n\n      return new Promise<R>((resolve, reject) => {\n        stmt = connection.execute({\n          ...options,\n          complete: (err, statement, rows) => {\n            settled = true;\n\n            if (cancelled) {\n              // Snowflake reports its own `SQL execution canceled.` here.\n              // Normalize it so callers see one consistent message, and so a\n              // query that happened to succeed microseconds before the abort\n              // landed does not return a result nobody is waiting for anymore.\n              reject(new Error('Query was cancelled'));\n              return;\n            }\n\n            if (err) {","sourceCodeStart":1011,"sourceCodeEnd":1047,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts#L1011-L1047","documentation":"Sentinel error in SnowflakeDriver.executeCancelable: the CancelablePromise wrapper tracked a cancellation that happened while the driver was still awaiting the Connection promise. Instead of opening a connection just to immediately cancel, the wrapper throws this error without ever issuing the SQL statement.","triggerScenarios":"Thrown at packages/cubejs-snowflake-driver/src/SnowflakeDriver.ts:1029 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Handle this error in callers that cancel queries (e.g. timeouts or client aborts); it signals the query never ran, not a driver failure.","If cancellations are unexpected, review orchestrator query timeouts and request cancellation settings.","Retry the query with a longer timeout if cancellation was caused by a premature timeout."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}