-
Notifications
You must be signed in to change notification settings - Fork 234
Intermittent "Cannot fetch content" for presigned S3 fileUri #1385
Copy link
Copy link
Open
Labels
api:gemini-apipriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
Environment details
- Programming language: TypeScript (Node.js)
- OS: AWS Lambda (Amazon Linux)
- Language runtime version: Node.js 20.x
- Package version:
@google/genai^1.43.0
Steps to reproduce
- Generate a presigned AWS S3 URL for a video object and call
models.generateContentwithmodel: "gemini-2.5-pro"andcontentsincluding:{ fileData: { fileUri: "<presigned-s3-url>" } }{ text: "<prompt>" }
- Intermittently receive:
{ "error": { "code": 400, "message": "Cannot fetch content from the provided URL.", "status": "INVALID_ARGUMENT" } } - Immediately verify the same presigned URL is still valid and downloadable from our side.
- Retry the exact same request; after automatic retries, it often succeeds with no URL/payload changes.
Observed behavior:
- The URL is a presigned AWS S3 URL (time-limited, signed query params).
- Failures are transient/non-deterministic for the same URL and prompt.
- We see this frequently in production; many failures resolve after retries.
- We want to confirm whether this is expected behavior for Gemini fetching presigned S3 URLs or a reliability issue with
fileUrifetches.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api:gemini-apipriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.