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

  1. Check the S3/MinIO endpoint is reachable and the bucket/key actually exist (headObject 404 is the most common underlying cause)
  2. Verify credentials and bucket policy — 403 from wrong keys is masked by this generic error
  3. Add temporary logging at the catch site to capture the swallowed err for diagnosis (or patch locally to include err.message)
  4. 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

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


AI-assisted analysis of Budibase/budibase@a81a902e9a (2026-08-29). Data as JSON: /api/errors/10acad4721d9d146. Report an issue: GitHub.