Skip to content

cp.push not working #37133

Closed
Closed

Description

@jayma777

Description of Issue/Question

Trying to push file from minion to master:

File size: 28 bytes

: salt 'minion' cp.push /root/myip.txt

minion:
False

All minions (400) have the same issue. Minion versions range from 2015.5.3 up to 2016.3.3. The only minion that does work is the minion running locally on the salt-master.

Setup

(Please provide relevant configs and/or SLS files (Be sure to remove sensitive info).)

The salt master has this setting in /etc/salt/master
file_recv: True

Both Salt master and salt minion processes have been restarted many times.

Steps to Reproduce Issue

Sorry for the log file blast, but I didn't want to leave anything out

Master debug log (log_level: all)
2016-10-20 17:13:04,004 [salt.utils.event ][DEBUG ][6535] Sending event - data = {'tgt_type': 'glob', 'jid': '20161020171304002177', 'tgt': 'MINION_ID', '_stamp': '2016-10-20T22:13:04.003420', 'user': 'sudo_USER', 'arg': ['/root/myip.txt'], 'fun': 'cp.push', 'minions': ['MINION_ID']}
2016-10-20 17:13:04,005 [salt.utils.event ][TRACE ][6507] get_event() received = {'tag': '20161020171304002177', 'data': {'_stamp': '2016-10-20T22:13:04.002262', 'minions': ['MINION_ID']}}
2016-10-20 17:13:04,005 [salt.returners ][INFO ][6535] Using default for mysql ssl_key
2016-10-20 17:13:04,005 [salt.utils.reactor ][DEBUG ][6507] Gathering reactors for tag 20161020171304002177
2016-10-20 17:13:04,006 [salt.returners ][INFO ][6535] Using default for mysql ssl_cert
2016-10-20 17:13:04,006 [salt.returners ][INFO ][6535] Using default for mysql port
2016-10-20 17:13:04,006 [salt.utils.event ][TRACE ][6507] get_event() received = {'tag': 'salt/job/20161020171304002177/new', 'data': {'tgt_type': 'glob', 'jid': '20161020171304002177', 'tgt': 'MINION_ID', '_stamp': '2016-10-20T22:13:04.003420', 'user': 'sudo_USER', 'arg': ['/root/myip.txt'], 'fun': 'cp.push', 'mini
ons': ['MINION_ID']}}
2016-10-20 17:13:04,007 [salt.returners ][INFO ][6535] Using default for mysql ssl_ca
2016-10-20 17:13:04,007 [salt.utils.reactor ][DEBUG ][6507] Gathering reactors for tag salt/job/20161020171304002177/new
2016-10-20 17:13:04,007 [salt.loaded.int.returner.mysql ][DEBUG ][6535] Trying to reuse MySQL connection pool
2016-10-20 17:13:04,011 [salt.master ][INFO ][6535] User sudo_USER Published command cp.push with jid 20161020171304002177
2016-10-20 17:13:04,011 [salt.master ][DEBUG ][6535] Published command details {'tgt_type': 'glob', 'jid': '20161020171304002177', 'tgt': 'MINION_ID', 'ret': '', 'user': 'sudo_USER', 'arg': ['/root/myip.txt'], 'fun': 'cp.push'}
2016-10-20 17:13:04,017 [salt.client ][TRACE ][24378] func get_cli_event_returns()
2016-10-20 17:13:04,023 [salt.utils.lazy ][DEBUG ][24378] LazyLoaded mysql.get_load
2016-10-20 17:13:04,028 [salt.utils.lazy ][DEBUG ][24378] LazyLoaded config.option
2016-10-20 17:13:04,028 [salt.returners ][INFO ][24378] Using default for mysql ssl_key
2016-10-20 17:13:04,028 [salt.returners ][INFO ][24378] Using default for mysql ssl_cert
2016-10-20 17:13:04,029 [salt.returners ][INFO ][24378] Using default for mysql port
2016-10-20 17:13:04,029 [salt.returners ][INFO ][24378] Using default for mysql ssl_ca
2016-10-20 17:13:04,029 [salt.loaded.int.returner.mysql][DEBUG ][24378] Generating new MySQL connection pool
2016-10-20 17:13:04,051 [salt.client ][DEBUG ][24378] get_iter_returns for jid 20161020171304002177 sent to set(['MINION_ID']) will timeout at 17:13:09.050518
2016-10-20 17:13:04,052 [salt.utils.event ][TRACE ][24378] _get_event() waited 0 seconds and received nothing
2016-10-20 17:13:04,064 [salt.utils.event ][TRACE ][24378] get_event() received = {'tag': 'salt/job/20161020171304002177/new', 'data': {'tgt_type': 'glob', 'jid': '20161020171304002177', 'tgt': 'MINION_ID', '_stamp': '2016-10-20T22:13:04.003420', 'user': 'sudo_USER', 'arg': ['/root/myip.txt'], 'fun': 'cp.push', 'minions': ['MINION_ID']}}
2016-10-20 17:13:04,072 [salt.master ][TRACE ][6560] AES payload received with command _file_recv
2016-10-20 17:13:04,073 [salt.master ][TRACE ][6560] Master function call _file_recv took 1.90734863281e-05 seconds
2016-10-20 17:13:04,086 [salt.master ][TRACE ][6551] AES payload received with command _return
2016-10-20 17:13:04,087 [salt.utils.job ][INFO ][6551] Got return from MINION_ID for job 20161020171304002177
2016-10-20 17:13:04,088 [salt.utils.event ][DEBUG ][6551] Sending event - data = {'fun_args': ['/root/myip.txt'], 'jid': '20161020171304002177', 'return': False, 'retcode': 0, 'success': True, 'cmd': '_return', '_stamp': '2016-10-20T22:13:04.087391', 'fun': 'cp.push', 'id': 'MINION_ID'}
2016-10-20 17:13:04,089 [salt.returners ][INFO ][6551] Using default for mysql ssl_key
2016-10-20 17:13:04,089 [salt.returners ][INFO ][6551] Using default for mysql ssl_cert
2016-10-20 17:13:04,090 [salt.utils.event ][TRACE ][6507] get_event() received = {'tag': 'salt/job/20161020171304002177/ret/MINION_ID', 'data': {'fun_args': ['/root/myip.txt'], 'jid': '20161020171304002177', 'return': False, 'retcode': 0, 'success': True, 'cmd': '_return', '_stamp': '2016-10-20T22:13:04.087391', 'fun':
'cp.push', 'id': 'MINION_ID'}}
2016-10-20 17:13:04,090 [salt.utils.event ][TRACE ][24378] get_event() received = {'tag': 'salt/job/20161020171304002177/ret/MINION_ID', 'data': {'fun_args': ['/root/myip.txt'], 'jid': '20161020171304002177', 'return': False, 'retcode': 0, 'success': True, 'cmd': '_return', '_stamp': '2016-10-20T22:13:04.087391', 'fun': 'cp.push', 'id': 'MINION_ID'}}
2016-10-20 17:13:04,090 [salt.utils.reactor ][DEBUG ][6507] Gathering reactors for tag salt/job/20161020171304002177/ret/MINION_ID
2016-10-20 17:13:04,090 [salt.returners ][INFO ][6551] Using default for mysql port
2016-10-20 17:13:04,091 [salt.returners ][INFO ][6551] Using default for mysql ssl_ca
2016-10-20 17:13:04,091 [salt.client ][DEBUG ][24378] jid 20161020171304002177 return from MINION_ID
2016-10-20 17:13:04,091 [salt.loaded.int.returner.mysql ][DEBUG ][6551] Trying to reuse MySQL connection pool
2016-10-20 17:13:04,095 [salt.master ][TRACE ][6551] Master function call _return took 0.00797820091248 seconds
2016-10-20 17:13:04,096 [salt.utils.lazy ][DEBUG ][24378] LazyLoaded nested.output
2016-10-20 17:13:04,097 [salt.output ][TRACE ][24378] data = {'MINION_ID': False}
2016-10-20 17:13:04,198 [salt.utils.event ][TRACE ][24378] _get_event() waited 0 seconds and received nothing
2016-10-20 17:13:04,199 [salt.client ][DEBUG ][24378] jid 20161020171304002177 found all minions set(['MINION_ID'])

Minion debug log (log_level: all)
2016-10-20 17:17:17,516 [salt.minion ][INFO ][8164] User sudo_USER Executing command cp.push with jid 20161020171304002177
2016-10-20 17:17:17,517 [salt.minion ][DEBUG ][8164] Command details {'tgt_type': 'glob', 'jid': '20161020171304002177', 'tgt': 'MINION_ID', 'ret': '', 'user': 'sudo_USER', 'arg': ['/root/myip.txt'], 'fun': 'cp.push'}
2016-10-20 17:17:17,540 [salt.minion ][INFO ][8283] Starting a new job with PID 8283
2016-10-20 17:17:17,543 [salt.utils.lazy ][DEBUG ][8283] LazyLoaded cp.push
2016-10-20 17:17:17,545 [salt.minion ][TRACE ][8283] Executors list ['direct_call.get']
2016-10-20 17:17:17,546 [salt.utils.lazy ][DEBUG ][8283] LazyLoaded direct_call.get
2016-10-20 17:17:17,546 [salt.loaded.int.module.cp ][DEBUG ][8283] Trying to copy '/root/myip.txt' to master
2016-10-20 17:17:17,546 [salt.crypt ][DEBUG ][8283] Initializing new SAuth for ('/etc/salt/pki/minion', 'MINION_ID', 'tcp://MASTER_IP:4506')
2016-10-20 17:17:17,550 [salt.crypt ][DEBUG ][8283] Loaded minion key: /etc/salt/pki/minion/minion.pem
2016-10-20 17:17:17,556 [salt.transport.zeromq ][DEBUG ][8283] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'MINION_ID', 'tcp://MASTER_IP:4506', 'aes')
2016-10-20 17:17:17,557 [salt.crypt ][DEBUG ][8283] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'MINION_ID', 'tcp://MASTER_IP:4506')
2016-10-20 17:17:17,559 [salt.transport.zeromq ][TRACE ][8283] Inserted key into loop_instance_map id 43644256 for key ('/etc/salt/pki/minion', 'MINION_ID', 'tcp://MASTER_IP:4506', 'aes') and process 8283
2016-10-20 17:17:17,571 [salt.loaded.int.module.cp ][ERROR ][8283] cp.push Failed transfer failed. Ensure master has 'file_recv' set to 'True' and that the file is not larger than the 'file_recv_size_max' setting on the master.
2016-10-20 17:17:17,573 [salt.minion ][DEBUG ][8283] Minion return retry timer set to 7 seconds (randomized)
2016-10-20 17:17:17,573 [salt.minion ][INFO ][8283] Returning information for job: 20161020171304002177
2016-10-20 17:17:17,574 [salt.transport.zeromq ][DEBUG ][8283] Initializing new AsyncZeroMQReqChannel for ('/etc/salt/pki/minion', 'MINION_ID', 'tcp://MASTER_IP:4506', 'aes')
2016-10-20 17:17:17,574 [salt.crypt ][DEBUG ][8283] Initializing new AsyncAuth for ('/etc/salt/pki/minion', 'MINION_ID', 'tcp://MASTER_IP:4506')
2016-10-20 17:17:17,578 [salt.transport.zeromq ][TRACE ][8283] Inserted key into loop_instance_map id 43644112 for key ('/etc/salt/pki/minion', 'MINION_ID', 'tcp://MASTER_IP:4506', 'aes') and process 8283
2016-10-20 17:17:17,594 [salt.minion ][TRACE ][8283] ret_val = None
2016-10-20 17:17:22,168 [salt.utils.process ][TRACE ][8164] Process manager iteration

