{"record":{"id":"e9958a66b73dbf8c","repo":"cube-js/cube","slug":"error","errorCode":null,"errorMessage":"error","messagePattern":"error","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-mysql-aurora-serverless-driver/driver/AuroraServerlessMySqlDriver.js","lineNumber":136,"sourceCode":"      return this.cancelCombinator(async saveCancelFn => {\n        await saveCancelFn(this.query(`${loadSql} LIMIT 0`, params));\n        await saveCancelFn(this.query(loadSql.replace(/^CREATE TABLE (\\S+) AS/i, 'INSERT INTO $1'), params));\n      });\n    }\n    return super.loadPreAggregationIntoTable(preAggregationTableName, loadSql, params, tx);\n  }\n\n  async downloadQueryResults(query, values) {\n    if (!this.config.database) {\n      throw new Error('Default database should be defined to be used for temporary tables during query results downloads');\n    }\n    const tableName = crypto.randomBytes(10).toString('hex');\n\n    const transaction = this.dataApi.transaction()\n      .query(`CREATE TEMPORARY TABLE \\`${this.config.database}\\`.t_${tableName} AS ${query} LIMIT 0`, values)\n      .query(`DESCRIBE \\`${this.config.database}\\`.t_${tableName}`)\n      .query(`DROP TEMPORARY TABLE \\`${this.config.database}\\`.t_${tableName}`)\n      .rollback((error) => { if (error) throw new Error(error); });\n\n    const results = await transaction.commit();\n    const columns = results[1].records;\n\n    const types = columns.map(c => ({ name: c.Field, type: this.toGenericType(c.Type) }));\n\n    return {\n      rows: await this.query(query, values),\n      types,\n    };\n  }\n\n  toColumnValue(value, genericType) {\n    if (genericType === 'timestamp' && typeof value === 'string') {\n      return value && value.replace('Z', '');\n    }\n    if (genericType === 'boolean' && typeof value === 'string') {\n      if (value.toLowerCase() === 'true') {","sourceCodeStart":118,"sourceCodeEnd":154,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-mysql-aurora-serverless-driver/driver/AuroraServerlessMySqlDriver.js#L118-L154","documentation":"A generic rethrow in the Aurora Serverless (Data API) driver's downloadQueryResults path: an unspecified 'error' is raised when the temporary-table-based download flow fails — typically during temp table creation, staging, or the Data API batch execute of the download statements. Because the message is a bare sentinel, the actionable detail is the underlying cause: the download requires a configured default database, working temp-table DDL privileges, and reachable Data API endpoints.","triggerScenarios":"Thrown at packages/cubejs-mysql-aurora-serverless-driver/driver/AuroraServerlessMySqlDriver.js:136 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is the catch-all of downloadQueryResults; inspect the wrapped error to find whether the CREATE TABLE, INSERT, or SELECT on the random temp table failed","Ensure the configured default database exists and the Aurora user has CREATE/INSERT/SELECT privileges on it","Check the Data API call throttling (Aurora Serverless) — reduce concurrent statements or enable the loadPreAggregationWithoutMetaLock path"],"exampleFix":null,"handlingStrategy":"try-catch","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"}