jina-ai / clip-as-service

🏄 Scalable embedding, reasoning, ranking for images and sentences with CLIP
https://clip-as-service.jina.ai
Other
12.39k stars 2.07k forks source link

zmq.error.ZMQError: Operation not permitted #293

Open NexusLee opened 5 years ago

NexusLee commented 5 years ago

Prerequisites

Please fill in by replacing [ ] with [x].

System information

Some of this information can be collected via this script.


Description

Please replace YOUR_SERVER_ARGS and YOUR_CLIENT_ARGS accordingly. You can also write your own description for reproducing the issue.

I'm using this command to start the server:

bert-serving-start -num_worker=1 -model_dir /app/model/chinese_L-12_H-768_A-12

Then this issue shows up:

I:VENTILATOR:[__i:__i: 66]:freeze, optimize and export graph, could take a while...
I:GRAPHOPT:[gra:opt: 52]:model config: /app/model/chinese_L-12_H-768_A-12/bert_config.json
I:GRAPHOPT:[gra:opt: 55]:checkpoint: /app/model/chinese_L-12_H-768_A-12/bert_model.ckpt
I:GRAPHOPT:[gra:opt: 59]:build graph...
I:GRAPHOPT:[gra:opt:128]:load parameters from checkpoint...
I:GRAPHOPT:[gra:opt:132]:optimize...
I:GRAPHOPT:[gra:opt:140]:freeze...
I:GRAPHOPT:[gra:opt:145]:write graph to a tmp file: /tmp/tmptpgyzj7m
I:VENTILATOR:[__i:__i: 74]:optimized graph is stored at: /tmp/tmptpgyzj7m
I:VENTILATOR:[__i:_ru:118]:bind all sockets
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python3.5/threading.py", line 914, in _bootstrap_inner
    self.run()
  File "/usr/local/lib/python3.5/dist-packages/bert_serving/server/__init__.py", line 104, in run
    self._run()
  File "/usr/local/lib/python3.5/dist-packages/zmq/decorators.py", line 75, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/zmq/decorators.py", line 75, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/zmq/decorators.py", line 75, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/bert_serving/server/zmq_decor.py", line 27, in wrapper
    return func(*args, **kwargs)
  File "/usr/local/lib/python3.5/dist-packages/bert_serving/server/__init__.py", line 120, in _run
    addr_front2sink = auto_bind(sink)
  File "/usr/local/lib/python3.5/dist-packages/bert_serving/server/helper.py", line 192, in auto_bind
    socket.bind('ipc://{}'.format(tmp_dir))
  File "zmq/backend/cython/socket.pyx", line 547, in zmq.backend.cython.socket.Socket.bind
  File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc
zmq.error.ZMQError: Operation not permitted

dockerfile:

FROM tensorflow/tensorflow:1.12.0-py3
RUN pip install bert-serving-server

COPY ./ /app
COPY ./entrypoint.sh /app
WORKDIR /app

run:

docker run -it --rm -p 5555:5555 -p 5556:5556 -v /e/project/docker/python/bert:/app -t bert-as-service sh

...

zyj008 commented 5 years ago

I met the same problem!
I installed tensorflow-gpu 1.11.0 in anaconda. After I type the command "bert-serving-start -model ./chinese_L-12_H-768_A-12 -num_worker=2", there comes an error: File "zmq/backend/cython/socket.pyx", line 547, in zmq.backend.cython.socket.Socket.bind File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc zmq.error.ZMQError: Operation not permitted

zyj008 commented 5 years ago

I have solved this problem. It may be due to the bad or unstable Internet. I didn't do anything and the problem fixed by itself.

NexusLee commented 5 years ago

@zyj008 不可能吧,你确定没改动什么吗

zyj008 commented 5 years ago

@NexusLee 我确定我啥也没动,然后它自己就好了。所以我猜可能是网络不稳定唉。我是在实验室服务器上的anaconda上装的,我弄成功的是cpu版本的tensorflow1.11.0,gpu版本tensorflow的我后来没弄。 另外,我在katacoda上测试dockerfile的时候,不会报zmq这个错误,但是会在最后一步 read and listening的时候出不来就卡住了。

NexusLee commented 5 years ago

@zyj008 好的,明天我试试 1.11 版本

IDIDIR commented 5 years ago

no, the problem is consistently reproduced. need create dir and export to env export ZEROMQ_SOCK_TMP_DIR=/tmp/zmq link: https://sanidem.home.blog/tag/docker/

NexusLee commented 5 years ago

@IDIDIR I tried it. I think it's a problem with old tmp dir

xiaoxue88 commented 5 years ago

i encounter the same problem, how did you guys solved it? help!!!!

lelelove1225 commented 5 years ago

i solved this at docker option. I think this problem caused by docker's permission. add privileged docker-option.

miemieshizuka commented 4 years ago

no, the problem is consistently reproduced. need create dir and export to env export ZEROMQ_SOCK_TMP_DIR=/tmp/zmq link: https://sanidem.home.blog/tag/docker/

屏幕快照 2020-08-19 10 18 15

Hi It seems like the link is a private site. Can u share the solution here?