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

struct.error: unpack requires a buffer of 22 bytes #130

Open
mikecorey opened this issue Aug 22, 2018 · 5 comments
Open

struct.error: unpack requires a buffer of 22 bytes #130

mikecorey opened this issue Aug 22, 2018 · 5 comments

Comments

@mikecorey
Copy link

When trying to run pyre on Python 3.6.6 within conda i receive the following exception:

MikeBook-Pro:~ coreym$ 
MikeBook-Pro:~ coreym$ 
MikeBook-Pro:~ coreym$ source activate Dekker
(Dekker) MikeBook-Pro:~ coreym$ pip uninstall pyre
Skipping pyre as it is not installed.
(Dekker) MikeBook-Pro:~ coreym$ pip install https://github.com/zeromq/pyre/archive/master.zip
Collecting https://github.com/zeromq/pyre/archive/master.zip
  Downloading https://github.com/zeromq/pyre/archive/master.zip (47kB)
    100% |████████████████████████████████| 51kB 417kB/s 
Requirement already satisfied: pyzmq in ./.conda/envs/Dekker/lib/python3.6/site-packages (from pyre==0.3.2) (17.1.2)
Requirement already satisfied: ipaddress in ./.conda/envs/Dekker/lib/python3.6/site-packages (from pyre==0.3.2) (1.0.22)
Building wheels for collected packages: pyre
  Running setup.py bdist_wheel for pyre ... done
  Stored in directory: /private/var/folders/x5/909t85n17w162px23sgkcgf80000gn/T/pip-ephem-wheel-cache-1fdn08zh/wheels/ae/d8/a3/f11eb41a07473804c12272a25bbf97dccd63f01c5e444aa77b
