adk-python icon indicating copy to clipboard operation
adk-python copied to clipboard

spec.source_code_spec.inline_source.source_archive` cannot be empty

Open postak opened this issue 1 year ago • 5 comments

** Please make sure you read the contribution guide and file the issues in the right place. ** Contribution guide.

Describe the bug when deploying adk to adk deploy agent_engine using "adk deploy agent_engine" and trying to Enable instrumentation of OpenTelemetry traces and logs I get the error spec.source_code_spec.inline_source.source_archive` cannot be empty

To Reproduce Please share a minimal code and data to reproduce your problem. Steps to reproduce the behavior:

  1. adk deploy agent_engine myagent --trace_to_cloud
  2. try to Enable instrumentation of OpenTelemetry traces and logs using the Service configuration panel in the GCP console
  3. Press update

Expected behavior Telemetry collection enabled

Screenshots Image Image

Desktop (please complete the following information):

  • OS: macOS
  • Python version(python -V): 3.13.2
  • ADK version(pip show google-adk): 1.18.0

Model Information:

  • Are you using LiteLLM: No
  • Which model is being used: gemini-2.5-fals

Additional context Add any other context about the problem here.

postak avatar Nov 10 '25 21:11 postak

I see the same. Can you confirm that your Cloud Storage bucket is also empty? My "adk deploy agent_engine" command ignores whatever I put in the storage bucket parameter, and it seems those Agent Engine UI settings expect an archive URI.

rseroter avatar Nov 11 '25 17:11 rseroter

Same error here while using the agent-starter-pack

Freezaa9 avatar Nov 12 '25 08:11 Freezaa9

@postak This issue occurs because the Agent Engine deployment in cli_deploy.py:635-923 uses source-based deployment with local file paths but doesn't populate the source_archive field that the API expects.

When you try to update OpenTelemetry configuration in the GCP console,the API validates and finds this field empty.

As a workaround, deploy with --trace_to_cloud from the start and avoid modifying configuration via GCP console afterward.

Any configuration changes should be done by redeploying with ADK CLI.

The fix requires uploading the source code to GCS (using --staging_bucket) and setting agent_config['source_code_spec']['inline_source']['source_archive'] to the GCS URI before calling the API.

This issue is still present in v1.21.0.

surajksharma07 avatar Dec 16 '25 09:12 surajksharma07

@yeesian Please have a look into it.

surajksharma07 avatar Dec 16 '25 09:12 surajksharma07

I checked current main (7d3658e), and adk deploy agent_engine now uses client.runtimes.create/update with source packages and a Dockerfile. staging_bucket is deprecated and no longer used, so the older proposal to upload an archive through that option would not fit the current deployment path.

Has the empty source_archive error been reproduced with this runtime deployment path? I can help with a focused fix, but I would first like to confirm whether ADK or the runtime SDK is responsible for populating that field. I have not verified the console update on a live GCP deployment.

Samecho avatar Oct 14 '26 23:10 Samecho