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-run broken in 2015.8? #27130

Closed
githubcdr opened this issue Sep 15, 2015 · 17 comments
Closed

salt-run broken in 2015.8? #27130

githubcdr opened this issue Sep 15, 2015 · 17 comments
Assignees
Labels
Bug broken, incorrect, or confusing behavior Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged Regression The issue is a bug that breaks functionality known to work in previous releases. Runners severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around ZRELEASED - Boron
Milestone

Comments

@githubcdr
Copy link
Contributor

Hi,

I noticed some strange errors using various salt-runners, it looks like salt-run;

 salt-run winrepo.update_git_repos
 salt-run manage.down -l all

[TRACE   ] data = Exception occurred in runner manage.down: Traceback (most recent call last):
Exception occurred in runner manage.down: Traceback (most recent call last):
  File "/usr/lib/python2.6/site-packages/salt/client/mixins.py", line 288, in low
    _functions = copy.deepcopy(self.functions)
  File "/usr/lib64/python2.6/copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib64/python2.6/copy.py", line 342, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib64/python2.6/copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "/usr/lib64/python2.6/copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib64/python2.6/copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib64/python2.6/copy.py", line 342, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib64/python2.6/copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "/usr/lib64/python2.6/copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib64/python2.6/copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib64/python2.6/copy.py", line 342, in _reconstruct
    state = deepcopy(state, memo)
  File "/usr/lib64/python2.6/copy.py", line 162, in deepcopy
    y = copier(x, memo)
  File "/usr/lib64/python2.6/copy.py", line 255, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib64/python2.6/copy.py", line 189, in deepcopy
    y = _reconstruct(x, rv, 1, memo)
  File "/usr/lib64/python2.6/copy.py", line 351, in _reconstruct
    y.__dict__.update(state)
AttributeError: 'NoneType' object has no attribute 'update'

I have this same bug confirmed on a Ubuntu 14.04 pip based Salstack installation.

Any help appreciated.

~~
Version information

CentOS6.7 patched

python --version
Python 2.6.6

[henkiewestbroek@saltstack salt ]# salt-master --versions-report
Salt Version:
           Salt: 2015.8.0

Dependency Versions:
         Jinja2: 2.7.3
       M2Crypto: 0.20.2
           Mako: 1.0.0
         PyYAML: 3.11
          PyZMQ: 14.5.0
         Python: 2.6.6 (r266:84292, Jul 23 2015, 15:22:56)
           RAET: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5
           cffi: 0.9.2
       cherrypy: 3.2.2
       dateutil: 2.4.0
          gitdb: 0.6.4
      gitpython: Not Installed
          ioflo: 1.1.2
        libnacl: 1.4.3
   msgpack-pure: 0.1.3
 msgpack-python: 0.4.6
   mysql-python: Not Installed
      pycparser: 2.10
       pycrypto: 2.6.1
         pygit2: Not Installed
   python-gnupg: Not Installed
          smmap: 0.9.0
        timelib: 0.2.4

System Versions:
           dist: centos 6.7 Final
        machine: x86_64
        release: 2.6.32-573.3.1.el6.x86_64
         system: CentOS 6.7 Final
@jfindlay jfindlay added Bug broken, incorrect, or confusing behavior severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around Regression The issue is a bug that breaks functionality known to work in previous releases. Core relates to code central or existential to Salt P2 Priority 2 Runners labels Sep 15, 2015
@jfindlay jfindlay added this to the Approved milestone Sep 15, 2015
@jfindlay
Copy link
Contributor

@githubcdr, thanks for the report.

@cachedout
Copy link
Contributor

I cannot replicate this at all. Can you provide additional information on how you installed your minion?

@githubcdr
Copy link
Contributor Author

Installed from repo.saltstack.com

[root@saltstack states ]# rpm -qa | grep salt
salt-2015.8.0-2.el6.noarch
salt-cloud-2015.8.0-2.el6.noarch
salt-master-2015.8.0-2.el6.noarch
salt-minion-2015.8.0-2.el6.noarch
salt-api-2015.8.0-2.el6.noarch
salt-ssh-2015.8.0-2.el6.noarch
[root@saltstack states ]# cat /etc/yum.repos.d/saltstack.repo
[saltstack-repo]
name=SaltStack repo for RHEL/CentOS $releasever
baseurl=https://repo.saltstack.com/yum/rhel$releasever
enabled=1
gpgcheck=1
gpgkey=https://repo.saltstack.com/yum/rhel$releasever/SALTSTACK-GPG-KEY.pub

