8000 Consistently running into 500 errors · Issue #1138 · google/adk-python · GitHub
[go: up one dir, main page]

Skip to content
Consistently running into 500 errors #1138
Open
@kanlanc

Description

@kanlanc

Hello guys,

I'm testing the final setup before deploying to prod, but many a times I get this 500 error that is keeping my confidence low on the gemini models before deploying to prod.

I am not sure if im doing something wrong or whats up here and would really appreciate some help with this

agent-service-1  | ❌ Error in hyperbrowser agent execution: 500 INTERNAL. {'error': {'code': 500, 'message': 'An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting', 'status': 'INTERNAL'}}
agent-service-1  | 2025-06-04 02:15:24 - harmony_agent.agent - ERROR - 🔍 Error type: ServerError
agent-service-1  | 2025-06-04 02:15:24 - harmony_agent.agent - ERROR - 📋 Traceback:
agent-service-1  | Traceback (most recent call last):
agent-service-1  |   File "/app/harmony_agent/agent.py", line 245, in _run_async_impl
agent-service-1  |     async for event in self.hyperbrowser_agent.run_async(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/agents/base_agent.py", line 147, in run_async
agent-service-1  |     async for event in self._run_async_impl(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/agents/sequential_agent.py", line 37, in _run_async_impl
agent-service-1  |     async for event in sub_agent.run_async(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/agents/base_agent.py", line 147, in run_async
agent-service-1  |     async for event in self._run_async_impl(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/agents/llm_agent.py", line 278, in _run_async_impl
agent-service-1  |     async for event in self._llm_flow.run_async(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 279, in run_async
agent-service-1  |     async for event in self._run_one_step_async(invocation_context):
api-service-1    | 2025-06-04 02:15:24,531 - httpx - INFO - HTTP Request: POST http://agent-service:8081/run "HTTP/1.1 200 OK"
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 305, in _run_one_step_async
agent-service-1  |     async for llm_response in self._call_llm_async(
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 522, in _call_llm_async
agent-service-1  |     async for llm_response in llm.generate_content_async(
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/models/google_llm.py", line 143, in generate_content_async
agent-service-1  |     response = await self.api_client.aio.models.generate_content(
agent-service-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/models.py", line 7124, in generate_content
agent-service-1  |     response = await self._generate_content(
agent-service-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/models.py", line 6118, in _generate_content
agent-service-1  |     response_dict = await self._api_client.async_request(
agent-service-1  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/_api_client.py", line 789, in async_request
agent-service-1  |     result = await self._async_request(http_request=http_request, stream=False)
agent-service-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/_api_client.py", line 733, in _async_request
agent-service-1  |     await errors.APIError.raise_for_async_response(response)
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/errors.py", line 131, in raise_for_async_response
agent-service-1  |     raise ServerError(status_code, response_json, response)
agent-service-1  | google.genai.errors.ServerError: 500 INTERNAL. {'error': {'code': 500, 'message': 'An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting', 'status': 'INTERNAL'}}
agent-service-1  | 
agent-service-1  | 
agent-service-1  | Traceback (most recent call last):
agent-service-1  |   File "/app/harmony_agent/agent.py", line 245, in _run_async_impl
agent-service-1  |     async for event in self.hyperbrowser_agent.run_async(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/agents/base_agent.py", line 147, in run_async
agent-service-1  |     async for event in self._run_async_impl(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/agents/sequential_agent.py", line 37, in _run_async_impl
agent-service-1  |     async for event in sub_agent.run_async(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/agents/base_agent.py", line 147, in run_async
agent-service-1  |     async for event in self._run_async_impl(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/agents/llm_agent.py", line 278, in _run_async_impl
agent-service-1  |     async for event in self._llm_flow.run_async(ctx):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 279, in run_async
agent-service-1  |     async for event in self._run_one_step_async(invocation_context):
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 305, in _run_one_step_async
agent-service-1  |     async for llm_response in self._call_llm_async(
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/flows/llm_flows/base_llm_flow.py", line 522, in _call_llm_async
agent-service-1  |     async for llm_response in llm.generate_content_async(
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/adk/models/google_llm.py", line 143, in generate_content_async
agent-service-1  |     response = await self.api_client.aio.models.generate_content(
agent-service-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/models.py", line 7124, in generate_content
agent-service-1  |     response = await self._generate_content(
agent-service-1  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/models.py", line 6118, in _generate_content
agent-service-1  |     response_dict = await self._api_client.async_request(
agent-service-1  |                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/_api_client.py", line 789, in async_request
agent-service-1  |     result = await self._async_request(http_request=http_request, stream=False)
agent-service-1  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/_api_client.py", line 733, in _async_request
agent-service-1  |     await errors.APIError.raise_for_async_response(response)
agent-service-1  |   File "/app/.venv/lib/python3.12/site-packages/google/genai/errors.py", line 131, in raise_for_async_response
agent-service-1  |     raise ServerError(status_code, response_json, response)
agent-service-1  | google.genai.errors.ServerError: 500 INTERNAL. {'error': {'code': 500, 'message': 'An internal error has occurred. Please retry or report in https://developers.generativeai.google/guide/troubleshooting', 'status': 'INTERNAL'}}

I ran it multiple times and I am getting the same issue again and again. Before this, sometimes it runs perfectly

Metadata

Metadata

Assignees

Labels

coreIssues related to the core interface and implementationmodelsIssues about model support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0