pyrabbit icon indicating copy to clipboard operation
pyrabbit copied to clipboard

set_vhost_permissions raises NetworkError

Open GayatriNittala opened this issue 8 years ago • 2 comments

I'm using pyrabbit version 1.1.0 with RabbitMQ-3.6.0

Below is the python code I have written using pyrabbit

from pyrabbit.api import Client cl = Client('localhost:15672', 'guest', 'guest') print cl.is_alive() cl.create_vhost('example_vhost') print cl.get_vhost_names() print cl.get_vhost_permissions('example_vhost') cl.set_vhost_permissions('example_vhost', 'guest', '.', '.', '.*')

The output of script shows a NetworkError as shown below:

True [u'/', u'example_vhost'] None Traceback (most recent call last): File "C:\Gayatri\learning\test_pyrabbit.py", line 14, in cl.set_vhost_permissions('example_vhost', 'guest', '.', '.', '.*') File "C:\Python27\lib\site-packages\pyrabbit-1.1.0-py2.7.egg\pyrabbit\api.py", line 345, in set_vhost_permissions headers=Client.json_headers) File "C:\Python27\lib\site-packages\pyrabbit-1.1.0-py2.7.egg\pyrabbit\http.py" , line 111, in do_call raise NetworkError("Error: %s %s" % (type(out), out)) pyrabbit.http.NetworkError: Error: <class 'socket.error'> [Errno 10053] An estab lished connection was aborted by the software in your host machine

Any help to resolve this issue?

Thanks in Advance, Gayatri

GayatriNittala avatar Mar 03 '16 07:03 GayatriNittala

looks like i got the same issue: [rabbitCli.create_vhost(vHost) for vHost, ex in mqCfg['exchanges']] [rabbitCli.set_vhost_permissions(vHost, user, '.', '.', '.*' for vHost, ex in mqCfg['exchanges']] [rabbitCli.create_exchange(vHost, ex, 'topic') for vHost, ex in mqCfg['exchanges']]

at my case mqCfg['exchanges'] returns 7 items

  • never got error at line 1
  • about every second time line 2 made error
  • if line 2 is ok, almost every time 3-rd line made error

about 70% of error is 10054, rest ones - 10053

matroskin8 avatar Apr 29 '16 11:04 matroskin8

I fork and update module. Welcome https://github.com/deslum/pyrabbit2

deslum avatar Jul 24 '17 18:07 deslum