Skip to content

Make batch installer download cancel as soon as a download fails #50153

Closed

Description

@jkatz01

Fleet versions

  • Discovered:
  • Reproduced:

Web browser and operating system:


💥  Actual behavior

In the softwareBatchUpload function, fleet downloads software packages one by one (creates goroutines in a wait group with g.SetLimit(1) in a loop). If one of the downloads failed, fleet continues downloading all the other packages, even though the batch will always fail if even one download failed.

Example where downloads are logged:

[+] would've applied 5 software packages for fleet repro-49811
[+] downloading software package - ZoomInstallerIT.pkg ...
[+] downloaded software package - ZoomInstallerIT.pkg
[+] downloading software package - 1password-latest.deb ...
[+] downloaded software package - 1password-latest.deb
[+] downloading software package - htop-3.4.1-1.fc42.aarch64.rpm ...
Error: could not download installer htop-3.4.1-1.fc42.aarch64.rpm
[+] downloading software package - Chrome for testing ...
[+] downloaded software package - Chrome for testing
[+] downloading software package - Notion ...
[+] downloaded software package - Notion
Error: applying software installers for fleet "repro-49811": validation failed: software.url Couldn't edit software. URL ("https://rpmfind.net/linux/fedora/linux/updates/42/Everything/aarch64/Packages/h/htop-3.4.1-1.fc42.aarch64.rpm") returned "Not Found". Please make sure that URLs are reachable from your Fleet server.

🛠️ Expected behavior

Gitops stops downloading packages after one of the packages fail, because packages after first failure won't be applied.

🧑‍💻  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. TODO
  2. TODO

🕯️ More info (optional)

N/A

Activity

  1. added
    :product
    #g-auto-patching
    on Jul 29, 2026
  2. changed the title [-]Make batch installer download cancel as soon as a download fails.[/-] [+]Make batch installer download cancel as soon as a download fails[/+] on Jul 30, 2026
  3. added this to the 4.97.0 milestone on Jul 30, 2026
  4. removed
    :product
    on Aug 5, 2026
  5. modified the milestones: 4.97.0, 4.95.0, 4.96.0 on Aug 19, 2026
  6. 3 remaining items

  7. added this to the 4.97.0 milestone on Sep 14, 2026
  8. added
    ~core
    on Sep 14, 2026
  9. modified the milestones: 5.1.0, 5.2.0 on Sep 24, 2026
  10. modified the milestones: 5.2.0, 4.94.0 on Oct 8, 2026
  11. self-assigned this
    on Oct 8, 2026
  12. added
    ~community
    on Oct 8, 2026
  13. added a commit that references this issue on Oct 8, 2026
    2b0ac65
  14. Brajim20 commented on Oct 9, 2026

    @Brajim20
    Member

    QA Pass: 12/12 checks on main (2b79a2a) vs rc-minor-fleet-v4.93.0 (82b6b87). Batch software apply and dry-run, failure at the start, middle and end of the batch, a download failure and an invalid-package failure, a fleet and No team, the reporter's fleetctl gitops path, and failed batches leaving existing software untouched. Packages were served from a logging server, so "not downloaded" means Fleet never requested the URL.

    # Type Case Pre-fix Fixed
    1 Core Apply 5 packages, #3 returns 404 ❌ reproduced: #4 and #5 still downloaded ✅ stops at #3
    2 Core Same batch as a dry-run (the reported case) ❌ reproduced: #4 and #5 still downloaded ✅ stops at #3
    3 Core First package fails ❌ reproduced: all 4 others downloaded ✅ nothing else downloaded
    4 Core #2 downloads but isn't a valid installer ❌ reproduced: #3–#5 still downloaded ✅ stops at #2
    5 Core No team, dry-run, #2 returns 404 ❌ reproduced: #3 and #4 still downloaded ✅ stops at #2
    6 Core fleetctl gitops --dry-run, 404 in the middle ❌ reproduced: keeps "downloading" after the error ✅ output and downloads stop at the error
    7 Regression All-good batch of 5 ✅ all downloaded, applied ✅ all downloaded, applied
    8 Regression Failed batch leaves the fleet's existing 5 installers untouched ✅ ✅
    9 Regression Last package fails: every earlier package still downloaded ✅ ✅
    10 Regression Re-apply a good batch after failed ones ✅ completed ✅ completed
    11 Halo Batch result names the failing package URL ✅ ✅ unchanged
    12 Halo Activity feed after failed and successful batches ✅ ✅ unchanged
  15. moved this from ✅ Ready for release to Done in ❤️‍🩹 #g-auto-patchingon Oct 29, 2026
  16. fleet-release commented on Oct 29, 2026

    @fleet-release
    Contributor

    Downloads cease when one fails
    wasted bandwidth now saved
    the fleet moves faster

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

Metadata

Metadata

Assignees

Labels

#g-auto-patching~community~core

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions