feedback icon indicating copy to clipboard operation
feedback copied to clipboard

[use-an-mcp-server-on-cloud-run-with-an-adk-agent]:

Open nairensworld opened this issue 3 months ago • 0 comments

Hello, thanks for the nice tutorial.

I faced an issue during the deployment to cloud run using the deployment instructions from the tutorial, here are the logs:

Command adk deploy cloud_run --project=mcp-test-project-471013 --region=europe-west1 --service_name=zoo-tour-guide --with_ui "C:\Users\eitanarat\Desktop\projects\agents\zoo_guide_agent" --temp_folder="C:\Users\eitanarat\Desktop\projects\agents\zoo_guide_agent\temp1"

Console Logs Start generating Cloud Run source files in C:\Users\eitanarat\Desktop\projects\agents\zoo_guide_agent\temp1 Copying agent source code... Copying agent source code completed. Creating Dockerfile... Creating Dockerfile complete: C:\Users\eitanarat\Desktop\projects\agents\zoo_guide_agent\temp1\Dockerfile Deploying to Cloud Run... Cleaning up the temp folder: C:\Users\eitanarat\Desktop\projects\agents\zoo_guide_agent\temp1 Deploy failed: [WinError 2] The system cannot find the file specified

Analyze

  1. While looking over the deployment code I added few debugging lines and found that the issue resides in: cli_deploy.py, function to_cloud_run, the line subprocess.run(

  2. I added logs before and after subprocess.run(

    click.echo('Running gcloud command...') click.echo(f' gcloud run deploy {service_name} --source {temp_folder} --project {project} {" ".join(region_options)} --port {port} --verbosity {log_level.lower() if log_level else verbosity} --labels created-by=adk')

    subprocess.run( ... ...

    ) click.echo('Deploying to Cloud Run complete.')

  3. I found that the lines before printed to the console but the one after not. Console Logs

Deploying to Cloud Run... Using project: mcp-test-project-471013 Running gcloud command... gcloud run deploy zoo-tour-guide --source C:\Users\eitanarat\Desktop\projects\agents\zoo_guide_agent\temp1 --project mcp-test-project-471013 --region europe-west1 --port 8000 --verbosity info --labels created-by=adk Note: Temporary folder is not removed for debugging purposes. Deploy failed: [WinError 2] The system cannot find the file specified

  1. I understand that the code creates Dockerfile from template and then run the gcloud run deploy command.

  2. I commented out the finalize removal of the folder to check if the deployment will work manually and it worked.

  3. That's how I concluded that the issue resides in line subprocess.run(

*System Info I run the deployment command In git bash and PowerShell in VS Code, OS Windows 11.

Improvement Suggestions After the deployment I bumped into a missing API Key and missing Langchin issues. I resolved it by adding ENV API_KEY=*** to the Dokerfile and the requirements.text file must be located under the agent folder.

Hope it will help others. Thanks Eitan from Nairens World. For further details you may contact me on [email protected] as well.

nairensworld avatar Sep 20 '25 10:09 nairensworld