{"record":{"id":"8c4bcefcb67199cf","repo":"cube-js/cube","slug":"unsupported-configuration-exportbucket-some-confi","errorCode":null,"errorMessage":"Unsupported configuration exportBucket, some configuration keys are empty: ${emptyRequiredKeys.join(',')}","messagePattern":"Unsupported configuration exportBucket, some configuration keys are empty: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/cubejs-clickhouse-driver/src/ClickHouseDriver.ts","lineNumber":551,"sourceCode":"\n    const exportBucket: ClickhouseDriverExportAWS = {\n      ...requiredExportBucket,\n      keyId: getEnv('dbExportBucketAwsKey', { dataSource, preAggregations }),\n      secretKey: getEnv('dbExportBucketAwsSecret', { dataSource, preAggregations }),\n    };\n\n    if (exportBucket.bucketType) {\n      if (!SUPPORTED_BUCKET_TYPES.includes(exportBucket.bucketType)) {\n        throw new Error(\n          `Unsupported EXPORT_BUCKET_TYPE, supported: ${SUPPORTED_BUCKET_TYPES.join(',')}`\n        );\n      }\n\n      // Make sure the required keys are set\n      const emptyRequiredKeys = Object.keys(requiredExportBucket)\n        .filter((key: string) => requiredExportBucket[<keyof ClickhouseDriverExportRequiredAWS>key] === undefined);\n      if (emptyRequiredKeys.length) {\n        throw new Error(\n          `Unsupported configuration exportBucket, some configuration keys are empty: ${emptyRequiredKeys.join(',')}`\n        );\n      }\n\n      return exportBucket;\n    }\n\n    return null;\n  }\n\n  public async isUnloadSupported() {\n    return !!this.config.exportBucket;\n  }\n\n  /**\n   * Returns an array of queried fields meta info.\n   */\n  public async queryColumnTypes(sql: string, params: unknown[]): Promise<TableStructure> {","sourceCodeStart":533,"sourceCodeEnd":569,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-clickhouse-driver/src/ClickHouseDriver.ts#L533-L569","documentation":"When an exportBucket is configured with a supported bucketType, certain required credentials (bucket name, AWS key, AWS secret) must all be set. This error lists the keys that are undefined, thrown from getExportBucket() during driver construction.","triggerScenarios":"exportBucket.bucketType is set and supported, but one or more of dbExportBucketAwsKey / dbExportBucketAwsSecret / bucketName envs (for the given dataSource/preAggregations) are missing, so emptyRequiredKeys is non-empty.","commonSituations":"Credentials not propagated to the environment where Cube runs (Docker/K8s secrets missing); env names spelled incorrectly; using dataSource-scoped env vars (e.g. EXPORT_BUCKET_AWS_KEY_XXX) where only the base name is set, or vice versa; partial config after migrating from another driver.","solutions":["Set the env vars named in the error message: EXPORT_BUCKET_TYPE, EXPORT_BUCKET_NAME, EXPORT_BUCKET_AWS_KEY, EXPORT_BUCKET_AWS_SECRET (or dataSource-scoped variants)","Verify the secrets actually reach the Cube process (print sanitized env or check deployment secret mounts)","Ensure IAM credentials for the key/secret have write permission to the bucket","Remove the exportBucket block entirely if unload is not intended, so this validation is skipped"],"exampleFix":"// before\nEXPORT_BUCKET_TYPE=s3\nEXPORT_BUCKET_NAME=my-bucket\n# missing key/secret -> error\n// after\nEXPORT_BUCKET_TYPE=s3\nEXPORT_BUCKET_NAME=my-bucket\nEXPORT_BUCKET_AWS_KEY=AKIA...\nEXPORT_BUCKET_AWS_SECRET=...","handlingStrategy":"validation","validationCode":"if (process.env.EXPORT_BUCKET_TYPE) {\n  const required = ['EXPORT_BUCKET_NAME','EXPORT_BUCKET_AWS_KEY','EXPORT_BUCKET_AWS_SECRET'];\n  const missing = required.filter(k => !process.env[k]);\n  if (missing.length) throw new Error(`Export bucket envs missing: ${missing.join(',')}`);\n}","typeGuard":"const hasExportBucketConfig = (env: NodeJS.ProcessEnv): boolean =>\n  Boolean(env.EXPORT_BUCKET_TYPE && env.EXPORT_BUCKET_NAME && env.EXPORT_BUCKET_AWS_KEY && env.EXPORT_BUCKET_AWS_SECRET);","tryCatchPattern":"try { const driver = new ClickHouseDriver(config); }\ncatch (e) {\n  if (String(e.message).includes('some configuration keys are empty')) throw new Error('Provide all export bucket credentials listed in the error', { cause: e });\n  throw e;\n}","preventionTips":["Wire bucket credentials via deployment secrets and verify at startup","Watch for dataSource-scoped env var naming (e.g. suffix _MYDATA)","Remove exportBucket config entirely when unload is not used"],"tags":["configuration","env-var","credentials","clickhouse","export-bucket"],"backgroundTag":"missing-env-var","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}