Skip to content

pkgs/id check phase: cli_integration structured_logging_text_file_is_plain_text fails — blocks switch attempt 4 pre-flight #5374

Closed

Description

@dezren39

Found 2026-11-04 during the switch attempt-4 pre-flight: the FULL amd toplevel was built green from origin/main @ 85c0e0b (incl. #5275 fix), but after reconciling the primary to origin/main @ 1433b92 + the ae5d592093 fork pin (e40744f), the toplevel build fails on a NEW id derivation.

Root failure (only one)

/nix/store/425f7vmgp9vlkkd6w55b90p73znr8624-id-0.1.0.drv — check phase, builder exit 101:

test structured_logging_tests::test_structured_logging_text_file_is_plain_text has been running for over 60 seconds
test structured_logging_tests::test_structured_logging_text_file_is_plain_text ... FAILED

thread 'structured_logging_tests::test_structured_logging_text_file_is_plain_text' (66620) panicked at tests/cli_integration.rs:4928:9:
file destination should record events in text mode too

error: test failed, to rerun pass `-p id --test cli_integration`

Everything else in the suite passed. Cascade: unit-id-primary.service → system-units → etc → toplevel /nix/store/bjgqdgfvh0qf2mllxjn1bl77zzymrgfl-nixos-system-amd-26.11.20261102.f9887a8.drv. Full log: laptop /home/user/toplevel-primary.log (failure at line 842 ff.).

Context

Generation remains the 2026-11-01 build (system-526); nothing activated.

Acceptance criteria

Activity

  1. added
    kind/testTest coverage, test infrastructure, or test-only fixes
    source/humanFiled directly by a human
    priority/criticalDrop everything: main broken, security exposure, repo-wide outage
    effort/mMedium: expected under 1 day of work
    app/idPackage/app: id (pkgs/ or apps/ in this repo)
    meta/enrichedIntake review done: acceptance criteria, links, and normalized labels added
    on Nov 4, 2026
  2. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    Intake review — fleet monitor, 2026-11-04.

    Related: filed from the switch attempt-4 pre-flight (Drew, 2026-11-04); the same test passed end-to-end on tree 85c0e0b hours earlier, so this is a regression window between 85c0e0b and 1433b92 — pkgs/id changed via #5357/#5342 (upload byte check), #5329 (CLI parse stack), #5298 in that window. Cf. #5218 family of unbounded waits in the id test surface.

    Notes: First-party check-phase failure, single test, everything else green. The >60s wait before the panic is the strongest clue: the assertion ("file destination should record events in text mode too") fired only after a long wait, which points at an event-flush/wait interaction rather than wrong content.

    Risks: blocks the fleet switch (the switch consumes exactly this toplevel); generation remains the 2026-11-01 build until this is green. Priority set critical for that reason.

    Suggested approach: bisect the pkgs/id changes in the window against this one test in CI; check whether the text-file destination path now waits on a condition the test's setup no longer satisfies, before touching timeouts.

  3. added a commit that references this issue on Nov 4, 2026
  4. dezren39 commented on Nov 4, 2026

    @dezren39
    MemberAuthor

    Root cause — class (i): real product bug (fixed in #5406, merged 2a08f0ae0410)

    resolve_log_level (pkgs/id/src/main.rs) keyed RUST_LOG handling on mere presence. A set-but-empty RUST_LOG returned the empty sentinel, and the caller then used the empty string itself as the base tracing filter. A filter with no global directive leaves only the appended per-module caps (mainline::rpc=info, rustls=info, …) in effect — every other target is muted, including the serve startup warnings the structured-logging file destination exists to record. The documented warn default was silently discarded.

    nixpkgs' cargo hooks export RUST_LOG= (empty) into every buildRustPackage derivation (visible verbatim in this package's .drv env), so the check phase deterministically ran this test against a muted server. The sibling JSON test passed only because it pins ID_LOG_FILE_LEVEL=debug, bypassing the inherited filter.

    Evidence

    • Failure reproduced 3x via nix build .#id-web (check phase, same single failure, 60 s poll exhausted each time).
    • The sandbox-built test + server binaries pass this exact test on the host (0.50 s) and in an isolated sandbox derivation — the binaries were never broken.
    • A diagnostic build inside the genuine check phase showed the spawned child fully started (tokio runtime up, endpoint sockets open, the log file held open on fd 9) with zero bytes on both the file and stderr after 60 s — it emitted nothing at all, i.e. its filter muted every startup event.
    • Host probe matrix isolated the variable: RUST_LOG= (empty) → 0 bytes; unset / warn → the 142-byte serve: app discovery failed warning; error → 0 bytes (correctly). With the fix: empty → 142 bytes again; error/debug specs still honored exactly.

    Fix (#5406)

    Empty or whitespace-only RUST_LOG (and, by the same principle, LOG_LEVEL) is treated as unset and falls through to the remaining sources and the warn default — mirroring how the same function already treats an empty DEBUG. The pinned precedence-table unit test was updated to the corrected semantics; the integration test itself is unchanged (its assertion was right all along).

    Gate

    nix build .#id-web at the PR tree (main 8854bf748 + fix): green — 45 test suites ok, 0 failed; test_structured_logging_text_file_is_plain_text ... ok in ~2 s (previously a 60 s timeout failure).

    Note for operators: any environment that exports RUST_LOG= empty (a common CI/nix artifact) was muting this binary's logging entirely; that is fixed by the same change. Closing as fixed.

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

    app/idPackage/app: id (pkgs/ or apps/ in this repo)effort/mMedium: expected under 1 day of workkind/testTest coverage, test infrastructure, or test-only fixesmeta/enrichedIntake review done: acceptance criteria, links, and normalized labels addedpriority/criticalDrop everything: main broken, security exposure, repo-wide outagesource/humanFiled directly by a humanstatus/needs-triageNot yet triaged; needs a first look

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions