Skip to content

Windows log symlink creation fails without admin rights; suggest configurable log dir and graceful fallback #1785

@flegare

Description

@flegare

** 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:

  1. Install google-adk on Windows.
  2. Run adk run as a non-admin user. (followed quick start guide)
  3. 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

Image

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.

Metadata

Metadata

Assignees

Labels

bot triaged[Bot] This issue is triaged by ADK bothelp wanted[Community] Extra attention is neededmcp[Component] Issues about MCP supporttools[Component] This issue is related to tools

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions