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

zmq.error.ZMQError: Socket operation on non-socket #20668

Closed
battaglia01 opened this issue Mar 10, 2023 · 2 comments
Closed

zmq.error.ZMQError: Socket operation on non-socket #20668

battaglia01 opened this issue Mar 10, 2023 · 2 comments

Comments

@battaglia01
Copy link
Contributor

Description

What steps will reproduce the problem?

I keep getting this error again and again when using Spyder, and I haven't quite figured out what causes it to happen, but it's happened about a thousand times the past week so I figured I'll submit it. Sorry I don't have more details, except I'm on macOS M1, and running a program which involves both Cython and multithreading.

Traceback

Exception in callback BaseAsyncIOLoop._handle_events(352, 1)
handle: <Handle BaseAsyncIOLoop._handle_events(352, 1)>
Traceback (most recent call last):
  File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/tornado/platform/asyncio.py", line 206, in _handle_events
    handler_func(fileobj, events)
  File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/zmq/eventloop/zmqstream.py", line 614, in _handle_events
    zmq_events = self.socket.EVENTS
                 ^^^^^^^^^^^^^^^^^^
  File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/zmq/sugar/attrsettr.py", line 56, in __getattr__
    return self._get_attr_opt(upper_key, opt)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/mike/Library/miniconda3/envs/spyder-env/lib/python3.11/site-packages/zmq/sugar/attrsettr.py", line 68, in _get_attr_opt
    return self.get(opt)
           ^^^^^^^^^^^^^
  File "zmq/backend/cython/socket.pyx", line 512, in zmq.backend.cython.socket.Socket.get
  File "zmq/backend/cython/socket.pyx", line 270, in zmq.backend.cython.socket._getsockopt
  File "zmq/backend/cython/checkrc.pxd", line 28, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Socket operation on non-socket

Versions

  • Spyder version: 5.4.2 (conda)
  • Python version: 3.11.0 64-bit
  • Qt version: 5.15.6
  • PyQt5 version: 5.15.7
  • Operating System: Darwin 21.6.0

Dependencies

# Mandatory:
applaunchservices >=0.3.0     :  0.3.0 (OK)
atomicwrites >=1.2.0          :  1.4.1 (OK)
chardet >=2.0.0               :  5.1.0 (OK)
cloudpickle >=0.5.0           :  2.2.1 (OK)
cookiecutter >=1.6.0          :  2.1.1 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.0.2 (OK)
IPython >=7.31.1;<9.0.0       :  8.11.0 (OK)
jedi >=0.17.2;<0.19.0         :  0.18.2 (OK)
jellyfish >=0.7               :  0.9.0 (OK)
jsonschema >=3.2.0            :  4.17.3 (OK)
keyring >=17.0.0              :  23.13.1 (OK)
nbconvert >=4.0               :  7.2.9 (OK)
numpydoc >=0.6.0              :  1.5.0 (OK)
parso >=0.7.0;<0.9.0          :  0.8.3 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.4 (OK)
pygments >=2.0                :  2.14.0 (OK)
pylint >=2.5.0;<3.0           :  2.16.3 (OK)
pylint_venv >=2.1.1           :  3.0.1 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.7.1;<1.8.0          :  1.7.1 (OK)
pylsp_black >=1.2.0           :  1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0     :  3.0.3 (OK)
qstylizer >=0.2.2             :  0.2.2 (OK)
qtawesome >=1.2.1             :  1.2.2 (OK)
qtconsole >=5.4.0;<5.5.0      :  5.4.0 (OK)
qtpy >=2.1.0                  :  2.3.0 (OK)
rtree >=0.9.7                 :  1.0.1 (OK)
setuptools >=49.6.0           :  67.4.0 (OK)
sphinx >=0.6.6                :  6.1.3 (OK)
spyder_kernels >=2.4.2;<2.5.0 :  2.4.2 (OK)
textdistance >=4.2.0          :  4.5.0 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3             :  2.3.1 (OK)
zmq >=22.1.0                  :  25.0.0 (OK)

# Optional:
cython >=0.21                 :  None (NOK)
matplotlib >=3.0.0            :  None (NOK)
numpy >=1.7                   :  None (NOK)
pandas >=1.1.1                :  None (NOK)
scipy >=0.17.0                :  None (NOK)
sympy >=0.7.3                 :  None (NOK)
@spchamp
Copy link

spchamp commented Mar 10, 2023

I'm not certain if the following could be related - something about zmq anyway? although a different code location in the following

I've seen the following notification from jupyter_client on the console, when running a Spyder installed on FreeBSD 13.2

<project_path>/env3.10/lib/python3.10/site-packages/jupyter_client/threaded.py:73: RuntimeWarning: ZMQStream only supports the base zmq.Socket class.

                Use zmq.Socket(shadow=other_socket)
                or `ctx.socket(zmq.SUB, socket_class=zmq.Socket)`
                to create a base zmq.Socket object,
                no matter what other kind of socket your Context creates.
                
  self.stream = zmqstream.ZMQStream(self.socket, self.ioloop)

This is appearing with jupyter_client-7.4.9, pyzmq-25.0.0. I've seen a similar message with a virtualenv installed for Python 3.11

@ccordoba12
Copy link
Member

Hey @battaglia01, thanks for reporting. This is a duplicate of issue #20381, so I'm going to close it in favor of that one.

@spchamp, what you're seeing is just a warning. It's also mentioned on that issue.

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

3 participants