Copying a file from salt-master to salt-minion using salt-cp. File is only 5 bytes.
local:
Salt Version:
Salt: 2016.11.6
Dependency Versions:
cffi: Not Installed
cherrypy: 5.6.0
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.8.1
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.6.9 (unknown, Sep 1 2016, 23:34:36)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 14.5.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5
System Versions:
dist:
machine: x86_64
release: 4.4.11-23.53.amzn1.x86_64
system: Linux
version: Not Installed
-rw-r--r-- 1 root root 5 Jul 29 01:38 test.txt
/tmp/test.txt:
Passed invalid arguments to cp.recv: recv() takes exactly 2 arguments (5 given)
Used with salt-cp, pass the files dict, and the destination.
This function receives small fast copy files from the master via salt-cp.
It does not work via the CLI.
I am unable to replicate this.
[root@salt salt]# salt \* cmd.run 'cat /tmp/hosts'
minion.c.gtmanfred-1263.internal:
cat: /tmp/hosts: No such file or directory
ERROR: Minions returned with non-zero exit code
[root@salt salt]# salt-cp \* /etc/hosts /tmp/
minion.c.gtmanfred-1263.internal:
----------
/tmp/hosts:
True
[root@salt salt]# salt \* cmd.run 'cat /tmp/hosts'
minion.c.gtmanfred-1263.internal:
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
10.128.0.2 salt.c.gtmanfred-1263.internal salt # Added by Google
169.254.169.254 metadata.google.internal # Added by Google
[root@salt salt]# salt-cp --versions-report
Salt Version:
Salt: 2016.11.6
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
docker-py: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.9.6
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pycryptodome: Not Installed
pygit2: Not Installed
Python: 2.7.5 (default, Nov 6 2016, 00:28:07)
python-gnupg: Not Installed
PyYAML: 3.12
PyZMQ: 16.0.2
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.5.1
ZMQ: 4.1.6
System Versions:
dist: centos 7.3.1611 Core
machine: x86_64
release: 3.10.0-514.26.2.el7.x86_64
system: Linux
version: CentOS Linux 7.3.1611 Core
What version of salt is on your minions?
salt \* test.versions_report
Hi gtmanfred,
Minions are running:
Salt Version:
Salt: 2016.11.2
Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 2.5.3
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: 2.7.2
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.21.1
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.8
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.7.5 (default, Aug 2 2016, 04:20:16)
python-gnupg: Not Installed
PyYAML: 3.11
PyZMQ: 15.3.0
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.1.4
System Versions:
dist: redhat 7.3 Maipo
machine: x86_64
release: 3.10.0-514.6.1.el7.x86_64
system: Linux
version: Red Hat Enterprise Linux Server 7.3 Maipo
I am able to replicate this issue.
[root@salt ~]# salt minion\* cmd.run 'cat /tmp/hosts'
minion.c.gtmanfred-1263.internal:
cat: /tmp/hosts: No such file or directory
ERROR: Minions returned with non-zero exit code
[root@salt ~]# salt-cp \* /etc/hosts /tmp
minion.c.gtmanfred-1263.internal:
----------
/tmp:
Passed invalid arguments to cp.recv: recv() takes exactly 2 arguments (5 given)
Used with salt-cp, pass the files dict, and the destination.
This function receives small fast copy files from the master via salt-cp.
It does not work via the CLI.
Thanks, We will get it fixed.
Daniel
@DmitryKuzmenko assigned to you for the 2016.11.8 release.
Introduced by #41216.
New salt-cp copies files by reading the file by chunks and sending a number of salt.recv commands (one for each chunk) with a new set of arguments to master. If minions don't have the recv function updated the error occurs.
Salt-cp has no simple way to detect it.
What I propose to do here is:
salt.recv_chunkedsalt.recv salt-cp (disabled by default) that will use chunked file transfer.@terminalmage what do you think?
@DmitryKuzmenko That sounds like a good solution. Once 2016.11 is EOL, we can deprecate the extra CLI argument and make it the default behavior.
@DmitryKuzmenko Also, we'll need to only enable the recursive functionality when using the "chunked" option. It was present but commented out before https://github.com/saltstack/salt/pull/41216. So, the existing salt-cp could only handle single files, and that is what we'll have to revert to when not using the "chunked" option.
Same issue with Salt 2017.7.1 master and 2017.7.2 minion (NOT if minion was 2017.7.1). Will these versions get fixed?
same issue ,
Salt minion 2017.7.1 works , but 2017.7.2 minion error:
Passed invalid arguments to cp.recv: recv() takes exactly 2 arguments (5 given)
Used with salt-cp, pass the files dict, and the destination.
This function receives small fast copy files from the master via salt-cp.
It does not work via the CLI.
Hope One fixed problem not occur again in new versions
The salt-cp compatibility was broken by 10dc695cc48, released in 2016.11.6 and 2017.7.0rc1 and fixed by 999388680ca, released in 2016.11.8 and 2017.7.2.
This means that salt cp.recv function in 2016.11.6, 2016.11.7, 2017.7.0 and 2017.7.1 isn't compatible with salt versions <2016.11.6, >=2016.11.8 and >=2017.7.2.
The older versions will not be patched, you will need to just make sure there are no 2016.11.6 2016.11.7 2017.7.0 or 2017.7.1, and then the rest of the versions work together.