{"record":{"id":"bfcbd7d76296e4dc","repo":"cube-js/cube","slug":"no-csv-files-were-obtained-from-the-bucket-bfcbd7","errorCode":null,"errorMessage":"No CSV files were obtained from the bucket","messagePattern":"No CSV files were obtained from the bucket","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/cubejs-base-driver/src/storage-fs/gcs.fs.ts","lineNumber":52,"sourceCode":"      ? { credentials: gcsConfig.credentials, projectId: gcsConfig.credentials.project_id }\n      : undefined\n  );\n\n  const bucket = storage.bucket(bucketName);\n  const [files] = await bucket.getFiles({ prefix: `${tableName}/` });\n\n  if (files.length) {\n    const csvFiles = await Promise.all(files.map(async (file) => {\n      const [url] = await file.getSignedUrl({\n        action: 'read',\n        expires: new Date(new Date().getTime() + 60 * 60 * 1000)\n      });\n      return url;\n    }));\n\n    return csvFiles;\n  } else {\n    throw new Error('No CSV files were obtained from the bucket');\n  }\n}\n","sourceCodeStart":34,"sourceCodeEnd":55,"githubUrl":"https://github.com/cube-js/cube/blob/7d981676b36392fec34088b9afab6bdcad40207c/packages/cubejs-base-driver/src/storage-fs/gcs.fs.ts#L34-L55","documentation":"A sentinel guard in extractFilesFromGCS: after listing GCS objects under the `<tableName>/` prefix via bucket.getFiles, the returned file list was empty. This means the export bucket contains no CSV objects at the expected prefix — typically the upstream unload/export to GCS never ran, wrote to a different prefix/bucket, or the configured credentials/bucket name point at the wrong location. It signals an export-pipeline misconfiguration rather than a query failure.","triggerScenarios":"GCS bucket/prefix contains no CSV objects at the time of listing after an unload (unload produced nothing or listed the wrong location).","commonSituations":"Unload job failed or extracted zero rows, wrong bucket or prefix configured, GCS permissions preventing object listing, eventual consistency/delay right after unload.","solutions":["Verify the unload job completed and objects were written to the expected bucket/prefix","Check bucket name and prefix configuration in the driver's unload options","Verify GCS credentials have storage.objects.list/read permissions","Retry the unload and re-extract after objects exist"],"exampleFix":"// before\nunload: { bucket: 'cube-unloads', prefix: 'wrong-prefix' } // no CSVs listed\n// after\nunload: { bucket: 'cube-unloads', prefix: 'exports' } // matches unload output","handlingStrategy":"retry","validationCode":"const [files] = await bucket.getFiles({ prefix });\nif (!files.some(f => f.name.endsWith('.csv'))) throw new Error('unload produced no CSV objects');","typeGuard":null,"tryCatchPattern":"try {\n  urls = await extractFilesFromGCS(...);\n} catch (e) {\n  if (/No CSV files were obtained/.test(e.message)) {\n    await sleep(2000);\n    return extractFilesFromGCS(...);\n  }\n  throw e;\n}","preventionTips":["Confirm the unload job finished and objects exist before listing","Double-check bucket/prefix configuration in driver options","Verify GCS credentials include storage.objects.list","Add a short delay or polling loop after unload to absorb listing delays"],"tags":["gcs","unload","google-cloud","permissions"],"backgroundTag":"unload-no-csv-files","analyzedSha":"7d981676b36392fec34088b9afab6bdcad40207c","analyzedAt":"2026-09-02T03:45:10.400Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}