Skip to content

ui-server: a transient module discovery failure at cron start silently drops every module job until the next restart #3381

Closed

Description

@schlessera

Context

brain-ui-cron crontab adds module jobs only when module discovery succeeds at the moment the cron service starts. If discovery returns nothing usable, the crontab silently gets only the core jobs, and stays that way until the next container start:

  • readModuleList returns null for a non-zero exit, empty stdout or an unparseable payload, without writing anything to stderr (packages/ui-server/src/bin/brain-ui-cron.ts:160-188).
  • When the host is not reconciled, discovery is skipped and modules is null, also silently (brain-ui-cron.ts:223).
  • Only a thrown error reaches the module discovery unavailable stderr line (brain-ui-cron.ts:226).
  • emitCrontab then writes the comment # (brain module list unavailable — module cron skipped) (packages/ui-server/src/cron/emit.ts:175). Nothing retries, nothing appears in Activity, and the job's last failure just stops recurring.

Observed on a hosted 0.44.0 install: after one container start the crontab carried only the core jobs and that comment, and the supervisor's cron error log was empty. Run by hand an hour later as the same uid, through the same maintenance worker, brain-ui-cron crontab emitted the module job correctly. So discovery failed transiently at boot, most likely while app or native readiness was still settling, and a scheduled module job (odysseus-beacon-run in the Odysseus example) stopped running without any signal.

Scope

  • Report why discovery yielded nothing: exit code, the stderr tail, or "host not reconciled".
  • Retry discovery a bounded number of times before falling back to core jobs only.
  • Make "module jobs skipped" visible to the operator, for example a status/Activity entry or a failure notification, not only a crontab comment.

Out of scope

  • The module job execution boundary itself.
  • Re-running discovery periodically after boot. Note it as an option only.

Acceptance criteria

  • A test with a discovery that fails once and then succeeds produces a crontab containing the module job.
  • A test with persistent failure writes a stderr line naming the cause, and records an operator-visible "module cron skipped" state.
  • The existing byte layout of a successful crontab is unchanged.

Verification

Unit tests over emitCrontab and the crontab subcommand with a stubbed boundary; no live host.

Contract impact

None beyond operator diagnostics.

Activity

  1. added
    type: fix
    area: ui-server
    priority: p1
    agent-ready
    on Nov 2, 2026
  2. added this to the 0.45.0 milestone on Nov 2, 2026
  3. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Triaged: ready to work. The acceptance criteria, scope and verification are checkable, and no ruling is needed. Set to p1 under the blocker-priority rule, because silently dropping every module job breaks a scheduled nightly job. Milestone 0.45.0.

  4. self-assigned this
    on Nov 2, 2026
  5. schlessera commented on Nov 2, 2026

    @schlessera
    OwnerAuthor

    Claiming (claim token wi-3381-6fdbc75a). Branch: fix/3381-cron-discovery-retry from origin/main @ f8284d6. Collision report for the cited files: closure-only (#3056, #3059, #3069, #3116, #3292, #3293), no direct path collision. Staying out of #3380's scope.

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

Metadata

Metadata

Assignees

Labels

agent-readyarea: ui-serverpriority: p1type: fix

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions