ADK 1.18.0 deployment to Agent Engine error 404.
** Please make sure you read the contribution guide and file the issues in the right place. ** Contribution guide.
Describe the bug When deploying an Agent to Vertex AI Agent Engine, it tries to use the endpoint at projects//locations//agentEngines and it fails with a 404 error message.
This broke an attempt to update to ADK 1.18.0 of a working agent and also failed when trying to redeploy with a brand new one.
To Reproduce
- Install google-adk==1.18.0
- Run adk deploy agent_engine my-agent # From a sample agent code
The result of the operation will return an HTML formatted page saying that the resource is not found. Running curl to said resource also results in a similar error.
Expected behavior The deployment happened either to update previously deployed agents or on a new one
Additional context I patched the ADK cli command to use the resource ending with resoningEngines instead of agentEngines and the update failed but a deploy to a new agent suceeded.
A side note: after this update, it looks like the link to watch deployment logs for Agent Engine no longer is printed to the console, so I'm not sure if this is expected or not.
Following up, although the deployment with this "patch" worked, it looks like the Cloud Console is not fully functional as the telemetry settings were not used (I passed the --trace_do_cloud argument when deploying), and when trying to enable it in the web UI on Google Cloud failed with a bad request error complaining about missing source spec or something like that.
I am also having this issue. I am able to deploy a new agent to agent_engine, but get 404 when updating one via adk deploy agent_engine passing agent_engine_id
Reviewing the changes to cli_deploy.py, this commit seems to be causing issues:
https://github.com/google/adk-python/commit/d4b2a8b49f98a9991cb44ac7ec6e538b81a08664
- It appears that the Vertex API is pinned when deploying, this seems to be causing issues when deploying the agent to Cloud as the GCP console does not properly recognize as the correct version (still in main branch: https://github.com/google/adk-python/blob/main/src/google/adk/cli/cli_deploy.py#L774)
- This commit changed the URI to detect the agent and it appears that this change broke the agent_engine_id flag interpolation to resolve to a 404 endpoint.
any news here? It is completely messy to create a new reasoningEngine id in Agent Engine on every patch we do the agent's code!
Hi @ronoaldo and @bemurta,
Thanks for reporting the issue!
I made a partial fix in https://github.com/google/adk-python/commit/e15e19da05ee1b763228467e83f6f73e0eced4b5, but I did miss the other issue of the incorrect URI.
I have that fix it in review, and it should be merged within a couple of days🙏
Should be fully fixed after https://github.com/google/adk-python/commit/a4453c884cd6f4bd6f5ddcd25839657e02ab4f9d
install git+https://github.com/google/adk-python.git@main
I tried it, but I still got a 404.
Traceback (most recent call last): File "/code/app/api/factory/python_file_api_builder.py", line 473, in _async_stream_json_generator async for chunk in output: File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/vertexai/agent_engines/templates/adk.py", line 971, in async_stream_query async for event in events_async: File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/google/adk/runners.py", line 454, in run_async async for event in agen: File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/google/adk/runners.py", line 390, in _run_with_trace session = await self.session_service.get_session( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/google/adk/sessions/vertex_ai_session_service.py", line 158, in get_session get_session_response, events_iterator = await asyncio.gather( ^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/vertexai/_genai/session_events.py", line 471, in list await self._list(name=name, config=config), ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/vertexai/_genai/session_events.py", line 433, in _list response = await self._api_client.async_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/google/genai/_api_client.py", line 1365, in async_request result = await self._async_request( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/google/genai/_api_client.py", line 1310, in _async_request return await self._async_retry( # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 111, in call do = await self.iter(retry_state=retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 153, in iter result = await action(retry_state) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/tenacity/_utils.py", line 99, in inner return call(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/tenacity/init.py", line 420, in exc_check raise retry_exc.reraise() ^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/tenacity/init.py", line 187, in reraise raise self.last_attempt.result() ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 449, in result return self.__get_result() ^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.12/concurrent/futures/_base.py", line 401, in __get_result raise self._exception File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/tenacity/asyncio/init.py", line 114, in call result = await fn(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/google/genai/_api_client.py", line 1255, in _async_request_once await errors.APIError.raise_for_async_response(response) File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.12/lib/python3.12/site-packages/google/genai/errors.py", line 166, in raise_for_async_response raise ClientError(status_code, response_json, response) google.genai.errors.ClientError: 404 NOT_FOUND. {'error': {'code': 404, 'message': 'The ReasoningEngine does not exist.', 'status': 'NOT_FOUND'}}
@BenzDroid thanks for the detailed stack trace!
This looks to be unrelated to this issue though, which has to do with not being able to update agent engine with adk deploy agent_engines.
What you're running into is a 404 when retrieving a session, on a successfully deployed agent engine.
Could you please open another issue for this?🙏
I'm also experiencing this issue. Running on ADK Python 1.19.0
The command looks like (with placeholders):
adk deploy agent_engine \
--project=... \
--region=... \
--staging_bucket=... \
--agent_engine_id=... \
--trace_to_cloud \
--requirements_file=../../requirements.txt \
agent_folder
Output:
Staging all files in: /.../..._tmp20251130_121306
Copying agent source code...
Copying agent source code complete.
Resolving files and dependencies...
Reading agent engine config from .../agent_engine_config.json
Reading environment variables from .../.env
Ignoring GOOGLE_CLOUD_PROJECT in .env as `--project` was explicitly passed and takes precedence
Initializing Vertex AI...
Vertex AI initialized.
Created ..._tmp20251130_121306/agent_engine_app.py
Files and dependencies resolved
Deploying to agent engine...
Cleaning up the temp folder: ..._tmp20251130_121306
Deploy failed: 404 Not Found. {'message': '<!DOCTYPE html>\n<html lang=en>\n <meta charset=utf-8>\n <meta name=viewport content="initial-scale=1, minimum-scale=1, width=device-width">\n <title>Error 404 (Not Found)!!1</title>\n <style>\n *{margin:0;padding:0}html,code{font:15px/22px arial,sans-serif}html{background:#fff;color:#222;padding:15px}body{margin:7% auto 0;max-width:390px;min-height:180px;padding:30px 0 15px}* > body{background:url(//www.google.com/images/errors/robot.png) 100% 5px no-repeat;padding-right:205px}p{margin:11px 0 22px;overflow:hidden}ins{color:#777;text-decoration:none}a img{border:0}@media screen and (max-width:772px){body{background:none;margin-top:0;max-width:none;padding-right:0}}#logo{background:url(//www.google.com/images/branding/googlelogo/1x/googlelogo_color_150x54dp.png) no-repeat;margin-left:-5px}@media only screen and (min-resolution:192dpi){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat 0% 0%/100% 100%;-moz-border-image:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) 0}}@media only screen and (-webkit-min-device-pixel-ratio:2){#logo{background:url(//www.google.com/images/branding/googlelogo/2x/googlelogo_color_150x54dp.png) no-repeat;-webkit-background-size:100% 100%}}#logo{display:inline-block;height:54px;width:150px}\n </style>\n <a href=//www.google.com/><span id=logo aria-label=Google></span></a>\n <p><b>404.</b> <ins>That’s an error.</ins>\n <p>The requested URL <code>/v1beta1/projects/.../locations/.../agentEngines/...?updateMask=display_name%2Cspec.source_code_spec.inline_source.source_archive%2Cspec.source_code_spec.python_spec.version%2Cspec.source_code_spec.python_spec.entrypoint_module%2Cspec.source_code_spec.python_spec.entrypoint_object%2Cspec.source_code_spec.python_spec.requirements_file%2Cspec.class_methods%2Cspec.deployment_spec.env%2Cspec.deployment_spec.min_instances%2Cspec.deployment_spec.max_instances%2Cspec.deployment_spec.resource_limits%2Cspec.agent_framework</code> was not found on this server. <ins>That’s all we know.</ins>\n', 'status': 'Not Found'}
- The resource URL in the command output (with placeholders):
/v1beta1/projects/.../locations/.../agentEngines/... - The resource name from the flCP console (with placeholders):
projects/.../locations/.../reasoningEngines/...
Notice the mismatch?
First /v1beta1 but let's assume that's not shown in the Cloud console.
Then:
.../agentEngines/...in the adk command- vs
.../reasoningEngines/...in the Cloud console.