Persistent [WinError 2] File not found on Windows (vscode) when deploying ADK Agent to Cloud Run

Hello everyone,

I’m encountering a persistent and hard-to-diagnose error while trying to deploy an agent built with the Google Agent Development Kit (ADK) to Cloud Run from a Windows machine.

The adk deploy cloud_run command consistently fails with [WinError 2] The system cannot find the file specified. This error occurs right after the Dockerfile is successfully created in a temp directory, just as the “Deploying to Cloud Run…” phase begins.

Environment Details

OS: Windows 11

Terminal: PowerShell (in VS Code)

Core Tools:

Google Cloud SDK (v541.0.0)

Docker Desktop (v28.3.2)

Python (using a local .venv virtual environment)

Framework: google-adk

Command Used

Executed from the project’s root directory (C:\MODELOS_IA_GEN\parent_folder):

PowerShell

adk deploy cloud_run `
  --project projetorais-418701 `
  --region us-central1 `
  --service_name agente-documentacao-enem-service `
  --with_ui `
  .

Full Error Output

PowerShell

(.venv) PS C:\MODELOS_IA_GEN\parent_folder> adk deploy cloud_run ...
Start generating Cloud Run source files in C:\Users\helio\AppData\Local\Temp\cloud_run_deploy_src\20251006_224924
Copying agent source code...
Copying agent source code completed.
Creating Dockerfile...
Creating Dockerfile complete: C:\Users\helio\AppData\Local\Temp\cloud_run_deploy_src\20251006_224924\Dockerfile
Deploying to Cloud Run...
Cleaning up the temp folder: C:\Users\helio\AppData\Local\Temp\cloud_run_deploy_src\20251006_224924
Deploy failed: [WinError 2] The system cannot find the file specified

Troubleshooting Steps Already Taken

I have already verified and ruled out the most common causes for this type of error:

  1. Verified Core CLIs:

    • Both gcloud --version and docker --version execute successfully from the same terminal, confirming they are correctly installed and in the system’s PATH.
  2. Simplified Project Path:

    • The project was moved from a long OneDrive path with spaces to a simple path (PII Removed by Staff) to eliminate any path-related issues. The error persisted.
  3. Recreated Virtual Environment:

    • A clean Python virtual environment (.venv) was created in the new project directory, activated, and all dependencies (including google-adk) were reinstalled using pip. The adk command is found, but the deployment error remains.
  4. Configured Docker Credential Helper:

    • I successfully ran gcloud auth configure-docker us-central1-docker.pkg.dev. The command confirmed that Docker’s config.json was updated to use gcloud as a credential helper. This did not resolve the issue.

Current Hypothesis

Since the main executables (gcloud.exe, docker.exe) are found and the Docker authentication is configured, my current hypothesis is that the adk Python script is failing when it tries to launch a child process or a helper script during the image build stage. The [WinError 2] error suggests that the Python subprocess module cannot locate a specific executable that is being called internally by the ADK wrapper script.

My Question to the Community

Has anyone else encountered this specific [WinError 2] error when using the ADK on a Windows environment?

  1. Is there a known issue or a required workaround for how the ADK’s Python scripts invoke subprocesses (like docker build) on Windows?

  2. Are there any undocumented flags or methods to enable verbose/debug logging for the adk tool itself to see the exact command that is failing?

My immediate next step is to attempt to capture the auto-generated Dockerfile and run docker build manually to see if the error can be isolated to the Docker build process itself.

Any help or insight would be greatly appreciated. Thank you!

2 Likes

(.venv) PS C:\MODELOS_IA_GEN\parent_folder> adk deploy cloud_run …

Start generating Cloud Run source files in C:\Users\helio\AppData\Local\Temp\cloud_run_deploy_src\20251006_224924

Copying agent source code…

Copying agent source code completed.

Creating Dockerfile…

Creating Dockerfile complete: C:\Users\helio\AppData\Local\Temp\cloud_run_deploy_src\20251006_224924\Dockerfile

Deploying to Cloud Run…

Cleaning up the temp folder: C:\Users\helio\AppData\Local\Temp\cloud_run_deploy_src\20251006_224924

Deploy failed: [WinError 2] The system cannot find the file specified

Same exact problem here. Same exact messages (except obviously for my user and path).