saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.18k stars 5.48k forks source link

AttributeError: 'module' object has no attribute 'exceptions' #27216

Closed freedba closed 9 years ago

freedba commented 9 years ago

Hi,

1, salt-master&salt-minion version:

# salt-master --versions-report
           Salt: 2015.5.5
         Python: 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
         Jinja2: 2.2.1
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   msgpack-pure: Not Installed
       pycrypto: 2.0.1
        libnacl: Not Installed
         PyYAML: 3.10
          ioflo: Not Installed
          PyZMQ: 2.2.0.1
           RAET: Not Installed
            ZMQ: 3.2.4
           Mako: Not Installed
        Tornado: Not Installed
        timelib: Not Installed
       dateutil: Not Installed

# salt-minion --versions-report
           Salt: 2015.5.5
         Python: 2.6.6 (r266:84292, Feb 22 2013, 00:00:18)
         Jinja2: unknown
       M2Crypto: 0.20.2
 msgpack-python: 0.1.13
   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.4
           Mako: Not Installed
        Tornado: Not Installed
        timelib: Not Installed
       dateutil: Not Installed

2, sls file

# cat codesync.sls 
{% if pillar.get('webserver-cms_role', '') %}
/home/webdata/cms/webroot:
  file.recurse:
    - source: salt://webserver/cms/webroot
    - saltenv: {{ pillar['webserver-cms_role'] }}
    - user: webdata
    - group: webdata
    - dir_mode: 755
    - file_mode: 644
    - include_empty: True
    - backup: minion
    - exclude_pat: E@(.svn)
{% endif %}

delete_war:
  module.run:
    - name: file.delete_backup
    - path: /home/webdata/cms/webroot/cms.war
    - backup_id: 7

delete_config:
  module.run:
    - name: file.delete_backup
    - path: /home/webdata/cms/webroot/config.tar.gz
    - backup_id: 7

3, execute sls

# salt -I "webserver-cms_role:preview" state.sls webserver.cms.codesync
stage-cms01.idc1.fn:
    The minion function caused an exception: Traceback (most recent call last):
      File "/usr/lib/python2.6/site-packages/salt/minion.py", line 1173, in _thread_return
        return_data = func(*args, **kwargs)
      File "/usr/lib/python2.6/site-packages/salt/modules/state.py", line 733, in sls
        serial.dump(high_, fp_)
      File "/usr/lib/python2.6/site-packages/salt/payload.py", line 174, in dump
        fn_.write(self.dumps(msg))
      File "/usr/lib/python2.6/site-packages/salt/payload.py", line 122, in dumps
        except (OverflowError, msgpack.exceptions.PackValueError):
    AttributeError: 'module' object has no attribute 'exceptions'

Please help me, Thanks

geertvd commented 9 years ago

Just this morning, I started having the exact same problem.

geertvd commented 9 years ago

Upgrading to v2015.8.0 Fix this for me, this was fixed in https://github.com/saltstack/salt/pull/26714

freedba commented 9 years ago

ok,, Thanks, I will upgrade to 8.0.

jfindlay commented 9 years ago

@freedba, thanks for the report. This is a duplicate of #26705 and is fixed in 2015.8.0 and will also come out in 2015.5.6.