Skip to content

Dev UI returns 404s when url_prefix is set in read-only environments #4601

@meadsteve

Description

@meadsteve

Bug description

The dev UI frontend fetches runtime-config.json to discover the backendUrl (url_prefix). The current implementation (_setup_runtime_config in adk_web_server.py) writes this file into the installed package directory at startup:

src/google/adk/cli/browser/assets/config/runtime-config.json

In containerized environments where .venv is read-only, this write fails silently — the IOError is caught and logged but execution continues. The frontend then loads the static default {"backendUrl": ""} and makes all API calls without the url_prefix, resulting in 404s.

Steps to reproduce

  1. Install google-adk into a read-only virtualenv (e.g. a container image where .venv is baked into a read-only layer)
  2. Run adk web --url_prefix /my-prefix
  3. Open the dev UI in a browser
  4. Observe that API calls go to /api/... instead of /my-prefix/api/..., returning 404

Expected behavior

The dev UI should correctly use the configured url_prefix for all API calls regardless of whether the package directory is writable.

Actual behavior

The IOError when writing runtime-config.json is caught and logged:

Failed to write runtime config file .../runtime-config.json: [Errno 30] Read-only file system: '...'

The frontend falls back to {"backendUrl": ""} and all API requests 404.

Environment

  • OS: Linux (Docker container with read-only .venv)
  • Python version: 3.11+
  • ADK version: latest main

Proposed fix

Serve runtime-config.json dynamically via a FastAPI endpoint instead of writing to the filesystem. See #4600.

Metadata

Metadata

Assignees

No one assigned

    Labels

    web[Component] This issue will be transferred to adk-web

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions