Budibase/budibase · error
Unable to retrieve metadata from object
Error message
Unable to retrieve metadata from object
What it means
This helper calls the S3 client's headObject to fetch object metadata (size, content type, last modified). headObject throws when the key does not exist or the store is unreachable; the catch clause swallows the original error and rethrows a generic 'Unable to retrieve metadata from object' Error.
Source
Thrown at packages/backend-core/src/objectStore/objectStore.ts:819
}
export async function getObjectMetadata(
bucket: string,
path: string
): Promise<HeadObjectCommandOutput> {
bucket = sanitizeBucket(bucket)
path = sanitizeKey(path)
const client = ObjectStore()
const params = {
Bucket: bucket,
Key: path,
}
try {
return await client.headObject(params)
} catch (err: any) {
throw new Error("Unable to retrieve metadata from object")
}
}
export async function objectExists(
bucket: string,
path: string
): Promise<boolean> {
bucket = sanitizeBucket(bucket)
path = sanitizeKey(path)
const client = ObjectStore()
const params = {
Bucket: bucket,
Key: path,
}
try {
await client.headObject(params)View on GitHub (pinned to a81a902e9a)
Solutions
- Check the S3/MinIO endpoint is reachable and the bucket/key actually exist (headObject 404 is the most common underlying cause)
- Verify credentials and bucket policy — 403 from wrong keys is masked by this generic error
- Add temporary logging at the catch site to capture the swallowed err for diagnosis (or patch locally to include err.message)
- Confirm SELF_HOSTED/MINIO env vars match the environment (dev vs prod) so lookups target the right store
Example fix
// before
} catch (err: any) {
throw new Error("Unable to retrieve metadata from object")
}
// after
} catch (err: any) {
throw new Error(`Unable to retrieve metadata from object: ${err?.name ?? "unknown"}`)
} Defensive patterns
Strategy: try-catch
Validate before calling
const exists = await objectStore.objectExists(bucket, path)
if (!exists) { /* skip or create */ } Try / catch
try {
await objectStore.getObjectMetadata(bucket, path)
} catch (err) {
if (err.message === "Unable to retrieve metadata from object") {
// original cause is swallowed: check bucket/key/credentials directly
}
throw err
} Prevention
- Treat this error as 'not found OR store unreachable' and check the store health first
- Verify credentials/bucket env config per environment
- Run headObject directly with the SDK when debugging to see the real error
- Keep MinIO/S3 services monitored in self-hosted installs
When it happens
Trigger: objectExists/metadata lookup for a key that does not exist (404 NoSuchKey), wrong bucket name, invalid/expired credentials (403), or network failure to the S3/MinIO endpoint. Note the original error is discarded, so the real cause is hidden.
Common situations: Checking existence of an attachment whose key was deleted by another process, misconfigured bucket names between environments, MinIO not running in self-hosted dev, or credential rotation breaking access.
Related errors
- Access denied to object store bucket.${err}
- Unable to retrieve object
- Unable to retrieve stream - invalid response
- Invalid object store key: path traversal is not allowed.
- Stream to upload is invalid/undefined
AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29).
Data as JSON: /api/errors/10acad4721d9d146.
Report an issue: GitHub.