googleapis / googleapis/python-genai

client.files.list() raises ServerError 500: "Failed to convert server response to JSON"

Offen
#815 19 Kommentare 8 Reaktionen 1 zugewiesene Person Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

api: gemini-api priority: p2 type: bug
Vorherrschende Sprache
Python
Sterne
4k
Forks
1k
Ø Merge
2 T. 12 Std.
Gemergte PRs (30 T.)
41

Beschreibung

Hi team,

I'm using the Google Generative AI Python SDK and encountering an unexpected internal error when calling client.files.list(). This function was working until yesterday, but it has now started consistently throwing a server-side error. Below is the traceback:
Traceback (most recent call last):
File "/home/hetpandya/Research/Loom AI/list.py", line 10, in
for f in client.files.list():
^^^^^^^^^^^^^^^^^^^
File "/home/hetpandya/.local/lib/python3.12/site-packages/google/genai/files.py", line 714, in list
self._list(config=config),
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hetpandya/.local/lib/python3.12/site-packages/google/genai/files.py", line 385, in _list
response_dict = self._api_client.request(
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hetpandya/.local/lib/python3.12/site-packages/google/genai/_api_client.py", line 674, in request
response = self._request(http_request, stream=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/hetpandya/.local/lib/python3.12/site-packages/google/genai/_api_client.py", line 603, in _request
errors.APIError.raise_for_response(response)
File "/home/hetpandya/.local/lib/python3.12/site-packages/google/genai/errors.py", line 103, in raise_for_response
raise ServerError(status_code, response_json, response)
google.genai.errors.ServerError: 500 INTERNAL. {'error': {'code': 500, 'message': 'Failed to convert server response to JSON', 'status': 'INTERNAL'}}

Environment:

SDK version: [google-genai==1.11.0]

Python version: 3.9

OS: Ubuntu 22.04

Steps to reproduce:

Set up client from the SDK.

Call client.files.list()

Observe the crash.

Expected behavior:

The method should return a list of files or an appropriate client-side error, not a server-side 500 with an invalid JSON response.
Actual behavior:

The SDK raises google.genai.errors.ServerError with a message indicating the response couldn't be converted to JSON.

Please let me know if there's an alternative method I should use, or if this is a known issue being addressed.

Thanks!

Beitragsleitfaden

Beitragsleitfaden öffnen

Erste Schritte

  1. Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
  3. Forke das Repository und arbeite in einem Branch.
  4. Öffne einen Pull Request, der die Issue-Nummer nennt.

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.