salt icon indicating copy to clipboard operation
salt copied to clipboard

salt-cp fails with large files, cp.get_file succeeds

Open spo0nman opened this issue 12 years ago • 18 comments

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

spo0nman avatar Oct 13 '14 14:10 spo0nman

Confirmed, I am getting the same behavior. Thanks, we'll check into this.

cro avatar Oct 14 '14 21:10 cro

Just as a data point, I don't see this on 2014.7, but I do see it on the develop branch.

cro avatar Oct 14 '14 21:10 cro

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.

cachedout avatar Oct 27 '14 20:10 cachedout

(And for the record, I cannot copy a 100M file on 2014.7 using salt-cp. It fails.)

cachedout avatar Oct 27 '14 20:10 cachedout

hey, we get this bug too and we're interested in this bugfix too.

arthurzenika avatar May 21 '15 10:05 arthurzenika

Perhaps the documentation can be updated to reflect the current limitation. Google only brought me here after time-wasting frustration.

cchriste avatar Jul 09 '15 00:07 cchriste

Can we expect salt-cp fixed any time soon ?

zerthimon avatar Sep 02 '15 18:09 zerthimon

I have the same problem, hopefully we can get it fixed soon.

DanielYWoo avatar Sep 25 '15 07:09 DanielYWoo

This is totally also blocking Windows package management (relying on salt-cp); installers aren't copied anymore and the job is stuck.

pardoc avatar Sep 25 '15 08:09 pardoc

Any updates on this?

ghost avatar Jan 14 '16 13:01 ghost

any update on this guys?

samiashi avatar Feb 29 '16 12:02 samiashi

+1

cconrad avatar Apr 16 '16 16:04 cconrad

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.

ghost avatar Apr 16 '16 18:04 ghost

ZD-1399

rickh563 avatar May 02 '17 15:05 rickh563

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:

  1. 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.

  2. Modify cp.recv to accept and understand this new parameter, and conditionally open the destination file for appending rather than writing.

terminalmage avatar May 10 '17 22:05 terminalmage

I wouldn't mind seeing salt-cp deprecated.

UtahDave avatar May 11 '17 16:05 UtahDave

Fixed in https://github.com/saltstack/salt/pull/41216.

terminalmage avatar May 12 '17 19:05 terminalmage

Nicely done, @terminalmage

cachedout avatar May 15 '17 16:05 cachedout