{"record":{"id":"0c72a4fa24558e1d","repo":"cube-js/cube","slug":"unsupported-export-bucket-type-buckettype","errorCode":null,"errorMessage":"Unsupported export bucket type: ${bucketType}","messagePattern":"Unsupported export bucket type: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-prestodb-driver/src/PrestoDriver.ts","lineNumber":490,"sourceCode":"    const { bucketType, exportBucket } = this.config;\n    const { schema, tableName } = this.splitTableFullName(tableFullName);\n\n    switch (bucketType) {\n      case 'gcs':\n        return this.extractFilesFromGCS({ credentials: this.config.credentials }, exportBucket, `${schema}/${tableName}`);\n      case 's3':\n        return this.extractUnloadedFilesFromS3({\n          credentials: this.config.accessKeyId && this.config.secretAccessKey\n            ? {\n              accessKeyId: this.config.accessKeyId,\n              secretAccessKey: this.config.secretAccessKey,\n            }\n            : undefined,\n          region: this.config.exportBucketRegion,\n        },\n        exportBucket, `${schema}/${tableName}`);\n      default:\n        throw new Error(`Unsupported export bucket type: ${bucketType}`);\n    }\n  }\n}\n","sourceCodeStart":472,"sourceCodeEnd":494,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-prestodb-driver/src/PrestoDriver.ts#L472-L494","documentation":"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().","triggerScenarios":"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).","commonSituations":"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.","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"],"exampleFix":"// before\nexportBucket: { bucketType: 'S3', bucket: 'my-bucket' }\n// after\nexportBucket: { bucketType: 's3', bucket: 'my-bucket', region: 'us-east-1' }","handlingStrategy":"validation","validationCode":"const SUPPORTED = ['s3', 'gcs', 'azure'];\nif (!SUPPORTED.includes(String(driver.config?.exportBucket?.bucketType))) {\n  throw new Error(`Unsupported bucketType for CSV fetch: ${driver.config?.exportBucket?.bucketType}`);\n}","typeGuard":"const csvCapableBucket = (cfg) => ['s3','gcs','azure'].includes(String(cfg?.exportBucket?.bucketType));","tryCatchPattern":"try {\n  const files = await driver.csvFile(tableName);\n} catch (e) {\n  if (String(e.message).startsWith('Unsupported export bucket type')) {\n    console.error('Normalize bucketType to a lowercase supported value');\n  }\n  throw e;\n}","preventionTips":["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"],"tags":["prestodb","export-bucket","csv","validation"],"backgroundTag":"unsupported-bucket-type","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}