I completely purged salt from my system, even moved /var/salt/cache, but that didn't fix the problem.

Any suggestions on how to further debug this issue? Could it be related to the python installation itself? Or a configuration option?

(Will try to reproduce this in a container)

@githubcdr
Copy link
Contributor Author

After a long docker debug-compare session I discovered that this issue seems related to the following master.conf setting;

cython_enable: True

After disabling this setting salt-run works again!

Really have no clue why how or what, but still feels this is a bug and might cause a lot of trouble for others in the same situation.

@cachedout
Copy link
Contributor

I can't replicate this even with this option turned on. Do you have custom cython salt modules that you're using on your system?

@jfindlay jfindlay added P3 Priority 3 and removed P2 Priority 2 labels Sep 17, 2015
@cachedout cachedout added the Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged label Sep 18, 2015
@githubcdr
Copy link
Contributor Author

I really have no idea, but I guess a RPM maintained version of cython vs a local pip installed cython caused this problem.

After removing the pip installed version and the RPM things worked again, reinstalling the Cython via yum caused this problem again.

I will leave this option disabled to prevent this issue.

@DmitryKuzmenko DmitryKuzmenko added the Confirmed Salt engineer has confirmed bug/feature - often including a MCVE label Oct 16, 2015
@DmitryKuzmenko DmitryKuzmenko self-assigned this Oct 16, 2015
@DmitryKuzmenko
Copy link
Contributor

Just reproduced on Arch.

@cachedout
Copy link
Contributor

@DmitryKuzmenko What was your installation method?

@DmitryKuzmenko
Copy link
Contributor

@cachedout python 2.7 in virtualenv, salt in git repo fetched by tag v2015.8.0 and PYTHONPATH appended with ./

(venv-salt)$ ./scripts/salt --versions
Salt Version:
           Salt: 2015.8.0

Dependency Versions:
         Jinja2: 2.8
       M2Crypto: 0.21.1
           Mako: Not Installed
         PyYAML: 3.11
          PyZMQ: 14.7.0
         Python: 2.7.10 (default, Sep  7 2015, 13:51:49)
           RAET: 0.6.1
        Tornado: 4.2.1
            ZMQ: 4.1.3
           cffi: Not Installed
       cherrypy: 3.8.0
       dateutil: 2.4.2
          gitdb: Not Installed
      gitpython: Not Installed
          ioflo: 1.3.9
        libnacl: 1.4.3
   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: Not Installed
        timelib: Not Installed

System Versions:
           dist:   
        machine: x86_64
        release: 4.2.3-1-ARCH

@cachedout
Copy link
Contributor

Wow, interesting. OK.

@DmitryKuzmenko
Copy link
Contributor

@cachedout can I continue or you'd like to bring this up?

@cachedout
Copy link
Contributor

I'm working on other things this morning but if you have time and want to investigate this, that would be great.

@DmitryKuzmenko
Copy link
Contributor

I'll. Thank you.

@DmitryKuzmenko
Copy link
Contributor

The issue appear because LazyLoader object imports module pyximport as it's field. Then the object is deepcopying that fails on copying the module object. As from copy module documentation, copy module isn't designed to copy module objects.

Fix: load pyximport into a global variable.

@DmitryKuzmenko
Copy link
Contributor

@githubcdr thank you! You've caught two bugs at once.

@githubcdr
Copy link
Contributor Author

@DmitryKuzmenko took some time to debug, but at least it was worth it

@DmitryKuzmenko
Copy link
Contributor

I've done here. Found 2 more unneeded deepcopy. The second PR could be merged too.

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 Confirmed Salt engineer has confirmed bug/feature - often including a MCVE Core relates to code central or existential to Salt fixed-pls-verify fix is linked, bug author to confirm fix P3 Priority 3 Pending-Discussion The issue or pull request needs more discussion before it can be closed or merged Regression The issue is a bug that breaks functionality known to work in previous releases. Runners severity-medium 3rd level, incorrect or bad functionality, confusing and lacks a work around ZRELEASED - Boron
Projects
None yet
Development

No branches or pull requests

4 participants