-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.
Describe the bug
On Windows, running ADK commands that trigger logging (such as adk run ...) fails with OSError: [WinError 1314] due to an attempt to create a symlink for the latest log file in a temp directory. This requires admin privileges on Windows, causing the CLI to crash for non-admin users.
To Reproduce
Steps to reproduce the behavior:
- Install google-adk on Windows.
- Run adk run as a non-admin user. (followed quick start guide)
- Observe the error:
OSError: [WinError 1314] A required privilege is not held by the client: ...
Expected behavior
ADK should log to a user-writable directory and not crash if symlink creation is not permitted. Ideally, the log directory should be configurable, and symlink creation should be skipped or handled gracefully on platforms where it is not supported.
Screenshots
Desktop (please complete the following information):
- OS: Windows 10/11
- Python version(python -V): Python 3.13.0
- ADK version(pip show google-adk):
Name: google-adk
Version: 1.5.0
Summary: Agent Development Kit
Home-page: https://google.github.io/adk-docs/
Author:
Author-email: Google LLC googleapis-packages@google.com
License:
Location: -Redacted-
Requires: anyio, authlib, click, fastapi, google-api-python-client, google-cloud-aiplatform, google-cloud-secret-manager, google-cloud-speech, google-cloud-storage, google-genai, graphviz, mcp, opentelemetry-api, opentelemetry-exporter-gcp-trace, opentelemetry-sdk, pydantic, python-dateutil, python-dotenv, PyYAML, requests, sqlalchemy, starlette, typing-extensions, tzlocal, uvicorn, websockets
Required-by:
Model Information:
N/A (applies to CLI/logging, not model-specific)
Additional context
Related to closed issue #6 (https://github.com//issues/6) , but the problem persists.
The root cause is in logs.py, which always attempts to create a symlink for the latest log file.
Proposed solution:
Add support for a LOG_DIR environment variable to allow users to specify a writable log directory.
Gracefully handle symlink creation: skip or warn (but do not crash) if symlinks are not supported or permitted (especially on Windows).
I am preparing a PR to address this and would appreciate any feedback or additional requirements.