fix(wizard): co-located backend binds wrong host:port; SLM frontend missing VITE_API_URL (#3426)#3429
Open
mrveiss wants to merge 1 commit intoDev_new_guifrom
Open
fix(wizard): co-located backend binds wrong host:port; SLM frontend missing VITE_API_URL (#3426)#3429mrveiss wants to merge 1 commit intoDev_new_guifrom
mrveiss wants to merge 1 commit intoDev_new_guifrom
Conversation
…issing VITE_API_URL (#3426) Root cause 1: _ROLE_INFRA_VARS["backend"] used port 8443 (nginx TLS port), causing backend_host=<node_ip> and backend_port=8443 to be passed as all.vars extra_vars (highest precedence). The backend role's service template rendered uvicorn with --host 172.16.168.20 --port 8443; nginx already holds 8443 so the backend failed to start. Fix: change port to 8001 (internal uvicorn port) and use 127.0.0.1 for co-located nodes (IP in local_ips) so uvicorn binds to loopback where nginx upstream expects it. Root cause 2: _apply_colocation_vars only set slm_colocated_frontend=True on the frontend node, never on 00-SLM-Manager. Phase 4c required the host to be in BOTH frontend AND slm_server groups — 00-SLM-Manager is only in slm_server, so Phase 4c never fired and the SLM frontend was built without VITE_API_URL=/slm. Login page then called /api/auth/login (user backend) instead of /slm/api/auth/login. Fix: propagate slm_colocated_frontend=True to 00-SLM-Manager when any co-located frontend is detected. Simplify Phase 4c detection to use the slm_colocated_frontend var directly (with package.json stat as fallback for standalone deploy-slm-manager.yml runs), gated on slm_server group membership.
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_ROLE_INFRA_VARS["backend"]used port8443(nginx TLS port) → wizard passedbackend_host=<node_ip>andbackend_port=8443asall.vars(highest precedence) → uvicorn started with--host 172.16.168.20 --port 8443→ nginx already holds 8443 → backend fails to bind →/api/health504_apply_colocation_varssetslm_colocated_frontend=Trueon the frontend node but not on00-SLM-Manager→ Phase 4c required the host to be in bothfrontendANDslm_servergroups → never fired → SLM frontend built withoutVITE_API_URL=/slm→ login page called/api/auth/login(user backend) instead of/slm/api/auth/loginChanges
setup_wizard.py:_ROLE_INFRA_VARS["backend"]: port8443→8001(internal uvicorn port)_build_infra_vars: use127.0.0.1for co-located nodes (IP inlocal_ips) so services bind to loopback_fetch_inventory_data: returnlocal_ipsin tuple_apply_colocation_vars: propagateslm_colocated_frontend=Trueto00-SLM-Managerwhen co-located frontend detectedprovision-fleet-roles.ymlPhase 4c:slm_colocated_frontend | bool(wizard-set) + package.json stat (fallback for standalone runs), gated onslm_servergroup membership_slm_nginx_rerendered is definedguard (was undefined on non-SLM hosts causing warnings)Test plan
127.0.0.1:8001/slm/works after re-provision (SLM frontend hasVITE_API_URL=/slm)00-SLM-Managerwhen co-located frontend is deployeddeploy-slm-manager.ymlflow: package.json fallback correctly detects co-locationCloses #3426
🤖 Generated with Claude Code