Budibase/budibase · error

No response received for attachment

Error message

No response received for attachment

What it means

After confirming the response is OK, processUrlAttachment double-checks that response.body is present; if the body is falsy despite the OK status, it throws 'No response received for attachment'. This guards against servers returning a success status with an empty body.

Source

Thrown at packages/backend-core/src/objectStore/utils.ts:77

    Rules: [lifecycleRule],
  }

  return {
    Bucket: bucketName,
    LifecycleConfiguration: lifecycleConfiguration,
  }
}

async function processUrlAttachment(
  attachment: AutomationAttachment
): Promise<AutomationAttachmentContent> {
  const response = await fetchWithBlacklist(attachment.url)
  if (!response.ok || !response.body) {
    throw new Error(`Unexpected response ${response.statusText}`)
  }
  const fallbackFilename = path.basename(new URL(attachment.url).pathname)
  if (!response.body) {
    throw new Error("No response received for attachment")
  }
  if (!(response.body instanceof stream.Readable)) {
    throw new Error("Unexpected response body stream type")
  }
  return {
    filename: attachment.filename || fallbackFilename,
    content: response.body,
  }
}

export async function processObjectStoreAttachment(
  attachment: AutomationAttachment
): Promise<BucketedContent> {
  const result = objectStore.extractBucketAndPath(attachment.url)

  if (result === null) {
    throw new Error("Invalid signed URL")
  }

View on GitHub (pinned to a81a902e9a)

Solutions

  1. Confirm the URL returns a real file body with curl -i (check Content-Length > 0)
  2. Point the attachment at a direct file link rather than an API endpoint returning 204
  3. Check HTTP method/headers required by the host — some hosts only stream bodies with proper Accept/Range headers
  4. Retry the automation step in case of a transient empty response

Example fix

// before
attachments: [{ url: "https://example.com/api/export" }]
// after
attachments: [{ url: "https://example.com/api/export?download=1" }] // endpoint that streams the file
Defensive patterns

Strategy: validation

Validate before calling

const res = await fetch(url)
const buf = await res.arrayBuffer()
if (!res.ok || buf.byteLength === 0) throw new Error("Attachment URL returns empty body")

Type guard

function hasBody<T extends { body: unknown }>(r: T): r is T & { body: NonNullable<T["body"]> } {
  return !!r.body
}

Try / catch

try {
  const content = await processUrlAttachment(attachment)
} catch (err) {
  if (err.message === "No response received for attachment") {
    // host returned OK but empty body: use a direct download URL
  }
  throw err
}

Prevention

When it happens

Trigger: fetchWithBlacklist returns an OK response with body === null — e.g. 204 No Content responses, servers responding 200 to a failed transfer, or undici/fetch quirks where body is consumed or absent.

Common situations: Automation attachment URLs pointing at APIs that return 204 or empty 200s, endpoints that expect different methods (POST vs GET) so they return empty bodies, or download servers that already streamed the body elsewhere.

Related errors


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