all `client.webhooks` operations fail with API error occurred: Status 404

Aperta
#3,316 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@VISHNU0906 ci sta già lavorando.

Dal 8/11/2026.

  • #3319 di @VISHNU0906 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
54/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
python
Ambito
api

Direzione di ricerca

Start by tracing how client.webhooks builds its request path and how the client selects the API version from HttpOptions; the issue identifies /v1/webhooks and /v1beta as the failing and working routes. Check the webhooks tests and add coverage showing that management calls use v1beta routing by default while other client routing remains unaffected. Done means the reported 404 is covered and webhook list and create calls use the deployed route.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

priority: p2 type: bug
Description

In the latest major version (v3.0.0+), all client.webhooks operations—including client.webhooks.list() and client.webhooks.create()—fail with a google.genai._gaos.errors.genaidefaulterror.GenAiDefaultError: API error occurred: Status 404.

This occurs because v3.0.0 changed the default developer API routing version to v1. However, the Gemini webhooks subsystem is currently only deployed on the v1beta path structure. Because the SDK makes calls directly to /v1/webhooks, Google's production servers reject the route with a standard 404 HTML document page. The SDK should explicitly default to v1beta routing internally for webhooks management.

Environment Details
  • SDK Package: google-genai (v3.0.0 and above)
  • Auth Layer: Google AI Studio developer API key (api_key="...")
Steps to Reproduce
from google import genai

# Standard initialization defaults to /v1/ routes in v3.0.0+
client = genai.Client(api_key="VALID_GEMINI_KEY")

# Triggers the 404 exception loop instantly
webhooks = client.webhooks.list()
Traceback Log
google.genai._gaos.errors.genaidefaulterror.GenAiDefaultError: API error occurred: Status 404 Content-Type text/html. Body: ""
...
google.genai._gaos.lib.compat_errors.NotFoundError: Error code: 404
Working Workarounds
Workaround 1: Explicitly pass HttpOptions to the Client (Recommended)

You can override the client's automated route configuration to force the endpoint path back to v1beta where the webhooks framework is live:

from google import genai
from google.genai.types import HttpOptions

client = genai.Client(
    api_key="YOUR_GEMINI_API_KEY",
    http_options=HttpOptions(api_version="v1beta")
)

# This succeeds perfectly
webhooks_list = client.webhooks.list()
Workaround 2: Environment Variable Override

Setting the framework version override globally in the active terminal environment shell also bypasses the 404 issue:

  • Windows Cmd: set GOOGLE_GENAI_API_VERSION=v1beta
  • PowerShell: $env:GOOGLE_GENAI_API_VERSION="v1beta"
  • Linux/macOS: export GOOGLE_GENAI_API_VERSION="v1beta"
Lingua principale
Python
Stelle
4.1k
Fork
1.1k
Merge medio
1g 20h
PR unite (30g)
99

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di googleapis/python-genai

Tutte le issue di googleapis/python-genai

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.