Versions Report

(Provided by running salt --versions-report. Please also mention any differences in master/minion versions.)

Master version:

Salt Version:
Salt: 2016.3.3

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: 1.4.1
gitdb: 0.5.4
gitpython: 0.3.2 RC1
ioflo: Not Installed
Jinja2: 2.2.1
libgit2: 0.20.0
libnacl: Not Installed
M2Crypto: Not Installed
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: 1.2.3c1
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: 0.20.3
Python: 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
python-gnupg: 0.3.8
PyYAML: 3.11
PyZMQ: 14.5.0
RAET: Not Installed
smmap: 0.8.1
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 4.0.5

System Versions:
dist: centos 6.6 Final
machine: x86_64
release: 2.6.32-504.el6.x86_64
system: Linux
version: CentOS 6.6 Final

Minion version:

Salt Version:
Salt: 2016.3.2

Dependency Versions:
cffi: Not Installed
cherrypy: Not Installed
dateutil: Not Installed
gitdb: Not Installed
gitpython: Not Installed
ioflo: Not Installed
Jinja2: unknown
libgit2: Not Installed
libnacl: Not Installed
M2Crypto: 0.20.2
Mako: Not Installed
msgpack-pure: Not Installed
msgpack-python: 0.4.6
mysql-python: Not Installed
pycparser: Not Installed
pycrypto: 2.6.1
pygit2: Not Installed
Python: 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
python-gnupg: 0.3.8
PyYAML: 3.10
PyZMQ: 14.3.1
RAET: Not Installed
smmap: Not Installed
timelib: Not Installed
Tornado: 4.2.1
ZMQ: 3.2.5

