I have deployed an Agent to Vertex AI following the documentation:
```
# DEPLOYMENT: Deploy the app to Vertex AI
from vertexai import agent_engines
from orchestrator_agent import root_agent
remote_app = agent_engines.create(
agent_engine=root_agent,
requirements=[
"google-cloud-aiplatform[adk,agent_engines]", # pulls Vertex AI + ADK tooling
'google-adk',
"google-genai", # required for Content/Part
"python-dotenv", # for `load_dotenv`
],
# Upload each local folder that contains importable code
extra_packages=[
"./orchestrator_agent",
],
display_name = "Orchestrator Vol 1",
description = "An AI Agent orchestrator",
gcs_dir_name = "orchestrator_vol_1", # carpeta nueva
# Optional – user-level env vars (DO NOT include creds or project/location)
)
```
And it works well, I can create sessions and interact with this deployed agent.
But then uploaded the same agent with small changes in the prompt (i also changed the name of display name and gcd_dir_name, but now i can't even create a new session. I get this error:
```
Traceback (most recent call last):
File "/usr/local/lib/python3.10/threading.py", line 1016, in _bootstrap_inner
self.run()
File "/usr/local/lib/python3.10/threading.py", line 953, in run
self._target(*self._args, **self._kwargs)
File "/usr/local/lib/python3.10/site-packages/vertexai/preview/reasoning_engines/templates/adk.py", line 826, in _asyncio_thread_main
result = asyncio.run(_invoke_async_create_session())
File "/usr/local/lib/python3.10/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/local/lib/python3.10/asyncio/base_events.py", line 649, in run_until_complete
return future.result()
File "/usr/local/lib/python3.10/site-packages/vertexai/preview/reasoning_engines/templates/adk.py", line 817, in _invoke_async_create_session
return await self.async_create_session(
File "/usr/local/lib/python3.10/site-packages/vertexai/preview/reasoning_engines/templates/adk.py", line 796, in async_create_session
session = await self._tmpl_attrs.get("session_service").create_session(
File "/usr/local/lib/python3.10/site-packages/google/adk/sessions/vertex_ai_session_service.py", line 92, in create_session
session_id = api_response['name'].split('/')[-3]
TypeError: 'HttpResponse' object is not subscriptable
```
Any idea what could be happening?
Hi Alekzan,
Welcome to the Google Cloud Community!
It seems that the same post was shared on GitHub, and it looks like the problem has already been resolved.
In addition, here are several troubleshooting suggestions for future reference that could help resolve the issue on TypeError: 'HttpResponse' object is not subscriptable:
You can also refer to the following documentation for guidance on managing and troubleshooting AI Agents:
Was this helpful? If so, please accept this answer as “Solution”. If you need additional assistance, reply here within 2 business days and I’ll be happy to help.