Skip to content

Fastly custom runners send no response when the managed logger fails to install #505

Description

@aram356

Summary

On Fastly, lifecycle::run_custom and lifecycle::serve_custom install the managed logger before the custom callback. When that install fails, they return ManagedLoggerError to the caller without sending a response, so the client's request goes unanswered, health checks included.

Behavior today

At 10166628 (the same files as PR #275's 5c32ae61):

  • run_custom runs initialize_for_app::<A>()? before the callback (crates/edgezero-adapter-fastly/src/lifecycle.rs:198), and serve_custom does the same per request (:170). On failure the callback never runs and nothing is sent. Under serve_custom, DeliveryResult::send returns the error without sending (:31-40), and the loop stops.
  • The failure is kept for the instance (edgezero-core/src/logging.rs, ManagedLoggerInstallation). The edgezero_logging override is read once per instance, and an unexpected host failure there returns ConfigurationUnavailable (docs/guide/adapters/fastly.md, "Runtime Level Overrides"). So one failed read fails every later request in a reused instance.
  • Under Viceroy 0.21.0 the client gets HTTP/1.1 200 OK with content-length: 0. What hosted Fastly answers was not checked.
  • The other adapters hand the host an error rather than leaving the request unanswered:
    • Cloudflare run_app maps the failure to WorkerError::RustError("managed logger initialization failed").
    • Spin run_app returns it with ?.
  • The Fastly guide does not say what the client receives in this case.

Reproduction

Trusted Server PR IABTechLab/trusted-server#1506, which calls run_custom::<TrustedServerApp, _, _, _> and serve_custom::<TrustedServerApp, _, _, _>:

  1. Set [adapters.fastly.logging] endpoint = "ts:log" in edgezero.toml.
  2. Build the release wasm and serve it with Viceroy 0.21.0.
  3. curl -si /health and curl -si /.

Both answer HTTP/1.1 200 OK, content-length: 0, with no body. Viceroy's stderr shows Trusted Server's report of the returned error: managed logger installation failed: managed logging configuration is invalid. With endpoint = "tslog", /health answers 200 with body ok.

Acceptance criteria

  • When managed logging fails before the callback, the client receives an error response (5xx) instead of none, under both run_custom and every request serve_custom stops on.
  • The error still returns to the caller.
  • The Fastly guide states what the client receives.
  • A Viceroy test pins the status.

Related

Activity

  1. added theissue type on Nov 15, 2026
  2. added a commit that references this issue on Nov 15, 2026
    4cbabfe
  3. aram356 commented on Nov 15, 2026

    @aram356
    CollaboratorAuthor

    CREATOR: fixed in 4cbabfee on PR #275.

    Both custom runners now use one private setup gate. A managed-logging failure before callback entry consumes the unread request through existing app-free assembly-error egress, attempts canonical redacted JSON 500 (no HEAD payload), and returns the original typed logger error even if delivery fails. Secondary delivery/fallback degradation uses bounded category-only, fallible stderr output. Callback errors, including the same logger-error type after sending, never trigger another response.

    Verified on the committed head:

    cargo test --offline --locked -p edgezero-adapter-fastly --lib lifecycle::tests
    test result: ok. 13 passed; 0 failed; 0 ignored; 0 measured; 176 filtered out; finished in 0.01s
    
    scripts/run_test_nonzero.sh --ignored fastly_pre_callback_wire_controls cargo test --offline --locked --manifest-path crates/edgezero-test-harness/Cargo.toml fastly_pre_callback_wire_controls
    test result: ok. 1 passed; 0 failed; 0 ignored; 0 measured; 673 filtered out; finished in 6.24s
    

    Both commands exit 0. The selected runtime test executes six actual Viceroy controls: GET/HEAD setup failures for each runner and two already-committed callback-error controls. Before the fix, the four setup cases exposed host-generated WASI-error 500 bodies rather than canonical JSON; both callback controls already passed.

    The complete prescribed local suite and 35 additional checks pass. The separate broader assembly run still exits 1 on seven first-response attestation cases; all 27 existing logging controls and six new controls pass. That blocker and hosted qualification remain open; no gate was relaxed or capability promoted. The issue remains open until default-branch integration.

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

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions