ComposioHQ/composio · error · ComposioBlockedInternalUrlError
URL file uploads are not supported in edge runtimes because
Error message
URL file uploads are not supported in edge runtimes because the destination cannot be safely validated
What it means
The edge-runtime (workerd/Cloudflare Workers) build of ssrfSafeFetch intentionally fails closed: edge runtimes expose no DNS resolution API, so the SDK cannot prove a hostname is publicly routable before connecting. All URL-based file uploads are therefore unsupported there.
Source
Thrown at ts/packages/core/src/utils/ssrfGuard.workerd.ts:9
import { ComposioBlockedInternalUrlError } from '../errors/SsrfErrors';
/**
* Edge runtimes do not expose the DNS resolution APIs needed to prove that a
* hostname is publicly routable before connecting. Fail closed instead of
* falling back to an unguarded fetch.
*/
export const ssrfSafeFetch = async (rawUrl: string): Promise<Response> => {
throw new ComposioBlockedInternalUrlError(
'URL file uploads are not supported in edge runtimes because the destination cannot be safely validated',
{
url: rawUrl,
possibleFixes: [
'Fetch the public URL yourself and pass a File or ArrayBuffer instead',
'Run the URL upload in a Node.js or Bun runtime',
],
}
);
};
/**
* Unguarded `fetch`, for the call sites that must keep working here.
*
* Failing closed is the right default for a URL the caller chose to upload, but
* applying it to Tool Router session file transfers would take a working
* feature away from Workers instead of closing a hole reachable there. The
* guard exists to stop a URL from reaching private address space the SDK's hostView on GitHub (pinned to 64b1b85502)
Solutions
- Fetch the URL yourself in the edge runtime and pass the File/ArrayBuffer to the upload API instead of the URL
- Move the URL-upload flow to a Node.js or Bun runtime
- Guard the code path by environment so edge deployments skip URL uploads
Example fix
// before (in a Cloudflare Worker) await upload.uploadFileAtUrl(url); // after const res = await fetch(url); const file = await res.blob(); await upload.uploadFile(file);
Defensive patterns
Strategy: fallback
Validate before calling
// detect edge runtimes and switch strategy up front
const isEdge = typeof navigator !== 'undefined' && navigator.userAgent?.includes('Cloudflare-Workers');
const input = isEdge ? await (await fetch(url)).blob() : url; Try / catch
try {
await upload.uploadFileAtUrl(url);
} catch (e) {
if (e instanceof ComposioBlockedInternalUrlError && /edge runtimes/.test(e.message)) {
const file = await (await fetch(url)).blob();
return upload.uploadFile(file);
}
} Prevention
- Never use URL-based uploads in Workers/edge runtimes; pass File/ArrayBuffer
- Branch upload strategy on runtime early in design
- Run URL-upload flows in Node.js or Bun services
When it happens
Trigger: Calling a URL-upload API that routes through ssrfSafeFetch inside a Cloudflare Worker / Vercel Edge / other workerd runtime — the function throws unconditionally on every call.
Common situations: Deploying code that worked in Node.js to an edge runtime without changing the upload strategy; edge functions that accept user-supplied file URLs.
Related errors
- File operations (upload/download) are not supported in Cloud
- File system operations are not supported in this runtime (e.
- File system operations are not supported in this runtime env
- Refusing to fetch a malformed URL
- Refusing to fetch a non-http(s) URL (scheme "${url.protocol}
AI-assisted analysis of ComposioHQ/composio@64b1b85502 (2026-08-28).
Data as JSON: /api/errors/6c927c4f323f058c.
Report an issue: GitHub.