Skip to content

bug(ansible): backend.env.j2 missing AUTOBOT_AI_STACK_HOST for co-located deployment #3503

Description

@mrveiss

Problem

backend.env.j2 does not set AUTOBOT_AI_STACK_HOST or AUTOBOT_AI_STACK_PORT. The backend falls back to ssot_config.py's default (127.0.0.1) and network_constants.py's ConfigRegistry.get("vm.aistack", "").

In co-located deployments on WSL2-based nodes (e.g. the backend/ai-stack backend node), 127.0.0.1 gets ECONNREFUSED — the correct loopback IP is 10.255.255.254 (WSL2 mirrored networking's lo interface IP). The backend silently cannot reach the AI stack.

How It Was Discovered

During #3491: verified that NetworkConstants.AI_STACK_HOST resolves to 127.0.0.1 (the fallback) since vm.aistack is not in config. Direct socket.connect(('127.0.0.1', 8080)) returned ECONNREFUSED, but nc -zv 10.255.255.254 8080 succeeded.

Fix

Add to backend.env.j2:

# AI Stack (co-located on same host)
AUTOBOT_AI_STACK_HOST={{ ai_stack_host | default('127.0.0.1') }}
AUTOBOT_AI_STACK_PORT={{ ai_stack_port | default(8080) }}

And in the backend role's defaults/main.yml, set ai_stack_host appropriately for co-located deployments. For WSL2 nodes: 10.255.255.254. For normal Linux nodes: 127.0.0.1.

Affected Files

  • autobot-slm-backend/ansible/roles/backend/templates/backend.env.j2
  • autobot-slm-backend/ansible/roles/backend/defaults/main.yml

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions