Skip to content

adk web fails silently when default port (8000) is already in use #412

@skurzyp

Description

@skurzyp

Description

When running adk web <file>.ts, the CLI exits immediately with a code 0 (success) even if the target port (default 8000) is already occupied by another process. It does not provide any error message or warning that the server failed to bind.

Steps to Reproduce

  1. Start any service on port 8000 (e.g., python -m http.server 8000).
  2. Run an ADK agent using the web command:
    bunx adk web index.ts
  3. Observe that the command finishes instantly without output and returns to the prompt.

Expected Behavior

The CLI should catch the EADDRINUSE error and print a descriptive message:

Error: Port 8000 is already in use. Please use the -p flag to specify a different port.

Environment Details

  • OS: Windows 11 (Build 26200)
  • Runtime: Bun 1.3.5 / Node v23.11.1
  • ADK Devtools Version: 0.5.0
  • ADK Core Version: 0.5.0

Additional Context

  • bunx adk run agent.ts works perfectly (CLI mode).
  • bunx adk web index.ts -p <free_port> works perfectly.
  • The issue persists even when using npx (Node.js) instead of bunx, suggesting the error is swallowed within the @google/adk-devtools server implementation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions