Hello all,
I am from non-it (non-programming) background.
I have attended the recent “Asia Pacific: Cloud Technical Series, AI in Action“. It was interesting and I loved it.
While doing the lab, I performed all the action as provided. However, after the below steps, the Agent does not respond.
Task 4. Run the agent using the ADK Dev UI
ADK includes a development UI designed to run locally to help you develop and test your agents. It can help you visualize what each agent is doing and how multiple agents interact with one another. In this task, you explore this interface.
Note: When you run an agent, ADK needs to know who is requesting the model API calls. You can provide this information in one of two ways:
-
Provide a Gemini API key.
-
Authenticate your environment with Google Cloud credentials and associate your model API calls with a Vertex AI project and location.
In this lab, you take the Vertex AI approach.
-
In the Cloud Shell Terminal, run the following to write an
.envfile to set environment variables instructing the agent to use your project and the global endpoint:cd ~/adk_project cat << EOF > my_google_search_agent/.env GOOGLE_GENAI_USE_VERTEXAI=TRUE GOOGLE_CLOUD_PROJECT=YOUR_GCP_PROJECT_ID GOOGLE_CLOUD_LOCATION=global MODEL=gemini_flash_model_id EOFCopied!
These variables play the following roles:
-
GOOGLE_GENAI_USE_VERTEXAI=TRUEindicates that you use Vertex AI for authentication as opposed to Gemini API key authentication. -
GOOGLE_CLOUD_PROJECTandGOOGLE_CLOUD_LOCATIONprovide the project and location with which to associate your model calls. -
MODELis not required, but is stored here so that it can be loaded as another environment variable. This can be a convenient way to try different models in different deployment environments.
The ADK Dev UI and CLI chat interface automatically load configurations from an .env file. If no file is present, they use system environment variables with matching names.
-
In the Cloud Shell Terminal, ensure you are in the adk_project directory where your agent subdirectories are located by running:
cd ~/adk_projectCopied!
-
Launch the ADK Dev UI, allowing Cloud Shell as an origin, with the following command:
adk web --allow_origins "regex:https://.*\.cloudshell\.dev"Copied!
Output
INFO: Started server process [2434] INFO: Waiting for application startup. +-------------------------------------------------------+ | ADK Web Server started | | | | For local testing, access at http://localhost:8000. | +-------------------------------------------------------+ INFO: Application startup complete. INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit) -
To view the web interface in a new tab, click the http://127.0.0.1:8000 link in the Terminal output, which links you via proxy to this app running locally on your Cloud Shell instance.
-
From the Select an agent menu options on the left, select my_google_search_agent.
-
To encourage the agent to use its Google Search tool, enter the question:
What is some recent global news?
So, I tried Gemini if it could help and followed the below steps:
It looks like we’ve hit two different snags at once. Let’s break them down so we can get your agent back on track. ![]()
1. The Directory Error
The error shell-init: error retrieving current directory usually happens when the folder you are currently “standing” in has been deleted or moved while you were inside it. Since your terminal can’t find its own feet, it’s having trouble running commands.
2. The Invalid Argument
The INVALID_ARGUMENT error likely occurred because the $GOOGLE_CLOUD_PROJECT variable we tried to use didn’t stay “stuck” in the terminal’s memory, or it was empty.
Let’s Reset Your Connection 
We can fix both of these by refreshing your location and manually defining the project. Please follow these steps in order:
-
Move to a safe directory: Run
cd ~to move to your home folder. This fixes the “cannot access parent directories” error. -
Go back to your project: Run
cd ~/adk_project. -
Run the quota command manually: Instead of using the variable, let’s type the Project ID directly.
Run this command (Replace [YOUR_PROJECT_ID] with your actual lab ID, e.g., qwiklabs-gcp-00-1234):
gcloud auth application-default set-quota-project [YOUR_PROJECT_ID]
Once you run that, does it return a success message like “Credentials updated with quota project,” or does it give you a new error? ![]()
I have tried 4 times. .. but I get the same error
I need to complete the lab by April 03, 2026.
Can someone please guide me how to resolve this and proceed further.
Thank you in advance for your help.
Kumar.

