Skip to content

Cloud Run revision fails because container still listens on 127.0.0.1 and there’s no flag to override host #832

Closed

Description

@mykytaterentiev

🐛 Bug: Cloud Run revision fails because container listens on 127.0.0.1 and there’s no flag to override host

DescriptionAfter upgrading google-adk from 0.5.x to 1.0.0, every image produced by:adk deploy cloud_run …starts Uvicorn on http://127.0.0.1:$PORT instead of 0.0.0.0:$PORT.

Cloud Run’s runtime contract requires the process to listen on all interfaces, so the startup probe times out and the revision never becomes READY.

There is currently no CLI flag (--host, --bind_host, --extra_uvicorn_args, etc.) and no documented environment variable to change that behavior. Older docs reference --api_server_host/--dry-run, but those options are missing in the 1.0.0 release.

Reproduction steps

  1. ADK 1.0.0

  2. adk deploy cloud_run
    --project=$GOOGLE_CLOUD_PROJECT
    --region=$GOOGLE_CLOUD_LOCATION
    --service_name=$SERVICE_NAME
    --app_name=$APP_NAME
    $AGENT_PATH

  3. Select region (europe-west1)

  4. Wait for build & deploy

Expected behaviorRevision starts, Cloud Run health-check succeeds, and traffic routes to the READY revision.

Actual behaviorRevision remains Not Ready with error:Default STARTUP TCP probe failed … container "triana-lite-1" on port 8000.Connection failed with status DEADLINE_EXCEEDED.

Container log:INFO: Uvicorn running on http://127.0.0.1:8000 (Press CTRL+C to quit)

Logs & diagnostic info2025-05-21T16:41:50.528802Z INFO Uvicorn running on http://127.0.0.1:80002025-05-21T16:45:27.568625Z ERROR Default STARTUP TCP probe failed 1 time consecutively …

Environmentgoogle-adk: 1.0.0Python: 3.11 (Poetry)Cloud Run region: europe-west1Host OS: macOS 14.4 (Apple Silicon)

Proposed fixes

  1. Expose a --bind_host (or restore --api_server_host) flag in adk deploy cloud_run, defaulting to 0.0.0.0.

  2. Alternatively, inherit UVICORN_HOST or auto-detect Cloud Run and bind to 0.0.0.0.

  3. Update documentation accordingly.

Activity

  1. added
    core
    on May 21, 2025
  2. added theissue type on May 21, 2025
  3. omarsar commented on May 21, 2025

    @omarsar

    Ran into the same issue today. Any timeline for when this could be fixed?

  4. boyangsvl commented on May 22, 2025

    @boyangsvl
    Collaborator

    Host should be set to 0.0.0.0 automatically when using adk deploy. At this line: https://github.com/google/adk-python/blob/main/src/google/adk/cli/cli_deploy.py#L144

    @Jacksunwei to take a look. I'm not sure if adk_version > '0.5.0' is the right way to check for versions.

  5. omarsar commented on May 22, 2025

    @omarsar

    I can confirm that it now works for me. For me, it was an issue of having an older version of Google ADK. When I upgraded to 1.0.0, the cloud run deploy command works. However, if you follow the docs directly, you will notice that it complains about the missing argument for AGENT, which is really just the AGENT_PATH. Docs might need to be updated. Command I used:

    adk deploy cloud_run \
    --project=$GOOGLE_CLOUD_PROJECT \
    --region=$GOOGLE_CLOUD_LOCATION \
    --service_name=$SERVICE_NAME \
    --app_name=$APP_NAME \
    --with_ui \
    $AGENT
    
  6. boyangsvl commented on May 22, 2025

    @boyangsvl
    Collaborator

    Thanks @omarsar . Could you post the doc URL which has the issue?

  7. shiro-mitsumata commented on May 26, 2025

    @shiro-mitsumata

    I encountered the same problem. The solution for me was to explicitly specify "--host 0.0.0.0" in the CMD instruction of my Dockerfile. After this change, the Cloud Run revision deployed successfully.

  8. Jacksunwei commented on May 28, 2025

    @Jacksunwei
    Collaborator

    I think it's likely your local adk version is not 1.0.0. We had host issue in 0.5.0, and fixed it in 1.0.0.


    To verify, you could do pip show google-adk


    Side notes, we could consider to add adk --version to make it easier to check locally installed version.

  9. Jacksunwei commented on May 28, 2025

    @Jacksunwei
    Collaborator

    Closing it for now. Feel free to reopen if it's still not working on your side.

  10. added this to the FixIt Week milestone on May 28, 2025
  11. added a commit that references this issue on Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

core

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions