Skip to content

bug: system agent is never created on a fresh install until the backend restarts — /setup creates the admin after the only deploy attempt #3237

Closed

Description

@obasilakis

Summary

On a fresh install that creates its admin through /setup (every one-click / marketplace path: DigitalOcean, AWS, the hosted script), trinity-system is never deployed until something restarts the backend. The only deploy attempt runs at backend startup, before /setup has created the admin, and fails:

System agent: create_failed - Failed to create system agent: Admin user 'admin' not found

Nothing retries it after /setup succeeds.

Where

  • src/backend/main.py → _init_docker_and_system_agent() calls system_agent_service.ensure_deployed() once, at startup.
  • src/backend/services/system_agent_service.py → create_system_agent needs the admin user to exist.
  • src/backend/routers/setup.py creates the admin and never triggers a deploy.

Reproduction

  1. Launch a fresh install (seen on an AWS AMI built from v1.0.0-aws.2, and on v1.0.0-aws.1).
  2. Complete /setup.
  3. docker ps shows no agent-trinity-system; the backend log has the error above from boot.
  4. docker restart trinity-backend → System agent: created - System agent created and started.

On AWS the first IP refresh after a stop/start or an Elastic IP change recreates the backend, which hides the bug on those paths.

Suggested fix

After /setup creates the admin, run system_agent_service.ensure_deployed() (in the background, non-fatal, as at startup). It is idempotent, so a later restart stays a no-op.

Related

Activity

  1. dolho commented on Oct 6, 2026

    @dolho
    Contributor

    /claim

  2. github-actions commented on Oct 6, 2026

    @github-actions

    Claimed by @dolho. Label status-in-progress added.

    Next steps:

    1. Create branch: feature/3237-<short-slug>
    2. Implement the feature
    3. Open a PR with Fixes #3237
  3. added
    status-in-devMerged to dev, awaiting release cut to main
    and removed on Oct 6, 2026
  4. removed
    status-in-devMerged to dev, awaiting release cut to main
    on Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions