GoogleCloudPlatform / GoogleCloudPlatform/agent-starter-pack
cyber-guardian Agent Engine deployment failed with 403
- Dominant language
- Python
- Stars
- 6.6k
- Forks
- 1.5k
- PR merge metrics
- No merged PRs in 30d
Description
Error log:
I can confirm BG dataset `cyber_guardian_dataset` exists in this project.
Command to deploy (generated by Agent Garden, I only changed agent-starter-pack version to v0.41.3 ):
`
export PROJECT_ID=$(gcloud config get-value project) && export PROJECT_NUMBER=$(gcloud projects describe $PROJECT_ID --format='value(projectNumber)') && export AGENT_NAME=cyber-guardian-${RANDOM} && uvx agent-starter-pack==0.41.3 create ${AGENT_NAME} -d agent_engine -ag -a adk@cyber-guardian-agent && cd ${AGENT_NAME} && make install && make backend && gcloud projects add-iam-policy-binding $PROJECT_ID --member='serviceAccount:service-${PROJECT_NUMBER}@gcp-sa-aiplatform-re.iam.gserviceaccount.com' --role='roles/bigquery.dataEditor' && make deploy
`
```
"Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in _run_code
File "/code/app/__main__.py", line 37, in
main()
File "/code/app/__main__.py", line 22, in main
uvicorn.run(
File "/code/.venv/lib/python3.12/site-packages/uvicorn/main.py", line 617, in run
server.run()
File "/code/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 75, in run
return asyncio_run(self.serve(sockets=sockets), loop_factory=self.config.get_loop_factory())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/runners.py", line 195, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/asyncio/base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/code/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 79, in serve
await self._serve(sockets)
File "/code/.venv/lib/python3.12/site-packages/uvicorn/server.py", line 86, in _serve
config.load()
File "/code/.venv/lib/python3.12/site-packages/uvicorn/config.py", line 455, in load
self.loaded_app = self.loaded_app()
^^^^^^^^^^^^^^^^^
File "/code/app/api/app.py", line 68, in create_app
raise e
File "/code/app/api/app.py", line 47, in create_app
utils.load_agent_from_python_spec()
File "/code/app/api/factory/utils.py", line 441, in load_agent_from_python_spec
agent_module = importlib.import_module(ENTRYPOINT_MODULE)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1310, in _find_and_load_unlocked
File "", line 488, in _call_with_frames_removed
File "", line 1387, in _gcd_import
File "", line 1360, in _find_and_load
File "", line 1331, in _find_and_load_unlocked
File "", line 935, in _load_unlocked
File "", line 999, in exec_module
File "", line 488, in _call_with_frames_removed
File "/code/cyber_guardian/__init__.py", line 10, in
from .agent import root_agent # noqa: E402, F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/code/cyber_guardian/agent.py", line 9, in
from .sub_agents.investigation.agent import investigation_agent
File "/code/cyber_guardian/sub_agents/investigation/__init__.py", line 1, in
from .agent import investigation_agent # noqa: F401
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/code/cyber_guardian/sub_agents/investigation/agent.py", line 6, in
from ...tools import investigationQueryTool
File "/code/cyber_guardian/tools.py", line 317, in
init_bq_tables()
File "/code/cyber_guardian/tools.py", line 262, in init_bq_tables
client.create_dataset(dataset, exists_ok=True)
File "/code/.venv/lib/python3.12/site-packages/google/cloud/bigquery/client.py", line 724, in create_dataset
return self.get_dataset(dataset.reference, retry=retry)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/code/.venv/lib/python3.12/site-packages/google/cloud/bigquery/client.py", line 919, in get_dataset
api_response = self._call_api(
^^^^^^^^^^^^^^^
File "/code/.venv/lib/python3.12/site-packages/google/cloud/bigquery/client.py", line 861, in _call_api
return call()
^^^^^^
File "/code/.venv/lib/python3.12/site-packages/google/api_core/retry/retry_unary.py", line 294, in retry_wrapped_func
return retry_target(
^^^^^^^^^^^^^
File "/code/.venv/lib/python3.12/site-packages/google/api_core/retry/retry_unary.py", line 156, in retry_target
next_sleep = _retry_error_helper(
^^^^^^^^^^^^^^^^^^^^
File "/code/.venv/lib/python3.12/site-packages/google/api_core/retry/retry_base.py", line 216, in _retry_error_helper
raise final_exc from source_exc
File "/code/.venv/lib/python3.12/site-packages/google/api_core/retry/retry_unary.py", line 147, in retry_target
result = target()
^^^^^^^^
File "/code/.venv/lib/python3.12/site-packages/google/cloud/_http/__init__.py", line 494, in api_request
raise exceptions.from_http_response(response)
google.api_core.exceptions.Forbidden: 403 GET https://bigquery.googleapis.com/bigquery/v2/projects/280919645160/datasets/cyber_guardian_dataset?prettyPrint=false: Access Denied: Dataset 280919645160:cyber_guardian_dataset: Permission bigquery.datasets.get denied on dataset 280919645160:cyber_guardian_dataset (or it may not exist)."
```
Contributor guide
Research direction
Start with cyber_guardian/tools.py, especially init_bq_tables(), and trace how the generated Agent Engine deployment reaches that import through cyber_guardian/agent.py. Reproduce the supplied command and inspect the BigQuery permission failure; done means the generated cyber-guardian agent deploys without the reported 403.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- gcp, python
- Domain
- cloud, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100