salt-cp fails with large files, cp.get_file succeeds
salt-cp of files larger than 1MB fails no matter how big a --timeout value is used. The minion never gets a job/jid, small files copy just fine.
On the same host and minion combination salt 'minion' cp.get_file salt://file /tmp/file succeeds.
$ sudo salt-call test.versions_report
local: Salt: 2014.1.11 Python: 2.7.8 (default, Oct 2 2014, 17:06:07) Jinja2: 2.7.3 M2Crypto: 0.22 msgpack-python: 0.4.2 msgpack-pure: Not Installed pycrypto: 2.6.1 PyYAML: 3.11 PyZMQ: 14.3.1 ZMQ: 4.0.4
Confirmed, I am getting the same behavior. Thanks, we'll check into this.
Just as a data point, I don't see this on 2014.7, but I do see it on the develop branch.
This is quite broken. It looks like we're just trying to stuff the entire file into a raw msgpack stream and it's way, way too slow. It eventually just times out and/or breaks. We need to migrate to the pure salt fileserver, IMHO.
(And for the record, I cannot copy a 100M file on 2014.7 using salt-cp. It fails.)
hey, we get this bug too and we're interested in this bugfix too.
Perhaps the documentation can be updated to reflect the current limitation. Google only brought me here after time-wasting frustration.
Can we expect salt-cp fixed any time soon ?
I have the same problem, hopefully we can get it fixed soon.
This is totally also blocking Windows package management (relying on salt-cp); installers aren't copied anymore and the job is stuck.
Any updates on this?
any update on this guys?
+1
I have found that cp.get_file is a good work around. Just setup a symlink in the salt files directory to whatever files you want copied. When you're done, unlink it if you don't need it any more.
ZD-1399
The reason this is failing is that it is hitting max_event_size. This config option has only been tunable since 2014.7.0 and was hard-coded as 1MB before that.
The solution here is to do the following:
-
Modify salt-cp so that it does not attempt to send an event in excess of max_event_size. This will involve adding an additional parameter for all chunks of a file after the first one, to signify that this data should be appended to the file on the minion rather than writing a new file.
-
Modify cp.recv to accept and understand this new parameter, and conditionally open the destination file for appending rather than writing.
I wouldn't mind seeing salt-cp deprecated.
Fixed in https://github.com/saltstack/salt/pull/41216.
Nicely done, @terminalmage