cube-js/cube · error
Unsupported export bucket type: ${bucketType}
Error message
Unsupported export bucket type: ${bucketType} What it means
getCsvFiles switches on bucketType to determine how to access exported CSV files (gcs, s3, azure, etc.). The default branch throws 'Unsupported export bucket type: <bucketType>' when the configured type does not match any known handler — a second, independent validation from the one in unload().
Source
Thrown at packages/cubejs-prestodb-driver/src/PrestoDriver.ts:490
const { bucketType, exportBucket } = this.config;
const { schema, tableName } = this.splitTableFullName(tableFullName);
switch (bucketType) {
case 'gcs':
return this.extractFilesFromGCS({ credentials: this.config.credentials }, exportBucket, `${schema}/${tableName}`);
case 's3':
return this.extractUnloadedFilesFromS3({
credentials: this.config.accessKeyId && this.config.secretAccessKey
? {
accessKeyId: this.config.accessKeyId,
secretAccessKey: this.config.secretAccessKey,
}
: undefined,
region: this.config.exportBucketRegion,
},
exportBucket, `${schema}/${tableName}`);
default:
throw new Error(`Unsupported export bucket type: ${bucketType}`);
}
}
}
View on GitHub (pinned to 7d981676b3)
Solutions
- Use an exact, lowercase supported bucketType value (e.g. 's3', 'gcs', 'azure')
- Align the driver version so unload and getCsvFiles support the same bucket types
- Log/print config.exportBucket to confirm what value is actually being read at runtime
Example fix
// before
exportBucket: { bucketType: 'S3', bucket: 'my-bucket' }
// after
exportBucket: { bucketType: 's3', bucket: 'my-bucket', region: 'us-east-1' } Defensive patterns
Strategy: validation
Validate before calling
const SUPPORTED = ['s3', 'gcs', 'azure'];
if (!SUPPORTED.includes(String(driver.config?.exportBucket?.bucketType))) {
throw new Error(`Unsupported bucketType for CSV fetch: ${driver.config?.exportBucket?.bucketType}`);
} Type guard
const csvCapableBucket = (cfg) => ['s3','gcs','azure'].includes(String(cfg?.exportBucket?.bucketType));
Try / catch
try {
const files = await driver.csvFile(tableName);
} catch (e) {
if (String(e.message).startsWith('Unsupported export bucket type')) {
console.error('Normalize bucketType to a lowercase supported value');
}
throw e;
} Prevention
- Normalize bucketType to lowercase at config load time
- Keep unload and getCsvFiles supported-type expectations in sync via tests
- Avoid hand-editing bucketType values in production config
When it happens
Trigger: exportBucket.bucketType holding an unrecognized value when getCsvFiles enumerates files after an export, even if the value slipped past other checks (or the supported list differs between unload and getCsvFiles code paths).
Common situations: Case mismatches (e.g. 'S3' vs 's3'); bucket types supported in unload but not yet in getCsvFiles due to version drift; hand-edited config values.
Related errors
- Unsupported export bucket type: ${this.config.bucketType}
- Export bucket is not configured.
- Unsupported EXPORT_BUCKET_TYPE, supported: ${SUPPORTED_BUCKE
- Can't parse date: '${from}'
- Can't parse date: '${to}'
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/0c72a4fa24558e1d.
Report an issue: GitHub.