Skip to content

Intermittent "Cannot fetch content" for presigned S3 fileUri #1385

@dani-mp

Description

@dani-mp

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

  1. Generate a presigned AWS S3 URL for a video object and call models.generateContent with model: "gemini-2.5-pro" and contents including:
    • { fileData: { fileUri: "<presigned-s3-url>" } }
    • { text: "<prompt>" }
  2. Intermittently receive:
    {
      "error": {
        "code": 400,
        "message": "Cannot fetch content from the provided URL.",
        "status": "INVALID_ARGUMENT"
      }
    }
  3. Immediately verify the same presigned URL is still valid and downloadable from our side.
  4. 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 fileUri fetches.

Metadata

Metadata

Assignees

Labels

api:gemini-apipriority: p2Moderately-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.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions