cube-js/cube · error

Unsupported EXPORT_BUCKET_TYPE, supported: ${SUPPORTED_BUCKE

Error message

Unsupported EXPORT_BUCKET_TYPE, supported: ${SUPPORTED_BUCKET_TYPES.join(',')}

What it means

The driver's exportBucket (unload to cloud storage) feature only supports a fixed set of bucket types (S3, GCS, Azure via SUPPORTED_BUCKET_TYPES). This error is thrown in getExportBucket() during driver construction when the configured EXPORT_BUCKET_TYPE is not one of the supported values.

Source

Thrown at packages/cubejs-clickhouse-driver/src/ClickHouseDriver.ts:542

    const requiredExportBucket: ClickhouseDriverExportRequiredAWS = {
      bucketType: getEnv('dbExportBucketType', {
        supported: SUPPORTED_BUCKET_TYPES,
        dataSource,
        preAggregations,
      }),
      bucketName: getEnv('dbExportBucket', { dataSource, preAggregations }),
      region: getEnv('dbExportBucketAwsRegion', { dataSource, preAggregations }),
    };

    const exportBucket: ClickhouseDriverExportAWS = {
      ...requiredExportBucket,
      keyId: getEnv('dbExportBucketAwsKey', { dataSource, preAggregations }),
      secretKey: getEnv('dbExportBucketAwsSecret', { dataSource, preAggregations }),
    };

    if (exportBucket.bucketType) {
      if (!SUPPORTED_BUCKET_TYPES.includes(exportBucket.bucketType)) {
        throw new Error(
          `Unsupported EXPORT_BUCKET_TYPE, supported: ${SUPPORTED_BUCKET_TYPES.join(',')}`
        );
      }

      // Make sure the required keys are set
      const emptyRequiredKeys = Object.keys(requiredExportBucket)
        .filter((key: string) => requiredExportBucket[<keyof ClickhouseDriverExportRequiredAWS>key] === undefined);
      if (emptyRequiredKeys.length) {
        throw new Error(
          `Unsupported configuration exportBucket, some configuration keys are empty: ${emptyRequiredKeys.join(',')}`
        );
      }

      return exportBucket;
    }

    return null;
  }

View on GitHub (pinned to 7d981676b3)

Solutions

  1. Set EXPORT_BUCKET_TYPE to one of the values listed in the error message (e.g. s3, gcs, azure)
  2. Fix casing/typos — match the exact supported token
  3. If the storage backend isn't supported, switch to a supported bucket provider or remove exportBucket config and rely on non-unload query paths
  4. Check driver docs for the currently supported EXPORT_BUCKET_TYPE values for ClickHouse

Example fix

// before
EXPORT_BUCKET_TYPE=s3compatible
// after
EXPORT_BUCKET_TYPE=s3
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED = ['s3','gcs','azure'];
const t = process.env.EXPORT_BUCKET_TYPE;
if (t && !SUPPORTED.includes(t)) throw new Error(`EXPORT_BUCKET_TYPE=${t} unsupported; use one of ${SUPPORTED.join(',')}`);

Type guard

const isSupportedBucketType = (t: string): t is 's3'|'gcs'|'azure' => ['s3','gcs','azure'].includes(t);

Try / catch

try { const driver = new ClickHouseDriver(config); }
catch (e) {
  if (String(e.message).includes('Unsupported EXPORT_BUCKET_TYPE')) throw new Error('Fix EXPORT_BUCKET_TYPE env to a supported value', { cause: e });
  throw e;
}

Prevention

When it happens

Trigger: Setting env EXPORT_BUCKET_TYPE (per dataSource) to a value outside SUPPORTED_BUCKET_TYPES, then instantiating ClickHouseDriver; the check runs whenever exportBucket.bucketType is truthy.

Common situations: Typos in the env value (e.g. 's_3', 'S3' with wrong case); using a bucket type supported by other Cube drivers (e.g. Snowflake) but not ClickHouse; stale config copied from another driver's setup.

Related errors


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