Successfully built pyre
Installing collected packages: pyre
Successfully installed pyre-0.3.2
(Dekker) MikeBook-Pro:~ coreym$ python
Python 3.6.6 | packaged by conda-forge | (default, Jul 26 2018, 09:55:02) 
[GCC 4.2.1 Compatible Apple LLVM 6.1.0 (clang-602.0.53)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyre
>>> a = pyre.Pyre()
>>> a.start()
>>> Exception in thread Thread-1:
Traceback (most recent call last):
  File "/Users/coreym/.conda/envs/Dekker/lib/python3.6/threading.py", line 916, in _bootstrap_inner
    self.run()
  File "/Users/coreym/.conda/envs/Dekker/lib/python3.6/threading.py", line 864, in run
    self._target(*self._args, **self._kwargs)
  File "/Users/coreym/.conda/envs/Dekker/lib/python3.6/site-packages/pyre/zactor.py", line 57, in run
    self.shim_handler(*self.shim_args, **self.shim_kwargs)
  File "/Users/coreym/.conda/envs/Dekker/lib/python3.6/site-packages/pyre/pyre_node.py", line 53, in __init__
    self.run()
  File "/Users/coreym/.conda/envs/Dekker/lib/python3.6/site-packages/pyre/pyre_node.py", line 519, in run
    self.recv_beacon()
  File "/Users/coreym/.conda/envs/Dekker/lib/python3.6/site-packages/pyre/pyre_node.py", line 454, in recv_beacon
    beacon = struct.unpack('cccb16sH', frame)
struct.error: unpack requires a buffer of 22 bytes

>>> 

@sphaero
Copy link
Contributor

sphaero commented Aug 22, 2018

what do you get when you run the unittests, even travis is failing so we do have some trouble somewhere

@mikecorey
Copy link
Author

Test_zactor, test_zbeacon, test_zhelper all passed.

test_pyre failed with the following output:

MikeBook-Pro:~ coreym$ conda create -n basic_pyre python=3.6.6
Solving environment: done


==> WARNING: A newer version of conda exists. <==
  current version: 4.5.4
  latest version: 4.5.11

Please update conda by running

    $ conda update -n base conda



## Package Plan ##

  environment location: /anaconda2/envs/basic_pyre

  added / updated specs: 
    - python=3.6.6


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    setuptools-40.2.0          |           py36_0         554 KB  conda-forge

The following NEW packages will be INSTALLED:

    bzip2:           1.0.6-1              conda-forge
    ca-certificates: 2018.8.13-ha4d7672_0 conda-forge
    certifi:         2018.8.13-py36_0     conda-forge
    libffi:          3.2.1-hfc679d8_4     conda-forge
    ncurses:         6.1-hfc679d8_1       conda-forge
    openssl:         1.0.2o-h470a237_1    conda-forge
    pip:             18.0-py36_1          conda-forge
    python:          3.6.6-h5001a0f_0     conda-forge
    readline:        7.0-haf1bffa_1       conda-forge
    setuptools:      40.2.0-py36_0        conda-forge
    sqlite:          3.24.0-h2f33b56_0    conda-forge
    tk:              8.6.8-0              conda-forge
    wheel:           0.31.1-py36_1        conda-forge
    xz:              5.2.4-h470a237_1     conda-forge
    zlib:            1.2.11-h470a237_3    conda-forge

Proceed ([y]/n)? y


Downloading and Extracting Packages
setuptools-40.2.0    |  554 KB | ####################################### | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
#
# To activate this environment, use:
# > source activate basic_pyre
#
# To deactivate an active environment, use:
# > source deactivate
#

MikeBook-Pro:~ coreym$ source activate basic_pyre
(basic_pyre) MikeBook-Pro:~ coreym$ pip install https://github.com/zeromq/pyre/archive/master.zip
Collecting https://github.com/zeromq/pyre/archive/master.zip
  Downloading https://github.com/zeromq/pyre/archive/master.zip (47kB)
    100% |████████████████████████████████| 51kB 905kB/s 
Collecting pyzmq (from pyre==0.3.2)
  Using cached https://files.pythonhosted.org/packages/24/a9/7619afa48606e6cfe345c124f31942698c0c066f133c98c2dcbe72018349/pyzmq-17.1.2-cp36-cp36m-macosx_10_6_intel.whl
Collecting ipaddress (from pyre==0.3.2)
  Using cached https://files.pythonhosted.org/packages/fc/d0/7fc3a811e011d4b388be48a0e381db8d990042df54aa4ef4599a31d39853/ipaddress-1.0.22-py2.py3-none-any.whl
Building wheels for collected packages: pyre
  Running setup.py bdist_wheel for pyre ... done
  Stored in directory: /private/var/folders/x5/909t85n17w162px23sgkcgf80000gn/T/pip-ephem-wheel-cache-qb3t_lkk/wheels/ae/d8/a3/f11eb41a07473804c12272a25bbf97dccd63f01c5e444aa77b
Successfully built pyre
Installing collected packages: pyzmq, ipaddress, pyre
Successfully installed ipaddress-1.0.22 pyre-0.3.2 pyzmq-17.1.2
(basic_pyre) MikeBook-Pro:~ coreym$ cd workspace/
(basic_pyre) MikeBook-Pro:workspace coreym$ cd pyre/
(basic_pyre) MikeBook-Pro:pyre coreym$ cd tests/
(basic_pyre) MikeBook-Pro:tests coreym$ python test_pyre.py 
/anaconda2/envs/basic_pyre/lib/python3.6/site-packages/zmq/sugar/socket.py:110: DeprecationWarning: Socket.socket_type is deprecated, use Socket.type
  DeprecationWarning
......F.FFF.
======================================================================
FAIL: test_join_leave_msg (__main__.PyreTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_pyre.py", line 91, in test_join_leave_msg
    self.assertEqual(msg[0], b'JOIN')
AssertionError: b'ENTER' != b'JOIN'

======================================================================
FAIL: test_shout (__main__.PyreTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_pyre.py", line 151, in test_shout
    self.assertEqual(msg[0], b'JOIN')
AssertionError: b'ENTER' != b'JOIN'

======================================================================
FAIL: test_shouts (__main__.PyreTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_pyre.py", line 132, in test_shouts
    self.assertEqual(msg[0], b'JOIN')
AssertionError: b'ENTER' != b'JOIN'

======================================================================
FAIL: test_whispers (__main__.PyreTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_pyre.py", line 119, in test_whispers
    self.assertEqual(b"WHISPER", msg[0])
AssertionError: b'WHISPER' != b'ENTER'

----------------------------------------------------------------------
Ran 12 tests in 13.897s

FAILED (failures=4)
(basic_pyre) MikeBook-Pro:tests coreym$ 

@mikecorey
Copy link
Author

I should also mention that I made a fresh conda env for those tests (they also failed in the original conda env)

@sphaero
Copy link
Contributor

sphaero commented Aug 23, 2018

I'm not familiar with conda but as travis does complete, see here: https://travis-ci.org/zeromq/pyre/jobs/409289899
Can you try without conda?

@sphaero
Copy link
Contributor

sphaero commented Aug 24, 2018

I haven't tested OSX in ages. I guess it's also a good idea to add an osx unittest to travis

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants