Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

salt-ssh from python2.6 master to python2.7 minion fails on "from _elementtree import *" #26171

Closed
HG00 opened this issue Aug 10, 2015 · 7 comments
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P1 Priority 1 Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Milestone

Comments

@HG00
Copy link
Contributor

HG00 commented Aug 10, 2015

Sorry if this is the wrong place to put this - I dont have a solution at the moment so hoping for some help!

master: Scientific Linux 6.6 (Centos/RHEL 6.6)
salt-ssh --versions-report
           Salt: 2015.5.3
         Python: 2.6.6 (r266:84292, Jul 22 2015, 16:47:47)
         Jinja2: 2.2.1
       M2Crypto: 0.20.2
 msgpack-python: 0.4.6
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 14.3.1
           RAET: Not Installed
            ZMQ: 3.2.5
           Mako: Not Installed
        Tornado: Not Installed

We're trying to use salt-ssh from centos6.6 to ubuntu 14.04 minions, it seems to get a lot of the way, but then fail with this:

salt-ssh -i cserver4 test.ping
cserver4:
    ----------
    retcode:
        1
    stderr:
        Traceback (most recent call last):
          File "/tmp/.root_62a99a__salt/salt-call", line 4, in <module>
            salt_call()
          File "/tmp/.root_62a99a__salt/salt/scripts.py", line 221, in salt_call
            import salt.cli.call
          File "/tmp/.root_62a99a__salt/salt/cli/call.py", line 6, in <module>
            from salt.utils import parsers
          File "/tmp/.root_62a99a__salt/salt/utils/parsers.py", line 28, in <module>
            import salt.config as config
          File "/tmp/.root_62a99a__salt/salt/config.py", line 28, in <module>
            import salt.utils.network
          File "/tmp/.root_62a99a__salt/salt/utils/network.py", line 26, in <module>
            from salt._compat import subprocess
          File "/tmp/.root_62a99a__salt/salt/_compat.py", line 22, in <module>
            import xml.etree.cElementTree as ElementTree
          File "/tmp/.root_62a99a__salt/xml/etree/cElementTree.py", line 3, in <module>
            from _elementtree import *
          File "<string>", line 147, in <module>
        AttributeError: 'module' object has no attribute 'fromstringlist'
    stdout:

If I install salt-ssh on another ubuntu14.04 box (python2.7) and retry, it works just fine:

salt-ssh cserver4 test.ping
cserver4:
    True

Any ideas? I can test / run anything that will be helpful

@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Core relates to code central or existential to Salt Salt-SSH P3 Priority 3 labels Aug 10, 2015
@jfindlay jfindlay added this to the Approved milestone Aug 10, 2015
@jfindlay
Copy link
Contributor

@HG00, thanks for the report. This looks to be an overlooked incompatibility or assumption when packing up the thin tar ball from the centos 6 system to the ubuntu system.

@HG00
Copy link
Contributor Author

HG00 commented Aug 11, 2015

thanks @jfindlay - happy to help with any info/test you need.

@javicacheiro
Copy link

Same problem running salt-ssh from a centos 6.7 master to a centos 7.1 minion (RHEL7 ships with python 2.7).

I would suggest to mention this issue in the salt-ssh documentation so people are aware of the problem (it is quite common to have python 2.7 minions these days).

@dreampuf
Copy link
Contributor

+1

@dreampuf
Copy link
Contributor

@grep4linux
Copy link
Contributor

I ran into this exact error and verified the temporary fix from dreampuf.
My master is CentOS 6.5 with Python 2.6.6 and my broken minion is Ubuntu 14.04.2 LTS with Python 2.7.6.

Wrote state to fix:

# File:    /srv/salt/setup/fix-salt-thin.sls
# PURPOSE: Fix for https://github.com/saltstack/salt/issues/18425
# ISSUE:   Problem in Python when master is Python 2.6 and minion
#          is 2.7  

# NOTES:   If you already SSH'd to the host then you will need to
#          delete the salt thin directory on the minion:
#          rm /tmp/.user_hex_salt


# Fix the thin.py
fix_salt_thin:
  file.replace:
    - name: /usr/lib/python2.6/site-packages/salt/utils/thin.py
    - pattern: '^    HAS_XML = True'
    - repl: '    HAS_XML = False'

# Remove the old Salt thin tarball
remove_old_salt_thin:
  file.absent:
    - name: /var/cache/salt/master/thin/thin.tgz

@jfindlay jfindlay added P1 Priority 1 and removed P3 Priority 3 labels Feb 22, 2016
@stale
Copy link

stale bot commented Mar 30, 2018

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.

@stale stale bot added the stale label Mar 30, 2018
@stale stale bot closed this as completed Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug broken, incorrect, or confusing behavior Core relates to code central or existential to Salt P1 Priority 1 Salt-SSH severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around stale
Projects
None yet
Development

No branches or pull requests

5 participants