cube-js/cube · error · Error
Unable to retrieve list of files from S3 storage after unloa
Error message
Unable to retrieve list of files from S3 storage after unloading.
What it means
After an unload operation writes CSV files to S3, extractUnloadedFilesFromS3 lists the bucket to build download URLs. If the S3 listing fails or returns nothing usable, this error signals the unload output could not be enumerated.
Source
Thrown at packages/cubejs-base-driver/src/storage-fs/aws.fs.ts:77
});
if (list) {
if (!list.Contents) {
return [];
} else {
const csvFiles = await Promise.all(
list.Contents.map(async (file) => {
const command = new GetObjectCommand({
Bucket: bucketName,
Key: file.Key,
});
return getSignedUrl(storage, command, { expiresIn: 3600 });
})
);
return csvFiles;
}
}
throw new Error('Unable to retrieve list of files from S3 storage after unloading.');
}
View on GitHub (pinned to 7d981676b3)
Solutions
- Verify bucket name, region, and credentials used for the storage-fs S3 client
- Grant the IAM principal s3:ListBucket (and GetObject) permissions
- Check the unload job actually completed and objects were written to the expected prefix
- Retry the unload; investigate S3 errors logged before this message
Example fix
// before
{ bucket: 'my-bucket', region: 'us-east-1' } // principal lacks ListBucket
// after
iam: { policy: [{ action: ['s3:ListBucket','s3:GetObject'], resource: ['arn:aws:s3:::my-bucket/*'] }] } Defensive patterns
Strategy: retry
Validate before calling
await s3.send(new HeadBucketCommand({ Bucket: bucket })); // fail fast on bad bucket/creds
// ensure IAM has s3:ListBucket before unload flows Try / catch
try {
files = await extractUnloadedFilesFromS3(...);
} catch (e) {
if (/Unable to retrieve list of files from S3/.test(e.message)) {
await sleep(backoff);
return retryExtract();
}
throw e;
} Prevention
- Verify bucket name, region, and IAM ListBucket/GetObject permissions up front
- Confirm unload wrote objects (check prefix counts) before listing
- Add retries with backoff for transient S3 errors
- Monitor unload job status before extraction
When it happens
Trigger: S3 ListObjects/list call throwing or the listing result being absent/empty in a way that yields no csvFiles, after an unload to S3.
Common situations: Wrong bucket name/region, missing s3:ListBucket permissions, unload failed silently so nothing was written, or temporary S3 errors.
Related errors
- Export bucket is not configured.
- No CSV files were obtained from the bucket
- No CSV files were obtained from the bucket
- Unable to UNLOAD table, there are no files in S3 storage
- Query was cancelled
AI-assisted analysis of cube-js/cube@7d981676b3 (2026-09-02).
Data as JSON: /api/errors/989dc93eeec11c7b.
Report an issue: GitHub.