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

Declaring an exchange with no permission should be handled better #2

Closed
fetep opened this issue May 21, 2011 · 2 comments
Closed

Declaring an exchange with no permission should be handled better #2

fetep opened this issue May 21, 2011 · 2 comments
Assignees
Milestone

Comments

@fetep
Copy link

fetep commented May 21, 2011

NoMethodError: undefined method `payload' for nil:NilClass
next_payload at /home/petef/.rvm/gems/jruby-1.6.0/gems/bunny-0.6.0/lib/qrack/client.rb:84
open_connection at /home/petef/.rvm/gems/jruby-1.6.0/gems/bunny-0.6.0/lib/bunny/client08.rb:210
start_session at /home/petef/.rvm/gems/jruby-1.6.0/gems/bunny-0.6.0/lib/bunny/client08.rb:397
loop at org/jruby/RubyKernel.java:
start_session at /home/petef/.rvm/gems/jruby-1.6.0/gems/bunny-0.6.0/lib/bunny/client08.rb:389
(root) at bunny-bug.rb:7

This happens when you try connecting with a valid username/password, but one that has no permissions on the vhost in question. To reproduce, here's the code:

b = Bunny.new({:vhost => "/test", :user => "guest", :pass => "guest"})
b.start
e = b.exchange("rawlogs", :type => "direct")

and assuming rabbitmq, you'll need to "rabbitmqctl add_vhost /test" to create the vhost. By default, the "guest" user will not have access to create exchanges under /test.

Expected behavior: a Bunny:: exception with a better error message

@ghost ghost assigned botanicus Jul 5, 2011
@botanicus
Copy link

BTW this is the very same one as celldee#21 I'm on it now.

@botanicus
Copy link

Should work now, it does for me at least. If you can check it, that'd be groovy.

michaelklishin pushed a commit that referenced this issue Jun 16, 2021
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

2 participants