Skip to content

[BUG] Servers added to darling.json after the first seed are silently ignored, and --test-connection still validates them #2254

Description

@erikdarlingdata

Field report #2252. An operator added a second server to darling.json, confirmed it with --test-connection (both servers PASS), restarted the service, and the server never appeared. Nothing in any log said why.

Mechanism

StoreConfigProvider seeds the server list only when the table is empty:

if (await CountAsync(connection, "config_monitored_servers", cancellationToken) == 0)
{
    await SeedMonitoredServersAsync(connection, config, now, cancellationToken);
}

After the first successful start the store is authoritative (DarlingWorker: "The initial server set comes from config_monitored_servers WHERE is_enabled = TRUE (post-seed…)"). So a server added to the file afterwards is a permanent no-op, and there is no re-read path.

That is a reasonable design. The problem is that two supported commands disagree and neither says so:

surface reads reported
--test-connection darling.json directly "Validating connectivity to 2 server(s)" — both PASS
the service / Viewer config_monitored_servers 1 server

Both are correct for what they consult. Together they tell an operator the server is configured and reachable, then don't monitor it.

Fix shape

Cheapest useful change, and it needs no schema or behaviour change: on every start, compare the file's server list against the store and log the difference. Something like

darling.json lists 2 server(s); the store has 1. Ignoring 'dcvs-bd01' — the store is authoritative after the first seed. Add servers with the Viewer's Add Server dialog or the MCP add_servers tool.

Worth considering alongside:

  • --test-connection should say which servers are actually monitored. It is the command an operator reaches for to answer "is my config right", and today it answers a question about the file that reads as a question about the service. Naming each server as monitored or in file only would end this class of report.
  • Whether a --reseed-servers or --sync-config verb is worth having. Riskier (it invites clobbering store-side edits), so the diagnostic above is the better first move.

Note

The same report also hit an unrelated DPAPI failure when adding the server from a remote Viewer, filed separately.

Activity

  1. added 2 commits that reference this issue on Aug 14, 2026
  2. erikdarlingdata commented on Aug 14, 2026

    @erikdarlingdata
    OwnerAuthor

    Fixed on dev in #2257.

    Startup now reconciles darling.json against the store and names the servers the store does not hold. Reported at Information, not Warning, and worded for both causes — review caught that the Viewer's Remove hard-deletes the registry row and deliberately never edits the file, so 'removed on purpose, left the file alone' is a correct state that a warning would have nagged about on every start while telling the operator to re-add what they had just deleted. Distinguishing the two needs a tombstone the store does not keep, filed as #2258.

    Compared on server_id rather than name, because that is the identity the collectors and registry key on — verified locally that same name with a different host, and read-only intent, both change the id. Ships with the next release.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions