Skip to content

fix(backend): the Redis service manager queries the SLM with an empty node id and no credential, so status is always unknown #16346

Open

Description

@mrveiss

Found while moving Redis control into the SLM (#16245, #16252). Code read from base a12b4bf79; the live-host facts come from the local test install's logs, read only. Nothing was executed.

What happens

  • RedisServiceManager takes its node from config.redis_node_id (autobot-backend/services/redis_service_manager.py:35,118). autobot_shared/ssot_config.py:2035 defaults REDIS_NODE_ID to "". Only docker-compose.yml:280,414 sets it. On the test install the manager logs initialized for node=, service=redis-stack-server.
  • With an empty id:
    • _slm_get_service_status requests /api/nodes//services;
    • _slm_service_action posts to /api/nodes//services/redis-stack-server/{action}.
  • Neither request carries a credential: get_http_client().tracked_request(...) is called with no auth header. The SLM's list_node_services (autobot-slm-backend/api/services.py:206-211) requires get_current_user.
  • _slm_get_service_status maps any non-200 to "unknown".
  • get_service_status fills only status and last_check, so pid, uptime_seconds and memory_mb are always null.
  • The upshot: on this install, GET /api/redis-service/status answers 200 with status "unknown". The SLM panel polled it 130 times in the current backend log.
  • I did not capture the SLM's reply to the empty-id request; no SLM access-log line for it exists.

After #16245 the SLM's Redis panel reads the SLM's own node-service API directly and no longer calls /api/redis-service. That router stays in place.

Related: a second Redis path with no caller

The SLM has its own autobot-slm-backend/api/redis_service.py, mounted with require_service_management. It runs systemctl and redis-cli INFO on the SLM host itself. No frontend calls it, and it is only correct when Redis runs on the SLM host.

Ask

  • Resolve the Redis node from the SLM's redis role owner (GET /api/roles/owners), not from an env var that bare-metal installs never set. Or fail loudly on an empty id, instead of querying /api/nodes//services.
  • Send a credential the SLM accepts.
  • Report an empty-id or 401 failure as what it is, not as "unknown".
  • Decide whether the SLM's local /api/redis-service route stays. If it does, give it a caller or record why it has none.

Refs #16245, #16252.

Activity

  1. modified the milestones: Backlog, v0.16.0 on Sep 12, 2026
  2. mrveiss commented on Oct 18, 2026

    @mrveiss
    OwnerAuthor

    Still live on the dev install at 555e914 (2026-10-18). Startup logs Redis Service Manager initialized for node=, service=redis-stack-server, and GET /api/redis-service/status as an admin returns 200 with {"status":"unknown","pid":null,...} while redis-stack-server is running. Since #18774 the route is gated (anonymous gets 401), so this is now the only defect on it.

  3. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Oct 31, 2026
  4. github-actions commented on Oct 31, 2026

    @github-actions
    Contributor

    needs-structure cleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).

  5. removed
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 2, 2026
  6. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    Decision needed: the credential fix asked for here cannot work without widening SLM auth, and nothing calls this route.

    Read from main at 6c34ee1. Nothing was run.

    Options:

    1. Retire the backend's /api/redis-service route and RedisServiceManager (recommended). The SLM is the control plane for all services and already serves this to the panel, so the defect goes away with the path that has it. The removal would be re-checked for callers on main at the time.
    2. Keep it and let the backend through. Move the SLM routes above to require_service_management_or_internal, send the internal key, and report empty-id and 401 failures as themselves. This gives a machine credential the power to start and stop services on any node, for a route with no known caller.
    3. Keep it and fail loudly only. An empty id or refused call reports what happened instead of unknown. Status stays unavailable, but stops misleading.

    Separately, the SLM's own /api/redis-service needs a ruling too. It only works when Redis runs on the SLM host. Recommended: leave it in place and track it under this issue until the first choice is made.

  7. added
    needs-decisionBlocked on an owner decision; options and a recommendation are on the issue
    on Nov 2, 2026
  8. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    Maintainer decision: option 1. Retire the backend's /api/redis-service route and RedisServiceManager; the SLM does this job. The maintainer noted that outside callers can't be seen from the repo.

    Before removal, on main at that time:

    • Confirm the SLM's replacement for the route and manager has landed, and quote it.
    • Confirm nothing else uses the manager.

    The PR waits until the merge train coordinator asks for it. The SLM's own /api/redis-service was not part of this decision and stays as it is.

  9. removed
    needs-decisionBlocked on an owner decision; options and a recommendation are on the issue
    on Nov 2, 2026
  10. mrveiss commented on Nov 22, 2026

    @mrveiss
    OwnerAuthor

    Owner decision (2026-11-22): keep the SLM's own /api/redis-service route. #22030 documents in its module docstring that it currently has no caller and is correct only when Redis runs on the SLM host. No code is removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions