Skip to content

Script details: timeout message takes "after N seconds" from the script output, not the configured timeout #54262

Closed

Description

@AndreyKizimenko

Fleet versions

  • Discovered: rc-minor-fleet-v4.93.0 (1f30f3a)

Web browser and operating system: Chromium (Playwright 1.61) on macOS


💥 Actual behavior

Image

For a script that timed out, the Script details modal takes the "after N seconds" in its error line from the script's own output instead of the configured timeout. With script_execution_timeout: 60, a script that prints sleeping 180 seconds is reported as "Fleet stopped the script after 180 seconds"; a script whose output contains no "N seconds" gets no duration at all ("Fleet stopped the script to protect host performance.").

🛠️ Expected behavior

The modal shows the configured timeout — "Fleet stopped the script after 60 seconds to protect host performance." — which is what the API already returns in message for the same execution (GET /api/v1/fleet/scripts/results/:execution_id).

🧑‍💻 Steps to reproduce

These steps:

  • Have been confirmed to consistently lead to reproduction in multiple Fleet instances.
  • Describe the workflow that led to the error, but have not yet been reproduced in multiple Fleet instances.
  1. Set script_execution_timeout: 60 in the agent options of a fleet with a Linux host.
  2. Add this script to that fleet and run it on the host:
    #!/bin/bash
    echo "sleeping 180 seconds"
    sleep 180
  3. After ~60 s, open the host → Actions → Run script → the script's Actions → Show run details.

🕯️ More info (optional)

RunScriptDetailsModal.tsx:214 passes message={data.output} to StatusMessage, whose timeout case (:85) regex-matches (\d+ seconds) in that string. When the dynamic timeout copy was added (#20138) the modal passed data.message — the server's HostScriptTimeoutMessage, built from the configured value (server/fleet/scripts.go:434); it became data.output in #23461. Present in fleet-v4.92.1. Related, both closed: #20415 (wrong seconds shown, 2024), #35432 ([object Object], 4.77).

Activity

  1. added
    bug
    ~released bug
    #g-auto-patching
    on Sep 28, 2026
  2. self-assigned this
    on Oct 6, 2026
  3. added
    ~community
    and removed
    bug
    ~released bug
    #g-auto-patching
    on Oct 6, 2026
  4. added a commit that references this issue on Oct 6, 2026
    efff697
  5. added this to the 4.94.0 milestone on Oct 6, 2026
  6. Brajim20 commented on Oct 8, 2026

    @Brajim20
    Member

    QA Pass — 12/12 checks on main (1bfc70f) vs rc-minor-fleet-v4.93.0 (82b6b87). Timed-out scripts on real Linux and macOS hosts plus simulated fleetd hosts, the issue's 60-second fleet timeout, all four places the Script details modal opens, and the modal's other states (success, failure, scripts disabled, host didn't respond).

    # Type Case Pre-fix Fixed
    1 Core Fleet timeout 60 s, script prints sleeping 180 seconds (issue repro) ❌ "after 180 seconds" ✅ "after 60 seconds"
    2 Core Real host, default timeout, script prints sleeping 900 seconds ❌ "after 900 seconds" ✅ "after 300 seconds"
    3 Core Real host, output has no "N seconds" ❌ no duration ✅ "after 300 seconds"
    4 Core Agent that reports no timeout (fleetd < 1.28), output sleeping 180 seconds ❌ "after 180 seconds" ✅ "after 300 seconds" (default)
    5 Core Opened from host → Run script → Show run details ❌ "after 180 seconds" ✅ "after 60 seconds"
    6 Core Opened from the dashboard activity feed ❌ "after 180 seconds" ✅ "after 60 seconds"
    7 Core Opened from a batch run's details page (Errored tab) ❌ "after 180 seconds" ✅ "after 60 seconds"
    8 Regression Script succeeded (exit 0) ✅ "Exit code: 0" ✅ unchanged
    9 Regression Script failed (exit 1) ✅ "Exit code: 1" ✅ unchanged
    10 Regression Scripts disabled on the host (exit -2) ✅ "Scripts are disabled" ✅ full message with how to enable
    11 Regression Live script where the host didn't respond ❌ bare "Error:" ✅ explains the host didn't respond
    12 Halo Output panel keeps the script's own output; duration keeps its agent-options tooltip ✅ ✅ unchanged

    Rows 10–11: the modal now shows the server's message for these states too. Row 11 was blank before the fix.

    Image Image Image Image Image Image
  7. moved this from ✅ Ready for release to Done in ❤️‍🩹 #g-auto-patchingon Oct 29, 2026
  8. fleet-release commented on Oct 29, 2026

    @fleet-release
    Contributor

    Clouds drift through the sky
    scripts show their true timeout
    clarity returns

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

~community

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions