cube-js/cube · error
Export bucket is not configured.
Error message
Export bucket is not configured.
What it means
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.
Source
Thrown at packages/cubejs-athena-driver/src/AthenaDriver.ts:481
};
return promise;
}
/**
* Determines whether export bucket feature is configured or not.
*/
public async isUnloadSupported() {
return this.config.exportBucket !== undefined;
}
/**
* Returns to the Cubestore an object with links to unloaded to the
* export bucket data.
*/
public async unload(tableName: string, options: UnloadOptions): Promise<DownloadTableCSVData> {
if (!this.config.exportBucket) {
throw new Error('Export bucket is not configured.');
}
const types = options.query
? await this.unloadWithSql(tableName, options)
: await this.unloadWithTable(tableName);
const csvFile = await this.getCsvFiles(tableName);
return {
exportBucketCsvEscapeSymbol: this.config.exportBucketCsvEscapeSymbol,
csvFile,
types,
csvNoHeader: true,
csvDelimiter: '^A',
csvDisableQuoting: true,
};
}
/**
* Unload data from a SQL query to an export bucket.
*/View on GitHub (pinned to 7d981676b3)
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
Example fix
// before
new AthenaDriver({ ...awsConfig })
// after
new AthenaDriver({ ...awsConfig, exportBucket: { bucket: 'my-cube-export-bucket', region: 'us-east-1' } }) Defensive patterns
Strategy: validation
Validate before calling
if (!process.env.CUBEJS_EXPORT_BUCKET && !driverConfig.exportBucket) {
throw new Error('exportBucket must be configured for Athena unload with CubeStore')
} Type guard
function hasExportBucket(c: any): c is { exportBucket: { bucket: string } } {
return typeof c?.exportBucket?.bucket === 'string' && c.exportBucket.bucket.length > 0
} Try / catch
try {
await driver.unload(tableName, options)
} catch (e) {
if (/Export bucket is not configured/.test(e.message)) {
console.error('Configure exportBucket in the Athena driver options')
}
throw e
} Prevention
- 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
When it happens
Trigger: CubeStore (or orchestrator) requests an unload operation for a table while the Athena driver config lacks an exportBucket definition.
Common situations: 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.
Understand the failure class
Background: "environment variable is not set" and "Missing keys in environment" errors: what missing required env var messages mean and how to fix them — this error's family across 28 libraries.
Related errors
- Unload is not configured. Please define CUBEJS_AWS_S3_OUTPUT
- Unable to retrieve list of files from S3 storage after unloa
- Unload is not configured
- Query must be defined in options
- Unload is not configured
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/30b30d195257f222.
Report an issue: GitHub.