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

set_vhost_permissions raises NetworkError #46

Open
GayatriNittala opened this issue Mar 3, 2016 · 2 comments
Open

set_vhost_permissions raises NetworkError #46

GayatriNittala opened this issue Mar 3, 2016 · 2 comments

Comments

@GayatriNittala
Copy link

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

@matroskin8
Copy link

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

@deslum
Copy link

deslum commented Jul 24, 2017

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

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