cube-js/cube · error

Unsupported export bucket type: ${this.config.bucketType}

Error message

Unsupported export bucket type: ${this.config.bucketType}

What it means

When an export bucket is configured, PrestoDriver.unload validates that the bucketType is one of SUPPORTED_BUCKET_TYPES (e.g. s3/gcs/azure). An unsupported bucketType string throws this error before any export is attempted.

Source

Thrown at packages/cubejs-prestodb-driver/src/PrestoDriver.ts:378

  public async createSchemaIfNotExists(schemaName: string) {
    await this.query(
      `CREATE SCHEMA IF NOT EXISTS ${this.config.catalog}.${schemaName}`,
      [],
    );
  }

  // Export bucket methods
  public async isUnloadSupported() {
    return this.config.exportBucket !== undefined;
  }

  public async unload(tableName: string, options: UnloadOptions) {
    if (!this.config.exportBucket) {
      throw new Error('Export bucket is not configured.');
    }

    if (!SUPPORTED_BUCKET_TYPES.includes(this.config.bucketType as string)) {
      throw new Error(`Unsupported export bucket type: ${this.config.bucketType}`);
    }

    const types = options.query
      ? await this.unloadWithSql(tableName, options.query.sql, options.query.params)
      : await this.unloadWithTable(tableName);

    const csvFile = await this.getCsvFiles(tableName);

    return {
      exportBucketCsvEscapeSymbol: this.config.exportBucketCsvEscapeSymbol,
      csvFile,
      types,
      csvNoHeader: true,
    };
  }

  private splitTableFullName(tableFullName: string) {
    const [schema, tableName] = tableFullName.split('.');

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Set bucketType to one of the supported values (check SUPPORTED_BUCKET_TYPES: s3, gcs, azure)
  2. Fix the typo in the exportBucket configuration
  3. Upgrade the driver package if your storage backend's bucket type is supported only in newer versions

Example fix

// before
exportBucket: { bucketType: 'aws', 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(driver.config?.exportBucket?.bucketType)) {
  throw new Error(`bucketType must be one of ${SUPPORTED.join(', ')}`);
}

Type guard

const isSupportedBucketType = (t) => typeof t === 'string' && ['s3','gcs','azure'].includes(t.toLowerCase());

Try / catch

try {
  await driver.unload(tableName, options);
} catch (e) {
  if (String(e.message).startsWith('Unsupported export bucket type')) {
    console.error(`Fix exportBucket.bucketType; got: ${e.message}`);
  }
  throw e;
}

Prevention

When it happens

Trigger: Setting PrestoDriver exportBucket.bucketType to a typo'd or unsupported value (e.g. 's', 'aws', 'blob') and then triggering unload via the query/download pipeline.

Common situations: Typo in bucket type config; copying config from another driver that supports a different bucket type set; newer/older driver versions where the supported list differs.

Related errors


AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02). Data as JSON: /api/errors/1ff783e5b6aa3918. Report an issue: GitHub.