Skip to content

"adk deploy agent_engine" fails if the agent folder name contains dashes. #2902

Closed as not planned

Description

@slilichenko

To reproduce, run:

adk deploy agent_engine <options> agent-folder-name.

The generated code will fail on the following line:

...
from agent-folder-name.agent import root_agent
..

with "Deploy failed: Failed to set up agent engine <vertexai.agent_engines._agent_engines.ModuleAgent object at 0x1310dbad0>: invalid syntax (agent_engine_app.py, line 13)".

It's pretty hard to debug, at the very least would be good to add a validation step and print a descriptive reason for the failure.

Activity

  1. added theissue type on Sep 10, 2025
  2. surajksharma07 commented on Oct 10, 2025

    @surajksharma07
    Collaborator

    Hi @silichenko,

    Rename your agent folder to use underscores instead of dashes (e.g., agent_folder_name instead of agent-folder-name), and it should work.
    Thanks.

  3. removed their assignment
    on Oct 10, 2025
  4. yeesian commented on Oct 10, 2025

    @yeesian
    Collaborator

    We'll work on providing better validation and error messages, thank you for the report!

  5. self-assigned this
    on Oct 10, 2025
  6. removed their assignment
    on Nov 29, 2025
  7. added a commit that references this issue on Jan 23, 2026
    c26e4b0
  8. surajksharma07 commented on Feb 5, 2026

    @surajksharma07
    Collaborator

    @slilichenko The issue happens because Python module names can't contain dashes - they're interpreted as minus operators.

    Rename your agent folder to use underscores instead (e.g., agent_folder_name instead of agent-folder-name) and the deployment will work.

    PR #4246 is open to add proper validation with a clearer error message.

    For now, just swap dashes for underscores in your folder name.

  9. wuliang229 commented on Feb 13, 2026

    @wuliang229
    Collaborator

    This seems to be no longer an issue due to as I just tested with adk deploy agent_engine --project=$PROJECT_ID --region=$LOCATION_ID --display_name="My First Agent" hello-world. Seems to be related to how the template has changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

agent engine[Component] This issue is related to Vertex AI Agent Enginegood first issue[Community] This issue is good for newcomers to participate

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions