RPi-Jukebox-RFID icon indicating copy to clipboard operation
RPi-Jukebox-RFID copied to clipboard

🐛 | zmq.error.ZMQError: Protocol not supported

Open varac opened this issue 2 years ago • 4 comments

Bug

What I did

I followed the Phoniebox Development Runbook for Docker environments. I could build all docker images fine but when I start the containers with docker compose -f docker/docker-compose.yml -f docker/docker-compose.linux.yml up both the jukebox containter ends up in a restart loop.

I expected this to happen

The jukebox container should run successfully.

Further information that might help

jukebox  | Traceback (most recent call last):
jukebox  |   File "/home/pi/RPi-Jukebox-RFID/src/jukebox/run_jukebox.py", line 67, in <module>
jukebox  |     main()
jukebox  |   File "/home/pi/RPi-Jukebox-RFID/src/jukebox/run_jukebox.py", line 63, in main
jukebox  |     myjukebox.run()
jukebox  |   File "/home/pi/RPi-Jukebox-RFID/src/jukebox/jukebox/daemon.py", line 227, in run
jukebox  |     self.rpc_server = RpcServer()
jukebox  |   File "/home/pi/RPi-Jukebox-RFID/src/jukebox/jukebox/rpc/server.py", line 86, in __init__
jukebox  |     self.socket.bind(websocket_address)
jukebox  |   File "/usr/local/lib/python3.9/dist-packages/zmq/sugar/socket.py", line 226, in bind
jukebox  |     super().bind(addr)
jukebox  |   File "zmq/backend/cython/socket.pyx", line 562, in zmq.backend.cython.socket.Socket.bind
jukebox  |   File "zmq/backend/cython/checkrc.pxd", line 28, in zmq.backend.cython.checkrc._check_rc
jukebox  | zmq.error.ZMQError: Protocol not supported

Software

Base image and version

  • Raspberry PI OS lite (bullseye, 64 bit)

Branch / Release

  • Git tag V3.2.0

Hardware

Raspberry Pi 3 Model B Plus Rev 1.3

Possible soluton

I found that that this diff in jukebox.Dockerfile fixed it:

diff --git a/docker/jukebox.Dockerfile b/docker/jukebox.Dockerfile
index f1ac0714..94f469fa 100644
--- a/docker/jukebox.Dockerfile
+++ b/docker/jukebox.Dockerfile
@@ -8,6 +8,7 @@ RUN apt-get update && apt-get install -y \
     alsa-utils \
     libasound2-dev \
     libasound2-plugins \
+    libzmq3-dev \
     pulseaudio \
     pulseaudio-utils \
     --no-install-recommends \
@@ -31,7 +32,7 @@ RUN apt-get update && apt-get install -qq -y \
 COPY . ${INSTALLATION_PATH}
 
 RUN pip3 install --no-cache-dir -r ${INSTALLATION_PATH}/requirements.txt
-RUN pip3 install pyzmq
+RUN pip install -vv --no-binary pyzmq pyzmq --install-option --zmq=/usr 
 


I could create a PR if this solution is accepted.

varac avatar Jun 02 '22 21:06 varac

Related: #1814

varac avatar Jun 02 '22 21:06 varac

I just noticed that I get the same error following the official installation docs for future3.

Could fix this with:

sudo pip uninstall pyzmq                                                                                                                                                                                     
sudo apt install libzmq3-dev                                                                                                                                                                                 
sudo pip install -vv --no-binary pyzmq pyzmq --install-option --zmq=/usr  

varac avatar Jun 03 '22 06:06 varac

As mentioned by @ChisSoc most likely because of 64bit OS.

s-martin avatar Jun 03 '22 13:06 s-martin

Just quick feedback: I ran into the same issue following official future3 guide on pi zero 2w with 32bit bullseye and solved it the same way (only without the sudo)

derpeter avatar Jun 30 '22 14:06 derpeter

I am also still seeing this issue on Raspberry Pi Model 3B V1.2, Raspbian GNU/Linux 11 (bullseye) 32-bit, Python 3.9.2, pip 23.1.2, and Commit ID bd7bb789a31d358b505c825c5c695e9c2fc1eace from the future3/main.

The above script seems to still fix the problem although the pip install command options have slightly changed.

pip uninstall pyzmq
apt-get install libzmq3-dev
pip install --no-binary=:all: pyzmq

abirke avatar May 14 '23 12:05 abirke

Should be now fixed on future3/develop

https://github.com/MiczFlor/RPi-Jukebox-RFID/issues/2108#issuecomment-1809167778

can you check this?

closing for now. Feel free to post in #2108, if the issue still occurs.

s-martin avatar Nov 18 '23 18:11 s-martin