System Versions:
dist: centos 6.4 Final
machine: x86_64
release: 2.6.32-358.el6.x86_64
system: Linux
version: CentOS 6.4 Final

Activity

  1. jbouse commented on Oct 21, 2016

    @jbouse
    Contributor

    I've experienced this as well...

    # salt minion cp.push /etc/fstab
    minion:
        The minion function caused an exception: Traceback (most recent call last):
          File "/usr/lib/python2.7/dist-packages/salt/minion.py", line 1332, in _thread_return
            return_data = executor.execute()
          File "/usr/lib/python2.7/dist-packages/salt/executors/direct_call.py", line 28, in execute
            return self.func(*self.args, **self.kwargs)
          File "/usr/lib/python2.7/dist-packages/salt/modules/cp.py", line 799, in push
            load_path_list = os.path.split(load_path_split_drive)
          File "/usr/lib/python2.7/posixpath.py", line 92, in split
            i = p.rfind('/') + 1
        AttributeError: 'tuple' object has no attribute 'rfind'
    

    Going on to the minion itself and running Python interpreter while running the lines of modules/cp.py manually I get the following through debugging:

    >>> path = '/etc/fstab'
    >>> load_path = path.lstrip(os.sep)
    >>> load_path
    'etc/fstab'
    >>> load_path_normal = os.path.normpath(load_path)
    >>> load_path_normal
    'etc/fstab'
    >>> load_path_split_drive = os.path.splitdrive(load_path_normal)[1:]
    >>> load_path_split_drive
    ('etc/fstab',)
    >>> load_path_list = os.path.split(load_path_split_drive)
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/usr/lib/python2.7/posixpath.py", line 92, in split
        i = p.rfind('/') + 1
    AttributeError: 'tuple' object has no attribute 'rfind'
    

    It looks like it is 81c4d13 that introduced this change.

  2. jayma777 commented on Oct 21, 2016

    @jayma777
    Author

    That error was fixed in another PR.

    You can either downgrade to 2016.3.2 (which supposedly fixes it, haven't verified that)

    or

    In /usr/lib/python2.7/dist-packages/salt/modules/cp.py change:
    load_path_split_drive = os.path.splitdrive(load_path_normal)[1:]
    to
    load_path_split_drive = os.path.splitdrive(load_path_normal)[1](Somewhere around line 790)

    This worked for me. You'll need to change it for each minion.

  3. gtmanfred commented on Oct 21, 2016

    @gtmanfred
    Contributor

    This is going to be fixed in 2016.3.4.

    Duplicate of #35984

  4. added
    Duplicate
    on Oct 21, 2016
  5. added this to the Approved milestone on Oct 21, 2016
  6. modified the milestones: Blocked, Approved on Oct 21, 2016
  7. gtmanfred commented on Oct 21, 2016

    @gtmanfred
    Contributor

    @jayma777 is your issue different than that one?

  8. added
    needs-more-info
    and removed
    Duplicate
    on Oct 21, 2016
  9. gtmanfred commented on Oct 21, 2016

    @gtmanfred
    Contributor

    This appears to be a duplicate of #36860 if it is a new issue.

  10. jayma777 commented on Oct 21, 2016

    @jayma777
    Author

    My issue is different from the one presented by jbouse. It might be related or duplicate of #36860. It's difficult to tell. It seems as if the master is ignoring the file_recv setting. If there is a way to view the "loaded" settings, I might be able to figure out why the master doesn't see it.

  11. gtmanfred commented on Oct 21, 2016

    @gtmanfred
    Contributor

    If you run salt-call config.get file_recv and you don't have file_recv in any minion pillar or grains configs, i believe it should pull the config from the master.

  12. 17 remaining items

  13. GabLeRoux commented on Jun 17, 2017

    @GabLeRoux

    @gtmanfred see my comment: #37133 (comment)

    I was having the issue when the salt master was on 2016.3.3, I wasn't able to reproduce on 2016.11.1 or later.

  14. gtmanfred commented on Jun 17, 2017

    @gtmanfred
    Contributor
  15. GabLeRoux commented on Jun 17, 2017

    @GabLeRoux

    @gtmanfred 2016.3.3 (as shown in the linked comment's sudo salt-call --versions-report, same as salt master)

  16. swohlerLL commented on Jun 21, 2017

    @swohlerLL

    This problem also occurs after upgrading our master from 2015.8.8 to 2015.8.13. The minions did not change (2015.5.3).

    Versions:

    MASTER

    xxxxx@xxxxx-salt-master:/etc/salt$ sudo salt --versions-report
    Salt Version:
               Salt: 2015.8.13
    
    Dependency Versions:
             Jinja2: 2.8
           M2Crypto: Not Installed
               Mako: 1.0.3
             PyYAML: 3.11
              PyZMQ: 15.2.0
             Python: 2.7.12 (default, Nov 19 2016, 06:48:10)
               RAET: Not Installed
            Tornado: 4.2.1
                ZMQ: 4.1.4
               cffi: Not Installed
           cherrypy: Not Installed
           dateutil: 2.5.3
              gitdb: 0.6.4
          gitpython: 1.0.1
              ioflo: Not Installed
            libgit2: Not Installed
            libnacl: Not Installed
       msgpack-pure: Not Installed
     msgpack-python: 0.4.6
       mysql-python: Not Installed
          pycparser: Not Installed
           pycrypto: 2.6.1
             pygit2: Not Installed
       python-gnupg: Not Installed
              smmap: 0.9.0
            timelib: Not Installed
    
    System Versions:
               dist: Ubuntu 16.04 xenial
            machine: x86_64
            release: 4.4.0-81-generic
             system: Ubuntu 16.04 xenial
    

    MINION

    xxxxx@xxxxx-salt-master:/etc/salt$ sudo salt '*16-a0' cmd.run 'salt-call --versions-report'
    xxxxx_00-0d-b9-40-16-a0:
                          Salt: 2015.5.3
                        Python: 2.7.3 (default, Mar 13 2014, 11:03:55)
                        Jinja2: 2.6
                      M2Crypto: 0.21.1
                msgpack-python: 0.1.10
                  msgpack-pure: Not Installed
                      pycrypto: 2.6
                       libnacl: Not Installed
                        PyYAML: 3.10
                         ioflo: Not Installed
                         PyZMQ: 13.1.0
                          RAET: Not Installed
                           ZMQ: 3.2.3
                          Mako: Not Installed
                       Tornado: Not Installed
         Debian source package: 2015.5.3+ds-1~bpo70+2
    

    COMMANDS

    xxxxx@xxxxx-salt-master:/etc/salt$ sudo salt '*16-a0' cp.push /tmp/salt_log.gz
    xxxxx_00-0d-b9-40-16-a0:
        False
    
    xxxxx@xxxxx-salt-master:/etc/salt$ sudo salt '*16-a0' cmd.run 'salt-call config.get file_recv'
    xxxxx_00-0d-b9-40-16-a0:
        local:
            False
    

    CONFIG

    xxxxx@xxxxx-salt-master:/etc/salt$ cat master | grep file_recv
    file_recv: True
    file_recv_size_max: 400
    
  17. ngeovanis commented on Oct 4, 2017

    @ngeovanis

    Is there a resolution for this problem as of 1 October 2017?

  18. gtmanfred commented on Oct 4, 2017

    @gtmanfred
    Contributor

    As far as I am aware, cp.push is still working.

    the 2015 versions that are mentioned in this issue are not supported anymore. I have still never been able to replicate this issue.

    If someone can provide me a vagrant environment, or steps to reliably reproduce this, we can take a look.

    Thanks,
    Daniel

  19. ngeovanis commented on Oct 4, 2017

    @ngeovanis

    I can confirm that the issue exists with a master at 2016.11.3 and minions at 2016.3.1. The master runs on Debian 8.7 and the failing minions at Debian 7.7 and 7.11.
    All other minions here are at 2015.5.0 and 2015.5.3, and all fail with the "cp.push Failed transfer failed. Ensure master has 'file_recv' set to 'True' and that the file is not larger than the 'file_recv_size_max' setting on the master."

    Despite the message:
    root@salt01:/tmp# grep 'file_recv' /etc/salt/master
    file_recv: True
    file_recv_max_size: 100
    root@salt01:/tmp#

  20. ngeovanis commented on Oct 4, 2017

    @ngeovanis

    I should have added that the issue does not occur with the 2016.11.3 master and minions which are at 2016.11.2 and 2016.11.3.

  21. gtmanfred commented on Oct 4, 2017

    @gtmanfred
    Contributor

    Ok, i have been able to replicate this with the minion on 2016.3.1, but once I update to 2016.3.8 it all works, so it looks like it was fixed in a 2016.3 release.

    Thanks,
    Daniel

  22. added
    fixed-pls-verify
    on Oct 4, 2017
  23. marbx commented on Nov 9, 2017

    @marbx
    Contributor

    cp.push returns False
    master: 2016.11.5 (Debian)
    minions: 2016.11.3 (Windows)

  24. gaetanquentin commented on Oct 11, 2018

    @gaetanquentin

    pb still here.
    master: 2017.7.7 , ubuntu 14.04
    minion: 2016.3.2 , Microsoft Windows Server 2016 Datacenter

  25. stale commented on Jan 9, 2020

    @stale

    This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

    If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    fixed-pls-verifyneeds-more-infostale

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions