Skip to content

Agent Engine build fails: .venv/bin/python: not found in compileall step (Step 20/21) #6370

@ninowalker

Description

@ninowalker

Product: Vertex AI Agent Engine (Reasoning Engine)
SDK: google-adk==1.25.1, google-cloud-aiplatform==1.132.0
Region: europe-west1

Description

Agent Engine update operations are failing during the GCP Agent Engine-side Docker build. The build successfully installs all pip packages but then crashes at a compileall step that references .venv/bin/python — a path that doesn't exist in the container.

Error

Step #3: Step 20/21 : RUN .venv/bin/python -m compileall "$(/code/.venv/bin/python -c "import site;
print(site.getsitepackages()[0])")" .
Step #3: /bin/sh: 1: /code/.venv/bin/python: not found
Step #3: /bin/sh: 1: .venv/bin/python: not found
Step #3: The command returned a non-zero code: 127

ERROR: build step 3 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 127

The client-side error (from GCP logs) is:

RuntimeError: Failed to update Agent Engine: {'code': 3, 'message': 'Build failed. The issue might be caused by incorrect code, requirements.txt file or other dependencies.'}

Reproduction

  • Reasoning Engine IDs: 5056539626932535296, 620309276019130368
  • The same codebase deployed successfully ~40 minutes earlier (run 22591095189 at 18:59 UTC succeeded; run 22592514748 at 19:37 UTC failed)
  • No code changes between the two deploys that would affect the build (only a docs .md file was added)

Timeline

│ Time (UTC) │ Run │ Result │
│ 2026-03-02 18:59 │ 22591095189 │ Success (SHA 946be00) │
│ 2026-03-02 19:37 │ 22592514748 │ Failure (SHA 0418383, only adds a .md file) │

Analysis

The Dockerfile template (GCP-side) used by Agent Engine expects .venv/bin/python to exist, but the build environment doesn't create a virtualenv at that path. This appears to be a server-side regression — the Dockerfile template (step 20/21) changed between the our two deploys, or the base Docker image was updated. Our code and requirements.txt did not change between the successful and failed runs.

Environment

  • google-adk==1.25.1 (pinned in deploy)
  • google-cloud-aiplatform==1.132.0
  • Python 3.13
  • Deploy method: vertexai._genai.agent_engines.update()
  • Builder image: gcr.io/cloud-builders/docker

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: vertex-aiIssues related to the googleapis/python-aiplatform API.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions