bug: missing devices detected by additional agents #920

Closed
opened 2026-03-28 04:29:53 +00:00 by mfreeman451 · 2 comments
Owner

Imported from GitHub.

Original GitHub issue: #2617
Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/issues/2617
Original created: 2026-01-30T17:48:17Z


Describe the bug
We have two agents, both are performing the sweep/mapper/discovery tasks on their own, one runs in the k8s namespace and may have limited visibility into the network, the other runs on a VM that seems to have more visibility. The agent running in k8s sees two devices, those get added to the inventory, while the devices the other agent sees never get added.

Image Image

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Imported from GitHub. Original GitHub issue: #2617 Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/issues/2617 Original created: 2026-01-30T17:48:17Z --- **Describe the bug** We have two agents, both are performing the sweep/mapper/discovery tasks on their own, one runs in the k8s namespace and may have limited visibility into the network, the other runs on a VM that seems to have more visibility. The agent running in k8s sees two devices, those get added to the inventory, while the devices the other agent sees never get added. <img width="1238" height="632" alt="Image" src="https://github.com/user-attachments/assets/f83b752e-130e-4c53-9133-c44efc8976d7" /> <img width="1238" height="652" alt="Image" src="https://github.com/user-attachments/assets/d7553e02-245a-41d7-8bce-0c86c38acb23" /> **To Reproduce** Steps to reproduce the behavior: 1. Go to '...' 2. Click on '....' 3. Scroll down to '....' 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Desktop (please complete the following information):** - OS: [e.g. iOS] - Browser [e.g. chrome, safari] - Version [e.g. 22] **Smartphone (please complete the following information):** - Device: [e.g. iPhone6] - OS: [e.g. iOS8.1] - Browser [e.g. stock browser, safari] - Version [e.g. 22] **Additional context** Add any other context about the problem here.
mfreeman451 added this to the 1.1.1 milestone 2026-03-28 04:29:53 +00:00
Author
Owner

Imported GitHub comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/issues/2617#issuecomment-3938217492
Original created: 2026-02-21T05:38:58Z


Verified on current staging (Saturday, February 21, 2026): this older bug no longer reproduces based on code + runtime checks.

What was validated:

  • Duplicate active-IP rows are now prevented at the DB layer via the unique index ocsf_devices_unique_active_ip_idx in elixir/serviceradar_core/priv/repo/migrations/20260213201000_enforce_unique_active_device_ip.exs.
  • Sync ingest no longer treats mapper/sweep scanner agent identity as endpoint identity, preventing cross-agent false merges (elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor.ex).
  • Mapper IP resolution prefers canonical sr: UIDs when ambiguity exists (elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex).
  • Regression coverage exists for this class of issue:
    • elixir/serviceradar_core/test/serviceradar/inventory/identity_reconciler_interface_mac_test.exs
    • elixir/serviceradar_core/test/serviceradar/inventory/sync_ingestor_discovery_sources_test.exs

Live demo runtime sanity checks (today):

  • duplicate_ip_groups = 0 in platform.ocsf_devices for active rows.
  • Both agents are actively contributing sweep data in the last 24h:
    • agent-dusk: 288 runs, 292,608 host rows, 770 distinct mapped device IDs
    • k8s-agent: 580 runs, 100,340 host rows, 92 distinct mapped device IDs
  • Latest completed executions show available hosts from both agents and mapped device IDs present.

Given the above, this issue appears resolved.

Imported GitHub comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/issues/2617#issuecomment-3938217492 Original created: 2026-02-21T05:38:58Z --- Verified on current staging (Saturday, February 21, 2026): this older bug no longer reproduces based on code + runtime checks. What was validated: - Duplicate active-IP rows are now prevented at the DB layer via the unique index `ocsf_devices_unique_active_ip_idx` in `elixir/serviceradar_core/priv/repo/migrations/20260213201000_enforce_unique_active_device_ip.exs`. - Sync ingest no longer treats mapper/sweep scanner agent identity as endpoint identity, preventing cross-agent false merges (`elixir/serviceradar_core/lib/serviceradar/inventory/sync_ingestor.ex`). - Mapper IP resolution prefers canonical `sr:` UIDs when ambiguity exists (`elixir/serviceradar_core/lib/serviceradar/network_discovery/mapper_results_ingestor.ex`). - Regression coverage exists for this class of issue: - `elixir/serviceradar_core/test/serviceradar/inventory/identity_reconciler_interface_mac_test.exs` - `elixir/serviceradar_core/test/serviceradar/inventory/sync_ingestor_discovery_sources_test.exs` Live demo runtime sanity checks (today): - `duplicate_ip_groups = 0` in `platform.ocsf_devices` for active rows. - Both agents are actively contributing sweep data in the last 24h: - `agent-dusk`: 288 runs, 292,608 host rows, 770 distinct mapped device IDs - `k8s-agent`: 580 runs, 100,340 host rows, 92 distinct mapped device IDs - Latest completed executions show available hosts from both agents and mapped device IDs present. Given the above, this issue appears resolved.
Author
Owner

Imported GitHub comment.

Original author: @mfreeman451
Original URL: https://github.com/carverauto/serviceradar/issues/2617#issuecomment-3938217557
Original created: 2026-02-21T05:39:01Z


Closing as verified resolved on current staging (code + demo runtime checks). Reopen if this resurfaces with fresh repro data.

Imported GitHub comment. Original author: @mfreeman451 Original URL: https://github.com/carverauto/serviceradar/issues/2617#issuecomment-3938217557 Original created: 2026-02-21T05:39:01Z --- Closing as verified resolved on current staging (code + demo runtime checks). Reopen if this resurfaces with fresh repro data.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
carverauto/serviceradar#920
No description provided.