{"record":{"id":"30b30d195257f222","repo":"cube-js/cube","slug":"export-bucket-is-not-configured","errorCode":null,"errorMessage":"Export bucket is not configured.","messagePattern":"Export bucket is not configured\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-athena-driver/src/AthenaDriver.ts","lineNumber":481,"sourceCode":"    };\n\n    return promise;\n  }\n\n  /**\n   * Determines whether export bucket feature is configured or not.\n   */\n  public async isUnloadSupported() {\n    return this.config.exportBucket !== undefined;\n  }\n\n  /**\n   * Returns to the Cubestore an object with links to unloaded to the\n   * export bucket data.\n   */\n  public async unload(tableName: string, options: UnloadOptions): Promise<DownloadTableCSVData> {\n    if (!this.config.exportBucket) {\n      throw new Error('Export bucket is not configured.');\n    }\n    const types = options.query\n      ? await this.unloadWithSql(tableName, options)\n      : await this.unloadWithTable(tableName);\n    const csvFile = await this.getCsvFiles(tableName);\n    return {\n      exportBucketCsvEscapeSymbol: this.config.exportBucketCsvEscapeSymbol,\n      csvFile,\n      types,\n      csvNoHeader: true,\n      csvDelimiter: '^A',\n      csvDisableQuoting: true,\n    };\n  }\n\n  /**\n   * Unload data from a SQL query to an export bucket.\n   */","sourceCodeStart":463,"sourceCodeEnd":499,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-athena-driver/src/AthenaDriver.ts#L463-L499","documentation":"unload() exports table data to an S3 export bucket for CubeStore to consume. It requires config.exportBucket to be configured; when absent it throws 'Export bucket is not configured.' before attempting unloadWithSql/unloadWithTable.","triggerScenarios":"CubeStore (or orchestrator) requests an unload operation for a table while the Athena driver config lacks an exportBucket definition.","commonSituations":"Missing exportBucket config in driver options, missing CUBEJS_EXPORT_BUCKET / related env vars in deployment, or switching to CubeStore-backed pre-aggregations without updating driver config.","solutions":["Configure exportBucket in the AthenaDriver constructor config (bucket, and optionally credentials/region for it)","Set the corresponding env vars (e.g. CUBEJS_EXPORT_BUCKET and related S3 settings) in the deployment","Verify IAM permissions on the export bucket for both Cube and Athena write paths"],"exampleFix":"// before\nnew AthenaDriver({ ...awsConfig })\n// after\nnew AthenaDriver({ ...awsConfig, exportBucket: { bucket: 'my-cube-export-bucket', region: 'us-east-1' } })","handlingStrategy":"validation","validationCode":"if (!process.env.CUBEJS_EXPORT_BUCKET && !driverConfig.exportBucket) {\n  throw new Error('exportBucket must be configured for Athena unload with CubeStore')\n}","typeGuard":"function hasExportBucket(c: any): c is { exportBucket: { bucket: string } } {\n  return typeof c?.exportBucket?.bucket === 'string' && c.exportBucket.bucket.length > 0\n}","tryCatchPattern":"try {\n  await driver.unload(tableName, options)\n} catch (e) {\n  if (/Export bucket is not configured/.test(e.message)) {\n    console.error('Configure exportBucket in the Athena driver options')\n  }\n  throw e\n}","preventionTips":["Define exportBucket whenever CubeStore pre-aggregations are used with Athena","Verify the export bucket exists and IAM roles can write to it before rollout","Keep export bucket config in the same config module as other Athena settings to avoid drift"],"tags":["athena","configuration","s3","unload"],"backgroundTag":"missing-env-var","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}