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

The agent is working on a local environment but not after deployment. (LlmAgent' object has no attribute 'static_instruction)

Open suresh-ums opened this issue 1 year ago • 11 comments

My application works correctly on my local machine but is failing on Agent Engine.
The agent is working on a local environment but not after deployment.

'LlmAgent' object has no attribute 'static_instruction' --  
AttributeError
Traceback (most recent call last): File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.13/lib/python3.13/site-packages/opentelemetry/trace/__init__.py", line 589, in use_span yield span File "/home/appuser

suresh-ums avatar Oct 01 '25 08:10 suresh-ums

Hi, can I check which version of google-adk are you on? There were people who ran into similar issues and it was resolved when they pinned to google-adk>=1.15.1 both locally and in their requirements.txt file when they're deploying to AgentEngine. Can I check if that works for you?

yeesian avatar Oct 01 '25 14:10 yeesian

My problem was altough the google cloud install 1.15.1, local version was 1.14.x.

It got fixed by pip install google-adk>=1.15.1

saeedmithra avatar Oct 05 '25 11:10 saeedmithra

@yeesian I am encountering the same issue even with google-adk>=1.15.1. This are the package versions: requirements=[ "google-cloud-aiplatform[adk,agent_engines]>=1.111", "google-cloud-bigquery", "google-adk>=1.15.1", ]

ERROR:

exception.message -> 'LlmAgent' object has no attribute 'static_instruction'

exception.stacktrace -> Traceback (most recent call last): File "/home/appuser/.cache/pypoetry/virtualenvs/reasoning-engine-assembly-service-MATOk_fk-py3.13/lib/python3.13/site-packages/opentelemetry/trace/init.py", line 589, in use_span
yield span
File "/home/appuser

deya2-whr avatar Oct 06 '25 13:10 deya2-whr

facing same issue

    requirements=[
        "google-cloud-aiplatform[adk,agent_engines]>=1.119.0",
        "google-adk>=1.15.1"
    ],

ssingh5bmcd avatar Oct 08 '25 11:10 ssingh5bmcd

Hello, I have resolved it with the following requirements. @suresh-ums

remote_app = agent_engines.update(
    agent_engine=app,
    resource_name="xxxxxxxx",
    service_account="sa-agents@xxxxx",
    requirements=[
        "google-cloud-aiplatform[adk,agent_engines]",
        "google-adk>=1.16.0",
        "llama-index",
        "langfuse",
        "google-cloud-secret-manager"
    ],
    extra_packages=["./agente", "./log"],
)

dvdeveloper avatar Oct 09 '25 20:10 dvdeveloper

Seems this is resolved and can be closed. Feel free to reopen otherwise.

Jacksunwei avatar Oct 10 '25 02:10 Jacksunwei

remote_app = agent_engines.update( 
    resource_name = deployed_agent_engine_app,
    agent_engine=app,
    requirements=[
        "google-cloud-aiplatform[adk,agent_engines]",
        "google-adk>=1.16.0",
        "google-cloud-bigquery",
        # "google-genai>=1.21.1, <=1.40.0, !=1.37.0, !=1.38.0, !=1.39.0"
    ],
    extra_packages = ["./bigquery_chatbot_v1"], ``
    service_account = "xxxxxxx"
)

@dvdeveloper @yeesian @Jacksunwei @boyangsvl : I have tried with the above versions as well as mentioned in earlier solutions. Did not work for me. Still getting the same error.

deya2-whr avatar Oct 10 '25 07:10 deya2-whr

Hey @deya2-whr, can I check if the issue still persists for you with a fresh creation of a new agent (versus updating an existing agent)?

I just wanted to check if it's because the pip package manager is still staying on the previous version of the respective packages rather than picking up your new constraint of "google-adk>=1.16.0"

yeesian avatar Oct 20 '25 17:10 yeesian

@yeesian : Yes I tried to create a new agent and encountered the same exact error.

The final list of requirements: ['google-cloud-aiplatform[adk,agent_engines]', 'google-adk>=1.1 6.0', 'google-cloud-bigquery', 'cloudpickle==3.1.1', 'pydantic==2.11.7']

deya2-whr avatar Oct 21 '25 08:10 deya2-whr

@yeesian I am facing the same issue. Tried 1.16.0 as well as 1.15.1. Tried after deleting everything and then redeploying.

Souviksamanta34 avatar Jan 14 '26 13:01 Souviksamanta34

Hi @yeesian Facing the same issue dependencies = [ "google-adk (>=1.23.0,<1.25.1)", "google-genai (>=1.60.0,<2.0.0)", "python-dotenv (>=1.1.1,<2.0.0)", "numpy (>=2.3.2,<3.0.0)", "pandas (>=2.3.1,<3.0.0)", "immutabledict (>=4.2.1,<5.0.0)", "requests (>=2.32.4,<3.0.0)", "google-cloud-discoveryengine", "google-cloud-aiplatform[agent-engines] (>=1.125.0)", "google-cloud-bigquery (>=3.35.1,<4.0.0)", "regex (>=2024.5.15,<2025.0.0)", "sqlglot (>=25.3.0,<26.0.0)", "absl-py (>=2.3.1,<3.0.0)", "db-dtypes (>=1.4.3,<2.0.0)" ]

jvidhi avatar Feb 20 '26 18:02 jvidhi