Repository navigation
Description
What happened?
Description
Using 3007.7 We noticed the download of large files (from winrepo_ng) is failing if the target file is larger than 100MB, resulting in truncated downloads.
Saltstack has a minion setting to increase this limit http_max_body. However increasing it does not allow the file to be downloaded.
Indeed we then hit another limit, which is Tornado's max_buffer_size, still of 100MB by default.
Steps to reproduced
- Configure a winrepo_ng package with an installer URL pointing to a binary larger than 100MB
- Run
salt-call pkg.install name=<package-name>. - Observe that the download completes without HTTP errors, but the resulting file in
C:\ProgramData\Salt Project\Salt\var\cache\salt\minion\extrn_filescontains only ~102MB (104,857,600 bytes)
Expected Behavior
- File download should not be interrupted at the
max_buffer_size. The file should be streamed in within the buffer limits, or at minimum the buffer should be raised to themax_body_size. - The download should not fail silently, and treat the truncated 100B file on disk as a failure
We believe this is triggered in salt/utils/http.py where Tornado's max_buffer_size / streaming_callback are passed.
Note we reproduced on 3007.1, we don't have over version(s) on hand to test.
Workaround:
Switching the 'backend' minion config from 'tornado' to 'requests' seems to works around the issue.
Error logs:
Here are some logs showing the issue with a ~190MB download.
PS C:\Temp> salt-call pkg.install name=jdk21 version=21.0.4.7
[WARNING ] specified file https://my-source-server:8443/repository/windows/x64/java/jdk21/21.0.4.7/jdk21-21.0.4.7.msi is not present to generate hash: Unsupported path: https://my-source-server:8443/repository/windows/x64/java/jdk21/21.0.4.7/jdk21-21.0.4.7.msi
[INFO ] Executing command '"C:\WINDOWS\system32\cmd.exe"' in directory 'C:\ProgramData\Salt Project\Salt\var\cache\salt\minion\extrn_files\base\my-source-server_8443\repository\windows\x64\java\jdk21\21.0.4.7'
[ERROR ] Failed to decode stdout from command "C:\WINDOWS\system32\cmd.exe", non-decodable characters have been replaced
[ERROR ] Command '"C:\WINDOWS\system32\cmd.exe"' failed with return code: 1620
[ERROR ] stdout: Impossible d'ouvrir ce package d'installation. Vérifiez auprès votre revendeur d applications que ce package de Windows Installer est valide.
[ERROR ] retcode: 1620
[ERROR ] Failed to install jdk21; retcode: 1620; installer output: Impossible d ouvrir ce package d installation. Vérifiez auprès votre revendeur d applications que ce package de Windows Installer est valide.
local:
----------
jdk21:
----------
install status:
failed
The exact same happens with an increased http_max_body to 250MB, after restarting the minion and confirming the updated value:
PS C:\Temp> salt-call config.get http_max_body --local
[INFO ] Executing command C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.EXE in directory 'C:\Temp'
local:
250374182400
Type of salt install
Official msi
Major version
3007.x
What supported OS are you seeing the problem on? Can select multiple. (If bug appears on an unsupported OS, please open a GitHub Discussion instead)
windows-desktop-10
salt --versions-report output
Salt Version:
Salt: 3007.7
Python Version:
Python: 3.10.18 (heads/main:50db72e, Aug 27 2025, 20:26:36) [MSC v.1944 64 bit (AMD64)]
Dependency Versions:
cffi: 1.16.0
cherrypy: 18.8.0
cryptography: 42.0.5
dateutil: 2.8.2
docker-py: Not Installed
gitdb: 4.0.10
gitpython: Not Installed
Jinja2: 3.1.6
libgit2: Not Installed
looseversion: 1.3.0
M2Crypto: Not Installed
Mako: Not Installed
msgpack: 1.0.7
msgpack-pure: Not Installed
mysql-python: Not Installed
packaging: 24.0
pycparser: 2.21
pycrypto: Not Installed
pycryptodome: 3.19.1
pygit2: Not Installed
python-gnupg: 0.5.2
PyYAML: 6.0.1
PyZMQ: 25.1.2
relenv: 0.20.5
smmap: 5.0.1
timelib: 0.3.0
Tornado: 6.4.2
ZMQ: 4.3.4
Salt Package Information:
Package Type: onedir
System Versions:
dist:
locale: utf-8
machine: AMD64
release: 10
system: Windows
version: 10 10.0.26100 SP0 Multiprocessor Free
Activity
Fix silent truncation of large HTTP downloads in cp/fileclient
Fix 5 root causes surfaced by CI run 31975776712 on PR saltstack#70063
Fix silent truncation of large HTTP downloads in cp/fileclient
Fix silent truncation of large HTTP downloads in cp/fileclient