The console smoke harness sometimes fails on a SignalR WebSocket 1006 console error on the dashboard #430

Closed
opened 2026-11-13 15:03:37 -05:00 by claude · 1 comment
Owner

What happens

The admin console smoke harness (src/script/development/admin-console-smoke.mjs, see CONTRIBUTING.md "Check the admin console in a browser") now and then fails one check on the dashboard with the console error

WebSocket closed with status code: 1006

Seen on 2026-11-13 in two full runs on unrelated console branches (dashboard at 1400 px light; dashboard-narrow-sidebar at 1400 px dark), and not in a third, shorter run. The changes under test touched no SignalR, event or backend file.

Likely cause (not proven)

1006 is an abnormal WebSocket close. The harness records every console error (around lines 634-638, with one allow-rule for "Failed to load resource"). The dashboard's live feed opens a hub connection through src/angular/src/app/core/realtime/dns-events-hub.service.ts; a page navigation or the harness closing the page while the socket is still connecting would close it this way.

Wanted

  • Find out which side closes the socket and when (harness teardown, navigation between checks, or the host).
  • If the console drops its hub connection without stopping it on navigation or sign-out, fix that in the console: a clean stop does not log an error.
  • If it is only the harness leaving a page mid-connection, make the harness wait for the hub to settle or close the page cleanly. Do not add a blanket allow-rule that would also hide a real live-feed failure.
  • The harness passes 5 full dashboard runs in a row afterwards.
**What happens** The admin console smoke harness (`src/script/development/admin-console-smoke.mjs`, see CONTRIBUTING.md "Check the admin console in a browser") now and then fails one check on the dashboard with the console error ``` WebSocket closed with status code: 1006 ``` Seen on 2026-11-13 in two full runs on unrelated console branches (dashboard at 1400 px light; `dashboard-narrow-sidebar` at 1400 px dark), and not in a third, shorter run. The changes under test touched no SignalR, event or backend file. **Likely cause (not proven)** 1006 is an abnormal WebSocket close. The harness records every console error (around lines 634-638, with one allow-rule for "Failed to load resource"). The dashboard's live feed opens a hub connection through `src/angular/src/app/core/realtime/dns-events-hub.service.ts`; a page navigation or the harness closing the page while the socket is still connecting would close it this way. **Wanted** - Find out which side closes the socket and when (harness teardown, navigation between checks, or the host). - If the console drops its hub connection without stopping it on navigation or sign-out, fix that in the console: a clean stop does not log an error. - If it is only the harness leaving a page mid-connection, make the harness wait for the hub to settle or close the page cleanly. Do not add a blanket allow-rule that would also hide a real live-feed failure. - The harness passes 5 full dashboard runs in a row afterwards.
Author
Owner

Cause found: the host's network changes under Chromium, not the console.

Reproduced on asgard with the harness at develop's version (--pages dashboard), while ip -ts monitor address link logged interface changes and other work on the machine started Docker containers:

  • 22:02:36.532 (local): a container's veth interface got a usable IPv6 link-local address (inet6 fe80::…/64 scope link, no longer tentative).
  • 22:02:36.547: the dashboard logged Connection disconnected with error 'Error: WebSocket closed with status code: 1006 (no reason given).', and the same moment produced net::ERR_NETWORK_CHANGED on /api/auth/refresh and /favicon.ico in the neighbouring visit.

Chromium aborts open sockets when the machine's set of IP addresses changes. An established hub WebSocket then closes with 1006, and requests in flight fail with net::ERR_NETWORK_CHANGED. Containers that live shorter than IPv6 duplicate-address detection (their address stays tentative) do not trigger it, which is why it shows only now and then: it needs a container that starts during a run and stays up. A full run on the same day had 13 net::ERR_NETWORK_CHANGED failures and no 1006; a dashboard-only run had four 1006. Same cause.

Consequences

  • The console does not drop its hub connection on navigation in a way that logs an error; the pagehide change tried on feature/430-smoke-harness-signalr-1006 did not remove the 1006 (a verifier still saw four with it) and is dropped.
  • The fix belongs in the harness: it watches the machine's addresses itself and repeats, once, a visit that failed while they changed, and says so in the report. No allow-rule for the messages: on a stable network a 1006 or a failed request still fails the check.
**Cause found: the host's network changes under Chromium, not the console.** Reproduced on asgard with the harness at `develop`'s version (`--pages dashboard`), while `ip -ts monitor address link` logged interface changes and other work on the machine started Docker containers: - 22:02:36.532 (local): a container's `veth` interface got a usable IPv6 link-local address (`inet6 fe80::…/64 scope link`, no longer tentative). - 22:02:36.547: the dashboard logged `Connection disconnected with error 'Error: WebSocket closed with status code: 1006 (no reason given).'`, and the same moment produced `net::ERR_NETWORK_CHANGED` on `/api/auth/refresh` and `/favicon.ico` in the neighbouring visit. Chromium aborts open sockets when the machine's set of IP addresses changes. An established hub WebSocket then closes with 1006, and requests in flight fail with `net::ERR_NETWORK_CHANGED`. Containers that live shorter than IPv6 duplicate-address detection (their address stays tentative) do not trigger it, which is why it shows only now and then: it needs a container that starts during a run and stays up. A full run on the same day had 13 `net::ERR_NETWORK_CHANGED` failures and no 1006; a dashboard-only run had four 1006. Same cause. **Consequences** - The console does not drop its hub connection on navigation in a way that logs an error; the `pagehide` change tried on `feature/430-smoke-harness-signalr-1006` did not remove the 1006 (a verifier still saw four with it) and is dropped. - The fix belongs in the harness: it watches the machine's addresses itself and repeats, once, a visit that failed while they changed, and says so in the report. No allow-rule for the messages: on a stable network a 1006 or a failed request still fails the check.
Sign in to join this conversation.
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
lantea-one/ninlil#430
No description provided.