salt icon indicating copy to clipboard operation
salt copied to clipboard

ExtraData: unpack(b) recieved extra data. Salt: 2016.3.1

Open damaex17 opened this issue 10 years ago • 8 comments

ExtraData: unpack(b) recieved extra data.

Setup

ran into this with salt-cloud when spawning multiple machines in parallel.

[INFO    ] Cloud pool size: 4
[WARNING ] Unable to obtain lock for /var/cache/salt/cloud/index.p
[WARNING ] Unable to obtain lock for /var/cache/salt/cloud/index.p
[WARNING ] Unable to obtain lock for /var/cache/salt/cloud/index.p
[WARNING ] Unable to obtain lock for /var/cache/salt/cloud/index.p
[ERROR   ] Caught Exception, terminating workers
TRACE: unpack(b) recieved extra data.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 60, in _call
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 2288, in create_multiprocessing
    local_master=parallel_data['local_master']
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1281, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py", line 2402, in create
    vm_['name'], vm_['profile'], 'ec2', vm_['driver']
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 2475, in cachedir_index_add
    index = msgpack.load(fh_)
  File "_unpacker.pyx", line 130, in msgpack._unpacker.unpack (msgpack/_unpacker.cpp:132)
  File "_unpacker.pyx", line 114, in msgpack._unpacker.unpackb (msgpack/_unpacker.cpp:114)
ExtraData: unpack(b) recieved extra data.



Error: There was a query error: Exception caught
Caught Exception, terminating workers
TRACE: unpack(b) recieved extra data.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 60, in _call
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 2288, in create_multiprocessing
    local_master=parallel_data['local_master']
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1281, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py", line 2402, in create
    vm_['name'], vm_['profile'], 'ec2', vm_['driver']
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 2475, in cachedir_index_add
    index = msgpack.load(fh_)
  File "_unpacker.pyx", line 130, in msgpack._unpacker.unpack (msgpack/_unpacker.cpp:132)
  File "_unpacker.pyx", line 114, in msgpack._unpacker.unpackb (msgpack/_unpacker.cpp:114)
ExtraData: unpack(b) recieved extra data.

Steps to Reproduce Issue

spawn/destroy multiple machines in parallel on the same master for a coupld of days.

Versions Report


Salt Version:
           Salt: 2016.3.1

Dependency Versions:
           cffi: Not Installed
       cherrypy: 3.2.2
       dateutil: 2.5.3
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.3.0
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-66-generic
         system: Linux
        version: Ubuntu 14.04 trusty

damaex17 avatar Jul 28 '16 11:07 damaex17

@damaex17 i'm having a hard time replicate this with the following test case:

map file:

ec2_ubuntu_14:
  - ch3ll-mom
  - ch3ll-syndic1

Running the following command sudo salt-cloud -P -m /etc/salt/cloud.maps.d/syndic.sls -ldebug it correctly sets up the VMs and I do not see the error.

I am using msgpack 0.4.7 version. If you upgrade your version of msgpack do you still see this error?

If still seeing the error can you provide any additional information that might help to replicate this behavior?

Ch3LL avatar Jul 29 '16 20:07 Ch3LL

Ch3LL, this problem doesn't show up immediately. Sometimes it goes fine for a couple of days until the issue shows up and after that I can only get the machine back working again by deleting /var/cache/salt/cloud/index.p.

It seems like a certain race condition is corrupting this file.

I will check for an newer version of msgpack and update this issue.

damaex17 avatar Aug 01 '16 08:08 damaex17

@damaex17 ahhh gotchya. yeah i only tried it once. Let us know once you are able to try a newer version to see if you are not seeing the issue anymore thanks.

Ch3LL avatar Aug 02 '16 17:08 Ch3LL

I updated python-msgpack and salt. I will check back once the issue comes up again.

Salt Version:
           Salt: 2016.3.2

Dependency Versions:
           cffi: Not Installed
       cherrypy: 3.2.2
       dateutil: 2.5.3
          gitdb: 0.5.4
      gitpython: 0.3.2 RC1
          ioflo: Not Installed
         Jinja2: 2.7.2
        libgit2: Not Installed
        libnacl: Not Installed
       M2Crypto: Not Installed
           Mako: 0.9.1
   msgpack-pure: Not Installed
 msgpack-python: 0.4.6
   mysql-python: 1.2.3
      pycparser: Not Installed
       pycrypto: 2.6.1
         pygit2: Not Installed
         Python: 2.7.6 (default, Jun 22 2015, 17:58:13)
   python-gnupg: Not Installed
         PyYAML: 3.10
          PyZMQ: 14.0.1
           RAET: Not Installed
          smmap: 0.8.2
        timelib: Not Installed
        Tornado: 4.2.1
            ZMQ: 4.0.5

System Versions:
           dist: Ubuntu 14.04 trusty
        machine: x86_64
        release: 3.13.0-66-generic
         system: Linux
        version: Ubuntu 14.04 trusty

damaex17 avatar Aug 08 '16 10:08 damaex17

This was happening again with an updated msgpack-python.


[ERROR   ] Caught Exception, terminating workers
TRACE: unpack(b) received extra data.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 60, in _call
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 2293, in create_multiprocessing
    local_master=parallel_data['local_master']
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1281, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py", line 2402, in create
    vm_['name'], vm_['profile'], 'ec2', vm_['driver']
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 2476, in cachedir_index_add
    index = msgpack.load(fh_)
  File "_unpacker.pyx", line 159, in msgpack._unpacker.unpack (msgpack/_unpacker.cpp:159)
  File "_unpacker.pyx", line 142, in msgpack._unpacker.unpackb (msgpack/_unpacker.cpp:142)
ExtraData: unpack(b) received extra data.



Error: There was a query error: Exception caught
Caught Exception, terminating workers
TRACE: unpack(b) received extra data.
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 60, in _call
    ret = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 2293, in create_multiprocessing
    local_master=parallel_data['local_master']
  File "/usr/lib/python2.7/dist-packages/salt/cloud/__init__.py", line 1281, in create
    output = self.clouds[func](vm_)
  File "/usr/lib/python2.7/dist-packages/salt/cloud/clouds/ec2.py", line 2402, in create
    vm_['name'], vm_['profile'], 'ec2', vm_['driver']
  File "/usr/lib/python2.7/dist-packages/salt/utils/cloud.py", line 2476, in cachedir_index_add
    index = msgpack.load(fh_)
  File "_unpacker.pyx", line 159, in msgpack._unpacker.unpack (msgpack/_unpacker.cpp:159)
  File "_unpacker.pyx", line 142, in msgpack._unpacker.unpackb (msgpack/_unpacker.cpp:142)
ExtraData: unpack(b) received extra data.

damaex17 avatar Aug 15 '16 08:08 damaex17

@Ch3LL FWIW, typically these errors aren't related to msgpack but instead an attempt to serialize a data structure (like an exception) that can't be serialized.

cachedout avatar Aug 15 '16 10:08 cachedout

@cachedout thanks for pointing that out, I apparently triaged this incorrectly. So in this case from the stack trace it appears there is an issue with salt-cloud when it attempts to call msgpack.load(fh_). I am not able to replicate this issue so triage wise what sort of information could we query from @damaex17 to ensure we get this fixed up for him? Thanks

Ch3LL avatar Aug 16 '16 16:08 Ch3LL

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[bot] avatar Jun 17 '18 17:06 stale[bot]